/* Rădăuţi Jewish Heritage — site styles. No frameworks, no web fonts. */

:root {
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --surface-2: #efe7d8;
  --text: #2a2019;
  --muted: #5c5046;
  --accent: #7b1e2b;
  --accent-ink: #fff;
  --line: #d8ccb9;
  --focus: #1a5fb4;
  --mark: #fbe7a1;
  --shadow: 0 1px 2px rgb(60 40 20 / .08), 0 4px 16px rgb(60 40 20 / .06);
  --radius: .5rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hebrew: "Noto Sans Hebrew", "Arial Hebrew", "David", Arial, sans-serif;
  --step--1: clamp(.83rem, .8rem + .15vw, .9rem);
  --step-0: clamp(1rem, .96rem + .2vw, 1.1rem);
  --step-1: clamp(1.2rem, 1.1rem + .5vw, 1.45rem);
  --step-2: clamp(1.45rem, 1.25rem + 1vw, 1.95rem);
  --step-3: clamp(1.75rem, 1.4rem + 1.8vw, 2.7rem);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1713;
    --surface: #25201a;
    --surface-2: #2f2922;
    --text: #efe7da;
    --muted: #c3b6a4;
    --accent: #f0a7b0;
    --accent-ink: #1b1713;
    --line: #463d33;
    --focus: #8cc4ff;
    --mark: #5a4a14;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--step-0)/1.65 var(--sans);
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; font-weight: 600; margin: 1.6em 0 .5em; text-wrap: balance; }
h1 { font-size: var(--step-3); margin-top: .4em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p, ul, ol, dl { margin: 0 0 1em; }
li + li { margin-top: .25em; }

a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

[lang="he"] { font-family: var(--hebrew); }

code { font-family: ui-monospace, Consolas, monospace; font-size: .95em; background: var(--surface-2); padding: .05em .35em; border-radius: .25em; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: .5rem; top: -4rem; z-index: 10;
  background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: .5rem; }

.wrap { width: min(100% - 2rem, 70rem); margin-inline: auto; }
.wrap-wide { width: min(100% - 2rem, 92rem); margin-inline: auto; }
.prose { max-width: 44rem; }

/* ---------- header & navigation ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 2rem; padding-block: .8rem; }
.brand { text-decoration: none; color: var(--text); display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-size: var(--step-1); font-weight: 700; color: var(--accent); }
.brand-sub { font-size: var(--step--1); color: var(--muted); letter-spacing: .04em; }

.site-nav { margin-inline-start: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.site-nav li + li { margin: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: .25rem .75rem;
  border-radius: 999px; color: var(--text); text-decoration: none; font-size: var(--step--1); font-weight: 500;
}
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

@media (max-width: 52rem) {
  .site-nav { margin-inline-start: 0; width: 100%; }
  .site-nav ul { gap: .15rem; }
  .site-nav a { padding-inline: .6rem; }
}

.breadcrumb { font-size: var(--step--1); color: var(--muted); padding-top: 1.25rem; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.breadcrumb li + li { margin: 0; }
.breadcrumb li + li::before { content: "›"; padding-inline: .5em; color: var(--muted); }

main { display: block; padding-bottom: 3rem; }
main:focus { outline: none; }

.lead { font-size: var(--step-1); color: var(--muted); font-family: var(--serif); line-height: 1.45; }
.byline { font-weight: 600; }
.note { color: var(--muted); font-style: italic; }
.muted { color: var(--muted); }

/* ---------- home ---------- */
.hero { display: grid; gap: 2rem; align-items: center; padding-block: 2rem 1rem; }
@media (min-width: 50rem) { .hero { grid-template-columns: 1.1fr 1fr; } }
.hero h1 { margin-top: 0; }
.hero figure { margin: 0; }
.hero img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.hero figcaption { font-size: var(--step--1); color: var(--muted); margin-top: .4rem; }

.button {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem 1.1rem;
  background: var(--accent); color: var(--accent-ink); border-radius: var(--radius);
  text-decoration: none; font-weight: 600;
}
.button:hover { filter: brightness(1.1); }
.button.secondary { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.cards { list-style: none; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.cards li + li { margin: 0; }
.card {
  position: relative; height: 100%; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--surface-2); }
.card-body { padding: .9rem 1rem 1.1rem; }
.card h2, .card h3 { font-size: var(--step-1); margin: 0 0 .35rem; }
.card p { margin: 0; color: var(--muted); font-size: var(--step--1); }
.card a { text-decoration: none; }
.card a::after { content: ""; position: absolute; inset: 0; }   /* whole card is clickable */
.card:hover { border-color: var(--accent); }
.card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.card a:focus-visible { outline: none; }

/* ---------- facts / text blocks ---------- */
.facts { list-style: none; padding: 0; display: grid; gap: .75rem; }
.facts li { background: var(--surface); border-inline-start: 4px solid var(--accent); padding: .75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 0; }

.callout { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-block: 1.5rem; }
.callout > :last-child { margin-bottom: 0; }

dl.defs dt { font-weight: 700; margin-top: 1rem; font-family: var(--serif); }
dl.defs dd { margin: .2rem 0 0; }
dl.codes { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; margin-top: .6rem; }
dl.codes dt { font-weight: 700; }
dl.codes dd { margin: 0; }

.two-col { display: grid; gap: 2rem; }
@media (min-width: 50rem) { .two-col { grid-template-columns: 1.4fr 1fr; align-items: start; } }

.names { columns: 14rem auto; column-gap: 2rem; padding-inline-start: 1.1rem; }
.names li { break-inside: avoid; }

/* ---------- links page ---------- */
.link-list { list-style: none; padding: 0; }
.link-list > li { padding: .9rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.link-list a { font-weight: 600; }
.link-list p { margin: .2rem 0 0; color: var(--muted); }
.badge {
  display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  padding: .05rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--muted);
  vertical-align: middle; margin-inline-start: .4rem;
}

/* ---------- bibliography ---------- */
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.toc h2 { margin-top: 0; font-size: var(--step-1); }
.toc ul { margin: 0; }
.biblio { list-style: none; padding: 0; }
.biblio li { padding: .55rem 0 .55rem 1.5rem; text-indent: -1.5rem; border-bottom: 1px dotted var(--line); margin: 0; }
.count { color: var(--muted); font-size: var(--step--1); margin-top: -.3rem; }
.back-top { font-size: var(--step--1); }

/* ---------- galleries ---------- */
.gallery { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.gallery li + li { margin: 0; }
.gallery figure { margin: 0; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery a { display: block; text-decoration: none; color: inherit; }
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--surface-2); transition: transform .3s ease; }
.gallery a:hover img { transform: scale(1.03); }
.gallery figcaption { padding: .5rem .75rem .7rem; font-size: var(--step--1); }

.photo { margin: 1rem 0; }
.photo img { margin-inline: auto; max-height: 80vh; width: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.photo figcaption { text-align: center; color: var(--muted); margin-top: .6rem; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin-top: 1.5rem; }
.pager a {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; padding: .4rem 1rem;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); text-decoration: none;
}
.pager a:hover { border-color: var(--accent); }
.pager .up { margin-inline: auto; }

.plan { max-width: 36rem; }

/* ---------- burial records ---------- */
.index-grid { list-style: none; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }
.index-grid li + li { margin: 0; }
.index-grid a {
  display: flex; flex-direction: column; min-height: 2.75rem; padding: .5rem .75rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none;
}
.index-grid a:hover { border-color: var(--accent); }
.index-grid .n { font-weight: 700; font-family: var(--serif); font-size: var(--step-1); }
.index-grid .c { font-size: .8rem; color: var(--muted); }
.letters { grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr)); }

