/* ============================================================
   PALPER — story.css
   Page-specific styles for goma-story.html only.
   Narrative layout: full-bleed chapters, alternating splits and a
   numbered sector list. No animation beyond the shared .reveal.
   ============================================================ */

/* ---- Hero ---- */
.story-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 62vh;
  padding: var(--sp-10) var(--sp-4) var(--sp-8);
  overflow: hidden;
}
.story-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.story-hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(27, 26, 23, .25) 0%, rgba(27, 26, 23, .72) 62%, rgba(27, 26, 23, .86) 100%);
}
.story-hero__inner {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  color: #fff;
}
.story-hero__eyebrow {
  margin: 0 0 12px;
  font-size: var(--fs-12);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #F0E4CE;
}
.story-hero h1 {
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: var(--lh-tight);
}
.story-hero__lede {
  margin: 0;
  max-width: 62ch;
  font-size: var(--fs-20);
  line-height: var(--lh-relaxed);
  color: #F4EFE6;
}

/* ---- In-page chapter list ---- */
.story-jump {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.story-jump__h {
  margin: 0 0 10px;
  font-size: var(--fs-12);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--palper-blue);
}
.story-jump ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: jump;
}
.story-jump li { counter-increment: jump; }
.story-jump li::before {
  content: counter(jump, decimal-leading-zero) " ";
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--fg4);
  margin-right: 6px;
}
.story-jump a {
  font-size: var(--fs-16);
  color: var(--ink-soft);
  text-underline-offset: 3px;
}
.story-jump a:hover { color: var(--palper-blue); }

/* ---- Chapters ---- */
.story-ch { padding: var(--sp-9) var(--sp-4); }
.story-ch--tint { background: var(--paper-dim); }
.story-ch__inner { max-width: 1060px; margin: 0 auto; }
.story-ch__label {
  margin: 0 0 var(--sp-5);
  font-size: var(--fs-12);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--palper-terra);
}

/* Alternating image and text. */
.story-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-6);
  align-items: center;
}
.story-split__text > h2 { margin-top: 0; }
.story-split__text > p {
  font-size: var(--fs-18);
  line-height: var(--lh-relaxed);
  color: var(--fg2);
}
.story-split__media { margin: 0; }
.story-split__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.story-split__media figcaption {
  margin-top: 10px;
  font-size: var(--fs-14);
  color: var(--fg3);
}
/* Put the media first on wide screens for flipped rows. */
.story-split--flip .story-split__text { order: 2; }
.story-split--flip .story-split__media { order: 1; }

/* Centred prose block. */
.story-prose { max-width: 720px; }
.story-prose > h2 { margin-top: 0; }
.story-prose > p {
  font-size: var(--fs-18);
  line-height: var(--lh-relaxed);
  color: var(--fg2);
}

/* Three context figures. */
.story-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: var(--sp-6) 0 var(--sp-3);
}
.story-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--palper-red);
  border-radius: var(--r-lg);
  padding: 20px;
}
.story-stat__n {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-36);
  line-height: 1.1;
  color: var(--palper-red);
}
.story-stat__l {
  display: block;
  margin-top: 8px;
  font-size: var(--fs-14);
  line-height: var(--lh-normal);
  color: var(--fg2);
}
.story-note { margin: 0; font-size: var(--fs-14); }

/* ---- The eight priorities as a numbered narrative list ---- */
.story-sectors {
  list-style: none;
  margin: var(--sp-6) 0 0;
  padding: 0;
}
.story-sector {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: center;
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--border);
}
.story-sector:last-child { border-bottom: 0; }
.story-sector__media { margin: 0; }
.story-sector__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-lg);
}
.story-sector__n {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-14);
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--palper-blue);
}
.story-sector__text h3 {
  margin: 0 0 10px;
  font-size: var(--fs-24);
  line-height: var(--lh-snug);
}
.story-sector__text p {
  margin: 0 0 12px;
  font-size: var(--fs-16);
  line-height: var(--lh-relaxed);
  color: var(--fg2);
}
.story-sector__link {
  font-size: var(--fs-14);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* ---- Quotation ---- */
.story-quote {
  margin: var(--sp-5) 0;
  padding: 18px 22px;
  border-left: 3px solid var(--palper-blue);
  background: var(--surface);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.story-quote p {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: var(--fs-20);
  line-height: var(--lh-snug);
  color: var(--ink);
}
.story-quote cite {
  font-style: normal;
  font-size: var(--fs-14);
  color: var(--fg3);
}

.story-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--sp-4); }

@media (max-width: 899px) {
  .story-split { grid-template-columns: 1fr; gap: var(--sp-4); }
  .story-split--flip .story-split__text,
  .story-split--flip .story-split__media { order: 0; }
  .story-stats { grid-template-columns: 1fr; }
  .story-sector { grid-template-columns: 1fr; gap: var(--sp-3); }
}

@media (max-width: 599px) {
  .story-ch { padding: var(--sp-7) var(--sp-4); }
  .story-hero { min-height: 56vh; padding-top: var(--sp-8); }
  .story-hero__lede { font-size: var(--fs-18); }
  .story-jump ol { flex-direction: column; gap: 6px; }
}


/* ---- Full-bleed photo bands -------------------------------------------
   Wide strips of real field photographs between chapters. They carry the
   story where text would otherwise repeat itself. */
