:root {
  --bg: #fbfaf8;
  --bg-alt: #f2efea;
  --ink: #23211d;
  --ink-soft: #6b665d;
  --line: #ddd8d0;
  --accent: #47616e;
  --shadow: 0 1px 2px rgb(0 0 0 / .08), 0 4px 14px rgb(0 0 0 / .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171613;
    --bg-alt: #1f1e1a;
    --ink: #ece9e3;
    --ink-soft: #9b958a;
    --line: #35322c;
    --accent: #8fb0bd;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 4px 14px rgb(0 0 0 / .3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Heebo, "Noto Sans Hebrew", "Arial Hebrew", Arial, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}

.wrap { width: min(760px, 100% - 3rem); margin-inline: auto; }

h1, h2 { line-height: 1.3; letter-spacing: -.005em; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 2.5rem 0 .7em; }
p { margin: 0 0 1.15em; }
a { color: var(--accent); text-underline-offset: .2em; }

/* ---------- masthead ---------- */
/* Full bleed and full opacity: the photo is evidence, not decoration, so it
   gets its own band rather than sitting washed-out behind the text. */
.hero-photo { margin: 0; }
.hero-photo img {
  display: block; width: 100%;
  height: clamp(190px, 34vh, 400px);
  /* 42% keeps both containers and their signage in frame at every band height;
     centring lands on pavement and crops the bin tops off. */
  object-fit: cover; object-position: 50% 42%;
  background: var(--bg-alt);
}

.masthead {
  border-bottom: 1px solid var(--line);
  padding: clamp(2rem, 5vw, 3rem) 0 clamp(1.75rem, 4vw, 2.5rem);
}
.kicker {
  font-size: .72rem; font-weight: 600; letter-spacing: .18em;
  color: var(--ink-soft); margin: 0 0 1.4em;
}
.masthead h1 {
  font-size: clamp(1.5rem, 4vw, 2.15rem);
  font-weight: 800; margin: 0 0 .5em; max-width: 24ch;
}
.meta { color: var(--ink-soft); font-size: .95rem; margin: 0; }

/* ---------- lede ---------- */
main { padding-bottom: 1rem; }
.lede-section { padding-top: clamp(1.75rem, 4vw, 2.5rem); }
.lede { font-size: 1.08rem; max-width: 58ch; margin-bottom: 0; }

/* ---------- reference ---------- */
.reference {
  margin: 2.75rem 0; padding: 1.1rem 1.3rem;
  background: var(--bg-alt); border-inline-start: 3px solid var(--accent);
  border-radius: 2px;
}
.reference h2 { margin: 0 0 .25em; font-size: .95rem; }
.reference p { margin: 0; font-size: .95rem; }

.figures {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem 2rem; margin: 2.5rem 0; padding: 1.5rem 0;
  border-block: 1px solid var(--line);
}
.figures div { margin: 0; }
.figures dt { font-size: .8rem; color: var(--ink-soft); margin-bottom: .2em; }
.figures dd {
  margin: 0; font-size: 1.9rem; font-weight: 800; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* ---------- ruler ---------- */
.ruler-figure { margin: 2.5rem 0 0; }
.ruler {
  position: relative; height: 30px;
  border-bottom: 1px solid var(--line);
}
.ruler .tick {
  position: absolute; bottom: 0; width: 2px; height: 13px;
  background: var(--accent); border-radius: 1px; opacity: .75;
}
.ruler-figure figcaption {
  font-size: .8rem; color: var(--ink-soft); padding-top: .7em;
}

/* ---------- timeline ---------- */
.timeline-section { margin-top: 1.75rem; }
.note { color: var(--ink-soft); font-size: .85rem; margin: .6rem 0 0; }

.timeline {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding: .5rem max(1.5rem, calc((100% - 760px) / 2)) 2.5rem;
  scrollbar-width: thin;
}
.timeline:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.track {
  /* Declared here, not on .entry: .track::before reads it, and custom
     properties inherit downward only. */
  --media-h: 210px;
  position: relative;
  display: flex; align-items: flex-start; gap: 1.6rem;
  width: max-content;
}
/* The axis runs behind every marker, so the media block is a fixed height. */
.track::before {
  content: ''; position: absolute; inset-inline: 0;
  top: calc(var(--media-h) + 19px);
  border-top: 1px solid var(--line);
}

.entry { position: relative; flex: 0 0 auto; scroll-snap-align: center; }
.entry.month-start { margin-inline-start: 1.6rem; }
.entry.month-start::after {
  content: ''; position: absolute; top: 0;
  height: calc(var(--media-h) + 30px);
  inset-inline-start: -1.6rem;   /* into the gap, on the earlier-date side */
  border-inline-start: 1px dashed var(--line);
}

.entry-media { display: flex; gap: .45rem; height: var(--media-h); }
.entry-media button {
  padding: 0; border: 0; background: none; cursor: zoom-in; line-height: 0;
  border-radius: 2px;
}
.entry-media img {
  display: block; width: 280px; height: var(--media-h); object-fit: cover;
  border-radius: 2px; background: var(--bg-alt); box-shadow: var(--shadow);
  transition: opacity .15s ease;
}
.entry-media button:hover img { opacity: .88; }
.entry-media button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.entry-axis { position: relative; height: 40px; }
.entry-axis::before {
  content: ''; position: absolute; top: 15px; left: 50%;
  width: 9px; height: 9px; margin-left: -4.5px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.entry time {
  display: block; text-align: center;
  font-size: .85rem; font-weight: 600; color: var(--ink);
}
.loading { color: var(--ink-soft); }

/* ---------- closing ---------- */
footer {
  border-top: 1px solid var(--line);
  margin-top: 3.5rem; padding: 1.75rem 0;
  color: var(--ink-soft); font-size: .82rem;
}
footer p { margin: 0; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgb(12 11 9 / .95);
  display: grid; place-items: center; padding: 1.5rem;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; text-align: center; }
.lightbox img {
  max-width: 100%; max-height: calc(100vh - 8rem);
  object-fit: contain; border-radius: 2px;
}
.lightbox figcaption { color: #cfc9bf; font-size: .85rem; padding-top: .9em; }
.lb-close, .lb-nav {
  position: absolute; background: rgb(255 255 255 / .1); color: #fff;
  border: 0; cursor: pointer; line-height: 1; border-radius: 3px;
  transition: background .15s ease;
}
.lb-close:hover, .lb-nav:hover { background: rgb(255 255 255 / .2); }
.lb-close { top: 1rem; inset-inline-end: 1rem; font-size: 1.9rem; width: 2.2rem; height: 2.2rem; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 2.2rem; width: 2.5rem; height: 3.8rem; }
/* In RTL, inline-start resolves to the right edge: "back" belongs on the right. */
.lb-prev { inset-inline-start: 1rem; }
.lb-next { inset-inline-end: 1rem; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .track { --media-h: 170px; }
  .entry-media img { width: 230px; }
  .figures dd { font-size: 1.6rem; }
}

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