/* Ida Haberman · Holocaust Testimony
   A quiet, paper-toned page. Phone first. */

:root {
  --paper: #f5f0e8;
  --paper-deep: #ece5d9;
  --ink: #2a2521;
  --ink-soft: #5b534c;
  --muted: #8a8077;
  --line: #d8cfc2;
  --accent: #7a5c3e;
  --accent-ink: #5e4530;
  --highlight: rgba(122, 92, 62, 0.16);
  --highlight-strong: rgba(122, 92, 62, 0.28);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --display: "Cormorant Garamond", "Source Serif 4", Georgia, serif;
  --nav-h: 3.25rem;
  --measure: 40rem;
  --gutter: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "liga", "kern";
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: 0.005em; }
h2 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
h3 { font-size: 1.35rem; margin-top: 1.75rem; margin-bottom: 0.35rem; }
p { margin: 0 0 1em; }
i { font-style: italic; }
.small { font-size: 0.9rem; color: var(--ink-soft); }

.skip {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 100;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 var(--gutter);
  background: rgba(245, 240, 232, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-name { font-family: var(--display); font-weight: 600; font-size: 1.2rem; text-decoration: none; color: var(--ink); white-space: nowrap; }
.topbar-nav { display: flex; gap: 1rem; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.topbar-nav::-webkit-scrollbar { display: none; }
.topbar-nav a { font-size: 0.9rem; text-decoration: none; color: var(--ink-soft); white-space: nowrap; padding: 0.25rem 0; border-bottom: 1px solid transparent; }
.topbar-nav a:hover, .topbar-nav a.current { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding: 2.5rem var(--gutter) 3rem; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--paper-deep), var(--paper) 70%); }
.hero-inner { max-width: 64rem; margin: 0 auto; display: grid; gap: 1.75rem; }
.hero-portrait { margin: 0; max-width: 16rem; }
.hero-portrait img { border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 12px 32px rgba(42, 37, 33, 0.14); filter: saturate(0.85); }
.hero-portrait figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.6rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.72rem; color: var(--accent); margin-bottom: 0.75rem; }
.hero h1 { font-size: clamp(2.6rem, 9vw, 4.2rem); font-weight: 500; }
.hero-dates { font-size: 1rem; color: var(--ink-soft); margin: 0.5rem 0 1.25rem; }
.hero-lede { font-size: 1.125rem; max-width: var(--measure); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }

@media (min-width: 46rem) {
  .hero { padding: 4rem var(--gutter) 4.5rem; }
  .hero-inner { grid-template-columns: 16rem 1fr; gap: 3rem; align-items: center; }
}

.button {
  display: inline-block; padding: 0.6rem 1.1rem; border-radius: 2px;
  background: var(--ink); color: var(--paper); text-decoration: none; border: 1px solid var(--ink);
  font-size: 0.95rem; cursor: pointer; line-height: 1.2;
}
.button:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--paper); }
.button-quiet { background: transparent; color: var(--ink); }
.button-quiet:hover { background: var(--paper-deep); color: var(--ink); }
.button-small { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.link { background: none; border: 0; padding: 0; color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; cursor: pointer; }
.link:hover { color: var(--accent); }

/* ---------- sections ---------- */
.section { padding: 3rem var(--gutter); max-width: 64rem; margin: 0 auto; }
.section-head { max-width: var(--measure); margin-bottom: 2rem; }
.section-head p { color: var(--ink-soft); margin-top: 0.5rem; }
.section-prose { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.section-prose h3 { margin-top: 2rem; }
@media (min-width: 46rem) { .section { padding: 4.5rem var(--gutter); } }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.5rem; position: relative; max-width: var(--measure); }
.timeline::before { content: ""; position: absolute; left: 0.3rem; top: 0.6rem; bottom: 0.6rem; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 2.25rem; }
.tl-item::before { content: ""; position: absolute; left: -1.5rem; top: 0.55rem; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--accent); }
.tl-item.playing::before { background: var(--accent); }
.tl-year { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.tl-title { font-family: var(--display); font-size: 1.5rem; font-weight: 600; margin: 0.15rem 0 0.4rem; line-height: 1.2; }
.tl-text { color: var(--ink); margin-bottom: 0.6rem; }
.tl-listen {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.8rem 0.3rem 0.65rem;
  font-size: 0.85rem; color: var(--ink-soft); cursor: pointer;
}
.tl-listen:hover { border-color: var(--accent); color: var(--ink); }
.tl-listen::before { content: ""; width: 0; height: 0; border-left: 0.45rem solid currentColor; border-top: 0.3rem solid transparent; border-bottom: 0.3rem solid transparent; }
.tl-listen time { font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---------- testimony ---------- */
.section-testimony { max-width: 72rem; }
/* The player column is sticky; its containing block (.testimony-layout) spans the whole transcript,
   so it stays pinned while the reader scrolls. Stacked layout uses display:block for that reason. */
.testimony-layout { display: block; }
.player-column { position: sticky; top: var(--nav-h); z-index: 20; background: var(--paper); }
.player-sticky { padding-bottom: 0.5rem; }
.transcript-column { margin-top: 1.5rem; }
.player-frame { background: #000; aspect-ratio: 16 / 9; }
.player-frame video { width: 100%; height: 100%; display: block; }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 0 0.25rem; border-bottom: 1px solid var(--line); }
.player-chapter { font-size: 0.88rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.3em; }
.follow-toggle { flex: none; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.25rem 0.7rem 0.25rem 0.55rem; font-size: 0.8rem; color: var(--ink-soft); cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; }
.follow-toggle::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--line); }
.follow-toggle[aria-pressed="true"] { color: var(--ink); border-color: var(--accent); }
.follow-toggle[aria-pressed="true"]::before { background: var(--accent); }

