/* ============================================================================
   feature-article.css  —  the "magazine feature" long-read format.

   Opt in from a page by setting `body_class: feature-article` in the front
   matter; head.html then loads this file and feature-article.js automatically.

   Building blocks (see STYLE_GUIDE.md "Feature article" for the full pattern):
     header.hero            full-bleed dark photo hero + kicker + h1 (em accent) + dek
     article > p.lede .drop opening paragraph with a drop cap
     section.chapter        a numbered scene on the left-rail timeline (.dot + .era + h2)
     div.pull > q + cite    a pull quote sprinkled between chapters
     figure.plate           full-width image plate with figcaption
     .portraits / .seats    2-up / 2x2 image grids
     section.closer         dark full-bleed closing section
     section.endmatter      sources + image credits
     .reveal                any block that should fade up as it scrolls into view

   All rules are scoped under body.feature-article so they never leak to other
   pages, and they use site.css design tokens so light/dark theme work
   automatically.
   ============================================================================ */

body.feature-article {
  /* Always-dark surfaces (hero, closer) don't follow theme. */
  --fa-dark-bg: #0F2A3D;
  --fa-dark-text: #F4F7FA;
  --fa-dark-text-soft: #C8D2DA;
  --fa-dark-text-faint: #8FA0AC;
  --fa-dark-accent: #E4B363;
  --fa-maxw: 720px;
}
body.feature-article img { max-width: 100%; display: block; }

/* ---------- HERO ---------- */
body.feature-article .hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  background: var(--fa-dark-bg);
  overflow: hidden;
}
body.feature-article .hero figure { margin: 0; position: absolute; inset: 0; }
body.feature-article .hero img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 28%;
  opacity: .46; filter: saturate(.85);
}
body.feature-article .hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,42,61,.35) 0%, rgba(15,42,61,.15) 35%, rgba(15,42,61,.8) 100%);
}
body.feature-article .hero-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 1100px; margin: 0 auto;
  padding: 0 28px 64px;
  color: var(--fa-dark-text);
}
body.feature-article .kicker {
  font-family: var(--font-heading);
  font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--fa-dark-accent);
  margin: 0 0 22px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
body.feature-article .kicker::before { content: ""; width: 46px; height: 2px; background: var(--fa-dark-accent); display: inline-block; }
body.feature-article .hero h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2.4rem, 6.5vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -.02em;
  margin: 0 0 26px;
  max-width: 14ch;
  color: var(--fa-dark-text);
}
body.feature-article .hero h1 em { font-style: italic; font-weight: 700; color: var(--fa-dark-accent); }
body.feature-article .dek {
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  line-height: 1.5;
  max-width: 56ch;
  color: var(--fa-dark-text-soft);
  font-weight: 400;
}

/* ---------- ARTICLE SHELL ---------- */
body.feature-article article {
  background: var(--surface);
  margin: 0 auto;
  padding: 70px 0 36px;
  box-shadow: var(--shadow-md);
}
body.feature-article .lede {
  max-width: var(--fa-maxw); margin: 0 auto 10px;
  font-size: 1.15rem; line-height: 1.6; color: var(--text-muted);
  padding: 0 24px;
}
body.feature-article .lede .drop {
  float: left;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 4.6rem; line-height: .85;
  padding: 8px 12px 0 0; color: var(--c-buoy);
}

/* ---------- CHAPTERS ---------- */
body.feature-article .chapter {
  max-width: var(--fa-maxw);
  margin: 0 auto;
  padding: 50px 24px 8px;
  position: relative;
}
body.feature-article .era {
  font-family: var(--font-heading);
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--c-buoy);
  display: flex; align-items: baseline; gap: 14px;
  margin: 0 0 8px;
}
body.feature-article .era span {
  color: var(--text-subtle); font-weight: 500;
  letter-spacing: .16em; font-size: 11px;
}
body.feature-article .chapter h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.55rem, 3.6vw, 2.15rem);
  line-height: 1.1;
  letter-spacing: -.015em;
  margin: .1em 0 .65em;
  color: var(--text);
}
body.feature-article .chapter p { margin: 0 0 1.1em; }
body.feature-article .chapter p a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* timeline tick on the left rail (desktop) */
body.feature-article .chapter::before {
  content: ""; position: absolute; left: -16px; top: 56px; bottom: -42px;
  width: 2px; background: var(--border);
}
body.feature-article .chapter:last-of-type::before { display: none; }
body.feature-article .chapter .dot {
  position: absolute; left: -22px; top: 54px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--c-brass); border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--c-brass);
}