.jump { font-size: var(--step--1); }
.jump ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.jump li + li { margin: 0; }
.jump a { display: inline-flex; min-width: 2.75rem; min-height: 2.75rem; align-items: center; justify-content: center; padding: 0 .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 2rem; }
.records { border-collapse: collapse; width: 100%; font-size: var(--step--1); line-height: 1.45; }
.records caption { text-align: start; padding: .75rem 1rem; font-family: var(--serif); font-weight: 600; font-size: var(--step-0); }
.records th, .records td { padding: .5rem .7rem; text-align: start; vertical-align: top; border-top: 1px solid var(--line); }
.records thead th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; white-space: nowrap; border-top: 0; z-index: 1; }
.records tbody th { font-weight: 400; min-width: 12rem; }
.records tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.records tbody tr:target { background: var(--mark); scroll-margin-top: 3rem; }
.records .sn { font-weight: 700; letter-spacing: .02em; }
.records .he { display: block; color: var(--muted); text-align: left; }
.records .sub { display: block; color: var(--muted); }
.records .loc { white-space: nowrap; }
.records details summary { cursor: pointer; color: var(--accent); white-space: nowrap; min-height: 1.75rem; }
.records details dl { display: grid; grid-template-columns: max-content minmax(10rem, 1fr); gap: .15rem .8rem; margin: .5rem 0 0; }
.records details dt { color: var(--muted); }
.records details dd { margin: 0; }