.chapters { margin-top: 0.4rem; font-size: 0.9rem; }
.player-download { font-size: 0.85rem; margin: 0.5rem 0 0; color: var(--ink-soft); }
.chapters summary { cursor: pointer; color: var(--ink-soft); padding: 0.35rem 0; list-style: none; display: flex; align-items: center; gap: 0.4rem; }
.chapters summary::-webkit-details-marker { display: none; }
.chapters summary::before { content: ""; width: 0.4rem; height: 0.4rem; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
.chapters[open] summary::before { transform: rotate(45deg); }
.chapter-list { list-style: none; margin: 0; padding: 0.25rem 0 0.5rem; max-height: 14rem; overflow-y: auto; border-bottom: 1px solid var(--line); }
.chapter-list button { display: flex; width: 100%; text-align: left; gap: 0.75rem; background: none; border: 0; padding: 0.3rem 0.25rem; cursor: pointer; color: var(--ink-soft); line-height: 1.35; border-radius: 2px; }
.chapter-list button:hover { background: var(--paper-deep); color: var(--ink); }
.chapter-list button.current { color: var(--ink); font-weight: 600; }
.chapter-list time { flex: none; width: 3.6rem; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 400; }

.transcript-note { font-size: 0.9rem; color: var(--ink-soft); border-left: 2px solid var(--line); padding-left: 1rem; margin-bottom: 2rem; max-width: var(--measure); }
.transcript-note p { margin: 0; }
.transcript { max-width: var(--measure); }
.transcript h3 { font-size: 1.45rem; margin: 2.5rem 0 0.75rem; scroll-margin-top: calc(var(--nav-h) + 1rem); display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.transcript h3:first-child { margin-top: 0; }
.transcript h3 button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.transcript h3 button:hover { color: var(--accent-ink); }
.transcript h3 time { font-family: var(--serif); font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; }
.passage { position: relative; margin: 0 0 1.1em; }
.passage .stamp { display: block; font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; background: none; border: 0; padding: 0; cursor: pointer; margin-bottom: 0.1rem; letter-spacing: 0.03em; }
.passage .stamp:hover { color: var(--accent); }
.seg {
  background: none; border: 0; padding: 0; margin: 0; text-align: left; display: inline; cursor: pointer;
  font: inherit; color: inherit; line-height: inherit;
  border-radius: 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone;
  transition: background-color 0.2s ease;
}
.seg:hover { background: var(--highlight); }
.seg.active { background: var(--highlight-strong); }
.seg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg.played { color: var(--ink-soft); }

.return-pill {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 40;
  background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; padding: 0.6rem 1.1rem; font-size: 0.9rem; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

@media (min-width: 56rem) {
  .testimony-layout { display: grid; grid-template-columns: minmax(18rem, 26rem) 1fr; gap: 3rem; align-items: start; }
  .transcript-column { margin-top: 0; }
  .transcript-note { margin-top: 0.25rem; }
  .passage { padding-left: 4.5rem; }
  .passage .stamp { position: absolute; left: 0; top: 0.35rem; margin: 0; }
  .chapter-list { max-height: calc(100vh - var(--nav-h) - 22rem); }
}

/* ---------- map ---------- */
.map-wrap { position: relative; margin-bottom: 1.5rem; }
.map { height: 22rem; border: 1px solid var(--line); border-radius: 2px; background: var(--paper-deep); filter: saturate(0.6); }
@media (min-width: 46rem) { .map { height: 30rem; } }
.map-controls { position: absolute; top: 0.6rem; right: 0.6rem; z-index: 500; display: flex; gap: 0.4rem; }
.map-controls .button { background: var(--paper); color: var(--ink); border-color: var(--line); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.map-controls .button.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.leaflet-container { font-family: var(--serif); }
.leaflet-popup-content-wrapper { border-radius: 2px; background: var(--paper); color: var(--ink); box-shadow: 0 4px 16px rgba(0,0,0,0.18); }
.leaflet-popup-content { margin: 0.75rem 1rem; font-size: 0.9rem; line-height: 1.45; }
.leaflet-popup-content strong { font-family: var(--display); font-size: 1.1rem; }
.leaflet-popup-tip { background: var(--paper); }
.place-marker { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--accent); }
.place-marker.current { background: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

.place-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.place { border: 1px solid var(--line); border-radius: 2px; padding: 0.9rem 1rem; background: transparent; }
.place.current { border-color: var(--accent); background: rgba(122, 92, 62, 0.05); }
.place-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; background: none; border: 0; padding: 0; width: 100%; text-align: left; cursor: pointer; }
.place-name { font-family: var(--display); font-size: 1.35rem; font-weight: 600; }
.place-sub { font-size: 0.85rem; color: var(--muted); }
.place-text { margin: 0.5rem 0 0; font-size: 0.97rem; color: var(--ink-soft); }
.place .tl-listen { margin-top: 0.6rem; }
@media (min-width: 46rem) { .place-list { grid-template-columns: 1fr 1fr; gap: 0.75rem; } }

/* ---------- context ---------- */
.sources { padding-left: 1.2rem; font-size: 0.92rem; }
.sources li { margin-bottom: 0.3rem; }
.sources-title { margin-top: 2.5rem; }

/* ---------- remembrance ---------- */
.section-prose#remember { max-width: 64rem; }
.remember-grid { display: grid; gap: 1.5rem; max-width: var(--measure); }
.remember-grid h3 { margin-top: 0; }
.names { margin: 0; }
.names dt { font-weight: 600; margin-top: 0.6rem; }
.names dd { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }
.photo-inline { margin: 1.5rem 0 0; max-width: 20rem; }
.photo-inline img { border-radius: 2px; filter: saturate(0.8); box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 8px 24px rgba(42,37,33,0.12); }
@media (min-width: 46rem) { .remember-grid { grid-template-columns: 1fr 1fr; gap: 3rem; max-width: none; } }

.photo-grid { display: grid; gap: 1.75rem; margin-top: 3rem; }
.photo-grid figure, .photo-wide { margin: 0; }
.photo-grid img, .photo-wide img { border-radius: 2px; filter: saturate(0.8); box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 8px 24px rgba(42,37,33,0.12); }
figcaption { font-size: 0.88rem; color: var(--ink-soft); margin-top: 0.6rem; line-height: 1.45; }
figcaption .link { font-size: inherit; }
.photo-wide { margin-top: 1.75rem; }
@media (min-width: 46rem) { .photo-grid { grid-template-columns: 1fr 1fr; gap: 2rem 2.5rem; } }

.closing-quote { margin: 3.5rem auto 0; max-width: var(--measure); border: 0; padding: 0; text-align: center; }
.closing-quote p { font-family: var(--display); font-size: clamp(1.4rem, 4vw, 1.9rem); font-style: italic; font-weight: 500; line-height: 1.35; }
.closing-quote cite { font-style: normal; font-size: 0.85rem; color: var(--muted); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 2rem var(--gutter) 3rem; font-size: 0.82rem; color: var(--muted); }
.footer p { max-width: 64rem; margin: 0 auto; }
.footer a { color: inherit; }