.story-band {
  display: grid;
  gap: 4px;
  margin: var(--sp-7) 0;
  padding: 0;
}
.story-band--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.story-band--wide { grid-template-columns: 1fr; margin-bottom: 4px; }
.story-band--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.story-band figure { position: relative; margin: 0; overflow: hidden; background: var(--paper-deep); }
.story-band img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
/* Panoramas keep their full frame. Must follow the rule above (same specificity). */
.story-band--wide img { aspect-ratio: auto; height: auto; }
.story-band figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 18px 12px;
  font-size: var(--fs-13, 13px);
  line-height: 1.45;
  color: #fff;
  background: linear-gradient(180deg, rgba(27,26,23,0) 0%, rgba(27,26,23,.82) 100%);
}

/* Slightly larger, calmer chapter openings. */
.story-ch__inner > .story-split,
.story-ch__inner > .story-prose { margin-bottom: 0; }
.story-split__text > h2,
.story-prose > h2 { font-size: clamp(1.75rem, 3.4vw, var(--fs-36)); letter-spacing: -0.01em; }
.story-ch__label { display: flex; align-items: center; gap: 12px; }
.story-ch__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Sector rows: tighter, more photographic. */
.story-sector { align-items: center; }
.story-sector__media img { aspect-ratio: 4 / 3; }
.story-sector__text h3 { letter-spacing: -0.005em; }

@media (max-width: 899px) {
  .story-band--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-band--3 figure:last-child { grid-column: 1 / -1; }
  .story-band--3 figure:last-child img { aspect-ratio: 2 / 1; }
}
@media (max-width: 599px) {
  .story-band { gap: 3px; margin: var(--sp-6) 0; }
  .story-band--2, .story-band--3 { grid-template-columns: 1fr; }
  .story-band--3 figure:last-child img { aspect-ratio: 3 / 2; }
  .story-band figcaption { padding: 22px 14px 10px; font-size: 12px; }
}


/* ---- History chapter additions (27 Sep) -------------------------------- */
/* Credit line under the hero, small and quiet. */
.story-hero__credit {
  margin: 18px 0 0;
  font-size: var(--fs-12);
  line-height: 1.5;
  color: rgba(255, 255, 255, .72);
}
/* The one sentence the 1994 chapter turns on. */
.story-emphasis {
  margin: var(--sp-5) 0;
  padding: 18px 22px;
  border-left: 3px solid var(--palper-red);
  background: var(--surface);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-family: var(--font-display);
  font-size: var(--fs-20);
  line-height: var(--lh-snug);
  color: var(--ink);
}
/* Photograph credits at the foot of the page. */
.story-credits { padding: var(--sp-7) var(--sp-4); background: var(--paper-dim); border-top: 1px solid var(--border); }
.story-credits__inner { max-width: 900px; margin: 0 auto; }
.story-credits h2 { font-size: var(--fs-20); margin: 0 0 8px; }
.story-credits p { margin: 0 0 12px; font-size: var(--fs-14); color: var(--fg3); }
.story-credits ul { margin: 0; padding-left: 18px; }
.story-credits li { font-size: var(--fs-14); line-height: 1.65; color: var(--fg3); }
.story-credits a { text-underline-offset: 3px; }
@media (max-width: 599px) {
  .story-emphasis { font-size: var(--fs-18); padding: 14px 16px; }
}

/* ---- Timeline: the city's history, then the partnership's months -------- */
.story-timeline { list-style: none; margin: var(--sp-6) 0 0; padding: 0; position: relative; max-width: 880px; }
.story-timeline::before { content: ""; position: absolute; left: 118px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.story-timeline__item { position: relative; display: grid; grid-template-columns: 100px minmax(0, 1fr); column-gap: 44px; padding: 0 0 22px; }
.story-timeline__item::before { content: ""; position: absolute; left: 112px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink-faint); }
.story-timeline__item.is-work::before { background: var(--palper-blue); border-color: var(--palper-blue); }
.story-timeline__item.is-goal::before { background: var(--paper); border: 2px dashed var(--palper-terra); }
.story-timeline__year { grid-column: 1; grid-row: 1; text-align: right; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-20); line-height: 1.2; color: var(--ink); }
.story-timeline__item.is-work .story-timeline__year { color: var(--palper-blue); }
.story-timeline__item.is-goal .story-timeline__year { color: var(--palper-terra); }
.story-timeline__when { grid-column: 1; grid-row: 2; text-align: right; font-size: var(--fs-12); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg3); }
.story-timeline__item p { grid-column: 2; grid-row: 1 / 3; margin: 0; font-size: var(--fs-16); line-height: var(--lh-relaxed); color: var(--fg2); }
.story-timeline__item.is-work p { color: var(--ink); }

/* ---- The Kasika letter: a document, quoted -------------------------------- */
.story-letter { margin: var(--sp-4) 0; padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--palper-terra); border-radius: 0 var(--r-md) var(--r-md) 0; box-shadow: var(--shadow-1); }
.story-letter p { margin: 0 0 12px; font-family: var(--font-display); font-size: var(--fs-18); line-height: 1.6; color: var(--ink); }
.story-letter cite { font-style: normal; font-size: var(--fs-14); color: var(--fg3); }

@media (max-width: 599px) {
  .story-timeline::before { left: 7px; }
  .story-timeline__item { grid-template-columns: minmax(0, 1fr); padding-left: 30px; }
  .story-timeline__item::before { left: 1px; }
  .story-timeline__year, .story-timeline__when { text-align: left; grid-column: 1; }
  .story-timeline__when { grid-row: auto; margin-bottom: 4px; }
  .story-timeline__item p { grid-column: 1; grid-row: auto; }
  .story-letter { padding: 16px 18px; }
  .story-letter p { font-size: var(--fs-16); }
}
