/* ============================================================
   DESIGN TOKENS
   Paper: cool off-white (not warm cream) — newsprint, not cozy.
   Ink: near-black. Pitch: muted deep green, competition tags.
   Wire: muted press-red, accreditation/live flags only.
   Type: IBM Plex family throughout — serif for editorial weight,
   sans for body, mono for wire captions/datelines/utility text.
   ============================================================ */
:root {
  --paper: #F3F4F1;
  --paper-raised: #FFFFFF;
  --ink: #14171A;
  --steel: #6B6F76;
  --pitch: #1F4D36;
  --wire: #B3272B;
  --line: rgba(20,23,26,0.14);

  --font-display: 'IBM Plex Serif', Georgia, serif;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; line-height: 1.08; }

::selection { background: var(--pitch); color: var(--paper); }

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

/* ============ TOP BAR + NAV ============ */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.65rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar__loc {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  color: var(--steel);
}

.navtoggle {
  display: none;
  background: none;
  border: none;
  width: 28px;
  height: 20px;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  padding: 0;
}
.navtoggle span {
  display: block;
  height: 1.5px;
  background: var(--ink);
}

.sitenav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.5rem var(--gutter) 0.9rem;
  display: flex;
  gap: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sitenav a { text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 2px; }
.sitenav a:hover { border-bottom-color: var(--ink); }

@media (max-width: 640px) {
  .navtoggle { display: flex; }
  .sitenav {
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    transition: max-height 0.25s ease;
  }
  .sitenav.is-open { max-height: 240px; padding-top: 0.5rem; padding-bottom: 1rem; }
  .sitenav a { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
}

/* ============ PHOTO FRAME (placeholder component) ============ */
.frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 30% 20%, rgba(255,255,255,0.06), transparent 60%),
    linear-gradient(155deg, #232a2e 0%, #12181a 55%, #0a0d0e 100%);
  display: flex;
  align-items: flex-end;
  padding: 0.9rem;
}
.frame--hero { aspect-ratio: 16 / 9; }
/* Grid frames intentionally have no forced ratio here — each gets its own
   aspect-ratio inline (for placeholder demo only). Delete that inline style
   once a real <img> goes in and let the photo's native ratio decide the size. */

.frame__label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: rgba(255,255,255,0.55);
  border: 1px dashed rgba(255,255,255,0.28);
  padding: 0.5rem 0.6rem;
}

/* ============ CAPTIONS (the wire-service signature element) ============ */
.caption {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--steel);
  margin: 0.55rem 0 0;
}
.caption__num { color: var(--wire); margin-right: 0.5em; }
.caption__dateline { color: var(--ink); font-weight: 500; }
.caption__credit { color: var(--pitch); }

/* ============ HERO ============ */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) var(--gutter) 0;
  position: relative;
}
.hero__content {
  position: absolute;
  left: calc(var(--gutter) + 1.25rem);
  bottom: 3.5rem;
  max-width: 640px;
  color: #fff;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  color: rgba(255,255,255,0.75);
  margin: 0 0 0.6rem;
}
.hero__headline {
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: #fff;
}
.hero__sub {
  font-family: var(--font-body);
  font-size: 1rem;
  color: rgba(255,255,255,0.82);
  max-width: 480px;
  margin: 0.9rem 0 0;
}
.caption--hero { padding: 0 0 0 0.05rem; }

@media (max-width: 640px) {
  .hero__content { position: static; color: var(--ink); margin-top: 1rem; }
  .eyebrow { color: var(--steel); }
  .hero__sub { color: var(--steel); }
}

/* ============ TICKER ============ */
.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-raised);
  overflow: hidden;
  margin-top: clamp(1.5rem, 4vw, 3rem);
}
.ticker__track {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.7rem var(--gutter);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--pitch);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}
.ticker__item { white-space: nowrap; }
.ticker__sep { color: var(--line); margin: 0 0.9rem; }

@media (max-width: 640px) {
  .ticker__track { flex-direction: column; align-items: flex-start; }
  .ticker__sep { display: none; }
  .ticker__item { padding: 0.15rem 0; }
}

/* ============ SECTIONS ============ */
section { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) var(--gutter); }

.section__head { max-width: 640px; margin-bottom: 2rem; }
.section__num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--wire);
  margin-bottom: 0.6rem;
}
.section__head h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
.section__intro { color: var(--steel); margin: 0.75rem 0 0; }

/* ============ GALLERY — masonry columns, mixed native ratios ============
   Real wire/editorial photos come off the camera in whatever ratio they were
   shot — 3:2, 4:3, portrait, landscape, mixed. Forcing every tile into the
   same square/4:5 box means cropping images for a grid, which is exactly what
   editors don't want to see. A column-based masonry layout lets each photo
   keep its own shape; items just flow into whichever column has room. */
.gallery {
  column-count: 1;
  column-gap: 1.25rem;
}
@media (min-width: 560px) { .gallery { column-count: 2; } }
@media (min-width: 900px) { .gallery { column-count: 3; } }