/* ---------- FIGURES ---------- */
body.feature-article figure.plate { margin: 30px 0 34px; }
body.feature-article figure.plate img {
  width: 100%; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  background: var(--divider);
}
body.feature-article figcaption {
  font-family: var(--font-sans);
  font-size: 12.5px; line-height: 1.5; color: var(--text-subtle);
  margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--c-brass);
}
body.feature-article figcaption b { color: var(--text-muted); font-weight: 600; }

/* portrait pair */
body.feature-article .portraits {
  max-width: var(--fa-maxw); margin: 30px auto 34px;
  padding: 0 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
body.feature-article .portraits figure { margin: 0; }
body.feature-article .portraits img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center top;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  filter: grayscale(.15);
  background: var(--divider);
}

/* seats-of-government 2x2 grid */
body.feature-article .seats {
  max-width: var(--fa-maxw); margin: 30px auto 34px;
  padding: 0 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 26px 24px;
}
body.feature-article .seats figure { margin: 0; }
body.feature-article .seats img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center top;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  background: var(--divider);
}

/* ---------- PULL QUOTE ---------- */
body.feature-article .pull {
  max-width: var(--fa-maxw); margin: 36px auto;
  padding: 6px 24px 6px 28px;
  border-left: 4px solid var(--c-buoy);
}
body.feature-article .pull q {
  font-family: var(--font-heading);
  font-style: italic; font-weight: 500;
  font-size: clamp(1.3rem, 3.2vw, 1.8rem); line-height: 1.24;
  color: var(--text); quotes: none; display: block;
}
body.feature-article .pull cite {
  display: block; margin-top: 12px;
  font-family: var(--font-heading); font-style: normal; font-weight: 600;
  font-size: 11.5px; letter-spacing: .12em; color: var(--text-subtle); text-transform: uppercase;
}

/* ---------- CLOSER ---------- */
body.feature-article .closer {
  background: var(--fa-dark-bg); color: var(--fa-dark-text);
  margin-top: 0; padding: 64px 0;
}
body.feature-article .closer .inner { max-width: var(--fa-maxw); margin: 0 auto; padding: 0 28px; }
body.feature-article .closer .era { color: var(--fa-dark-accent); }
body.feature-article .closer .era span { color: var(--fa-dark-text-faint); }
body.feature-article .closer h2 {
  font-family: var(--font-heading); font-weight: 700;
  font-size: clamp(1.55rem, 3.6vw, 2.15rem); line-height: 1.1; margin: .1em 0 .65em;
  letter-spacing: -.015em;
  color: var(--fa-dark-text);
}
body.feature-article .closer p { margin: 0 0 1.1em; color: var(--fa-dark-text-soft); }
body.feature-article .closer p:last-child { margin-bottom: 0; }
body.feature-article .closer em { color: var(--fa-dark-accent); font-style: italic; }

/* ---------- SOURCES / CREDITS ---------- */
body.feature-article .endmatter { background: var(--bg); padding: 50px 0 56px; }
body.feature-article .endmatter .inner { max-width: var(--fa-maxw); margin: 0 auto; padding: 0 28px; }
body.feature-article .endmatter h3 {
  font-family: var(--font-heading); font-size: 11.5px; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--text-subtle); margin: 0 0 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
body.feature-article .endmatter ul { list-style: none; margin: 0 0 36px; padding: 0; }
body.feature-article .endmatter li {
  font-size: 14.5px; line-height: 1.5; color: var(--text-muted);
  padding: 7px 0; border-bottom: 1px solid var(--divider);
}
body.feature-article .endmatter li b { color: var(--text); font-weight: 600; }
body.feature-article .endmatter .pd {
  font-family: var(--font-heading); font-size: 10.5px; font-weight: 600;
  color: var(--c-buoy); letter-spacing: .08em; text-transform: uppercase;
}

/* reveal animation */
body.feature-article .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
body.feature-article .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  body.feature-article .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 760px) {
  body.feature-article { font-size: 18px; }
  body.feature-article .chapter::before,
  body.feature-article .chapter .dot { display: none; }
  body.feature-article .portraits { grid-template-columns: 1fr; gap: 18px; max-width: 420px; }
  body.feature-article .lede .drop { font-size: 4.2rem; }
  body.feature-article article { padding-top: 52px; }
}