/* Card layout for narrow screens: each record becomes a labelled block. */
@media (max-width: 48rem) {
  .table-scroll { overflow: visible; border: 0; background: none; }
  .records, .records tbody, .records tr, .records th, .records td { display: block; }
  .records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .records caption { display: block; padding-inline: 0; }
  .records tbody tr { background: var(--surface) !important; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .75rem; padding: .5rem .25rem; }
  .records tbody tr:target { background: var(--mark) !important; }
  .records th, .records td { border: 0; padding: .2rem .75rem; }
  .records tbody th { font-size: var(--step-0); }
  .records td:empty { display: none; }
  .records td::before { font-weight: 600; color: var(--muted); }
  .records td:nth-child(2)::before { content: "Father: "; }
  .records td:nth-child(3)::before { content: "Died: "; }
  .records td:nth-child(4)::before { content: "Age: "; }
  .records td:nth-child(5)::before { content: "Location: "; }
  .records td:nth-child(6)::before { content: "Notes: "; }
  .records td:nth-child(7) { padding-top: .35rem; }
}

.search { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-block: 1.5rem; }
.search label { display: block; font-weight: 600; margin-bottom: .35rem; }
.search .row { display: flex; flex-wrap: wrap; gap: .5rem; }
.search input {
  flex: 1 1 16rem; min-height: 2.75rem; padding: .5rem .75rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--muted); border-radius: var(--radius);
}
.search button { font: inherit; border: 0; cursor: pointer; }
.search .hint { font-size: var(--step--1); color: var(--muted); margin: .4rem 0 0; }
.results { list-style: none; padding: 0; margin: 1rem 0 0; }
.results li { padding: .5rem 0; border-top: 1px solid var(--line); margin: 0; }
.results .meta { color: var(--muted); font-size: var(--step--1); }
.results [lang="he"] { text-align: left; }

/* ---------- footnotes ---------- */
.footnotes { font-size: var(--step--1); border-top: 1px solid var(--line); margin-top: 2.5rem; }
.footnotes h2 { font-size: var(--step-1); }
sup a { text-decoration: none; padding-inline: .1em; }

/* ---------- footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--muted); padding-block: 1.75rem; }
.site-footer p { margin: 0 0 .5rem; }
.site-footer a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .breadcrumb, .jump, .search, .skip-link, .pager { display: none !important; }
  body { background: #fff; color: #000; font-size: 10pt; }
  a { color: #000; }
  .table-scroll { overflow: visible; border: 0; }
  .records thead th { position: static; }
  .records details { display: none; }
  .records tr { break-inside: avoid; }
}