.gallery > .photo,
.gallery > .frame {
  break-inside: avoid;
  margin: 0 0 1.5rem;
}

/* ============ STORY / TIMELINE (real sequence — earns numbering) ============ */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.timeline__item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.timeline__year {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--wire);
}
.timeline__item--current .timeline__year { color: var(--pitch); font-weight: 600; }
.timeline__item p { margin: 0; color: var(--ink); }

@media (max-width: 520px) {
  .timeline__item { grid-template-columns: 60px 1fr; }
}

/* ============ TABS ============ */
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.tab {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--line);
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  color: var(--steel);
}
.tab[aria-selected="true"] {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}

/* ============ FOR EDITORS ============ */
.editors { background: var(--paper-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); max-width: none; }
.editors__inner { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.editors h2 { margin-bottom: 0.75rem; }
.editors p { max-width: 560px; color: var(--steel); }
.editors__actions { display: flex; gap: 0.9rem; margin-top: 1.5rem; flex-wrap: wrap; }

.btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--ink);
  display: inline-block;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--pitch); border-color: var(--pitch); }
.btn--ghost { color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

/* ============ FOOTER ============ */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer .caption { margin: 0; }
.footer__links a { font-family: var(--font-mono); font-size: 0.7rem; text-decoration: none; color: var(--steel); }
.footer__links a:hover { color: var(--ink); }

/* ============ DISPATCHES (long-form story cards) ============ */
.dispatch-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
@media (max-width: 720px) { .dispatch-list { grid-template-columns: 1fr; } }

.dispatch-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
a.dispatch-card:hover { border-color: var(--pitch); transform: translateY(-3px); }
.dispatch-card--soon { opacity: 0.6; }
.dispatch-card .frame { aspect-ratio: 3 / 2; margin: 0; }
.dispatch-card__body { padding: 1.25rem 1.4rem 1.5rem; }
.dispatch-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--wire);
  margin: 0 0 0.6rem;
}
.dispatch-title { font-size: 1.3rem; margin: 0 0 0.5rem; }
.dispatch-dek { color: var(--steel); font-size: 0.9rem; margin: 0 0 1rem; }
.dispatch-read { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em; }

/* ============ EDITORS — availability block ============ */
.editors__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 2rem;
  max-width: 720px;
}
.meta-item { background: var(--paper-raised); padding: 1rem 1.25rem; }
.meta-item .k {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 0.4rem;
}
.meta-item .v { font-size: 0.88rem; }
@media (max-width: 640px) { .editors__meta { grid-template-columns: 1fr; } }

/* ============================================================
   DISPATCH STORY PAGE (dispatch-01.html and future dispatches)
   Reuses .frame / .caption / design tokens from above so a
   dispatch page never drifts from the main site's look.
   ============================================================ */
.story-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}
.story-nav a { text-decoration: none; color: var(--ink); }
.story-nav a:hover { color: var(--pitch); }
.story-nav__meta { color: var(--steel); }

.story-masthead { max-width: 760px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) 2.5rem; }
.story-masthead .dispatch-tag { font-size: 0.72rem; }
.story-headline { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0.6rem 0 1.1rem; }
.story-dek { color: var(--steel); font-size: 1.05rem; max-width: 600px; margin: 0 0 1.5rem; }
.byline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--steel);
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}
.byline-row strong { color: var(--ink); font-weight: 500; }

.story-cover { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.story-cover .frame { aspect-ratio: 16 / 9; }
.story-cover .caption { padding: 0.6rem 0 2rem; }

.essay { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter); }
.chapter { padding: 3.5rem 0; border-bottom: 1px solid var(--line); }
.chapter:last-of-type { border-bottom: none; }
.chapter-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  color: var(--wire);
  margin-bottom: 0.75rem;
}
.chapter-title { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 0 0 1.25rem; }
.chapter-text { color: var(--ink); font-size: 1rem; margin: 0 0 1rem; max-width: 620px; }

.beat-full { margin: 2.25rem 0; }
.beat-full .frame { aspect-ratio: 3 / 2; }

.beat-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin: 2.25rem 0;
}
.beat-split.reverse { direction: rtl; }
.beat-split.reverse > * { direction: ltr; }
.beat-split .frame { aspect-ratio: 4 / 5; }
.beat-split-text { color: var(--steel); font-size: 0.95rem; }
@media (max-width: 680px) { .beat-split { grid-template-columns: 1fr; } }

.pull-quote {
  max-width: 620px;
  margin: 2.75rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--wire);
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  line-height: 1.35;
  color: var(--ink);
}

.story-closing { max-width: 620px; margin: 0 auto; padding: 3rem var(--gutter) 4rem; }
.story-related {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.75rem var(--gutter);
  border-top: 1px solid var(--line);
}

/* ============ SCROLL REVEAL ============ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
