/* ============================================================
   Marathon Ballot - NEWS SECTION  ·  Direction A: "THE WIRE"
   Production component styles. Consumes the existing design
   tokens from styles.css (colors, --font, --mono, spacing,
   motion) - introduces NO new tokens, colours, radii or shadows.
   Load AFTER styles.css.

   Surfaces:
     1. Nav        - NEWS item + live dot, and the WIRE ticker masthead
     2. Homepage   - the "LATEST" wire (3 rows) below the hero
     3. /news      - index: filter bar + lead dispatch + wire log
     4. /news/<slug> - the dispatch reading page
     5. /races/<race> - the "Related news" block (slots into .rsec)
   ============================================================ */

/* ------------------------------------------------------------
   1b · THE WIRE - masthead ticker
   A thin horizontally-scrolling strip under <nav class="nav">,
   inside .wrap. "Bloomberg terminal meets race bib": fixed
   section tag + clock, latest dispatches marquee between them.
   ------------------------------------------------------------ */
.mb-wire {
  display: flex; align-items: center;
  height: 40px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-mute);
  overflow: hidden;
}
.mb-wire-sec {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
  padding-right: 16px;
  color: var(--accent); font-weight: 600; white-space: nowrap;
}
.mb-wire-sec .d { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.mb-wire-rule { flex-shrink: 0; width: 1px; align-self: stretch; margin: 9px 0; background: var(--line-strong); }

/* viewport masks the marquee so items fade in/out at both edges */
.mb-wire-vp {
  position: relative; flex: 1; min-width: 0; overflow: hidden; align-self: stretch;
  display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 44px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 44px), transparent 100%);
}
.mb-wire-track {
  display: inline-flex; align-items: center;
  white-space: nowrap; width: max-content;
  padding-left: 20px;
  animation: mb-wire-marquee 46s linear infinite;
  will-change: transform;
}
/* pause when the reader wants to read */
.mb-wire:hover .mb-wire-track,
.mb-wire:focus-within .mb-wire-track { animation-play-state: paused; }
@keyframes mb-wire-marquee { to { transform: translateX(-50%); } }

.mb-wire-item {
  display: inline-flex; align-items: baseline; gap: 9px;
  padding: 0 20px; position: relative; color: var(--ink-mute);
}
/* leading orange tick between dispatches */
.mb-wire-item::before {
  content: ""; position: absolute; left: -2px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: 0.55;
}
.mb-wire-item .t { color: var(--ink); font-variant-numeric: tabular-nums; }
.mb-wire-item .c { color: var(--ink-soft); }
.mb-wire-item .h {
  color: var(--ink); font-family: var(--font); font-size: 12px;
  text-transform: none; letter-spacing: -0.01em;
}
.mb-wire-item .r { color: var(--ink-mute); }
.mb-wire-item:hover .h { color: var(--accent); }

.mb-wire-clock {
  flex-shrink: 0; align-self: stretch; display: inline-flex; align-items: center;
  padding: 0 0 0 16px; margin-left: 4px;
  border-left: 1px solid var(--line-strong);
  color: var(--ink-mute); font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* reduced motion: no marquee - static, manually scrollable, no edge mask */
@media (prefers-reduced-motion: reduce) {
  .mb-wire-track { animation: none; }
  .mb-wire-vp { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .mb-wire-vp::-webkit-scrollbar { display: none; }
}
@media (max-width: 640px) {
  .mb-wire { font-size: 10px; }
  .mb-wire-clock { display: none; }
  .mb-wire-sec { padding-right: 12px; }
}

/* ------------------------------------------------------------
   Shared - category tag, section note
   ------------------------------------------------------------ */
.wire-note {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-mute);
}
.wire-note a { color: var(--accent); }
.wire-note .mb-wire-clock { border-left: 0; padding: 0; margin: 0; display: inline; color: var(--ink-mute); }

/* ------------------------------------------------------------
   2 + 3 · THE WIRE list  (homepage LATEST, /news log)
   Round 2: uniform rows, time + headline only (no race cell).
   Whole row -> post. Hover borrows the schedule row's orange bar.
   ------------------------------------------------------------ */
.wire { border-top: 1px solid var(--line-strong); }
.wire-row {
  display: grid; grid-template-columns: 132px 1fr; gap: 22px; align-items: center;
  padding: 18px 8px; border-bottom: 1px solid var(--line); position: relative;
  transition: background 180ms ease, padding-left 220ms ease; cursor: pointer;
}
.wire-row::before {
  content: ""; position: absolute; left: -8px; top: 50%; height: 0; width: 2px;
  background: var(--accent); transform: translateY(-50%); transition: height 220ms ease;
}
.wire-row:hover { background: var(--bg-2); padding-left: 16px; }
.wire-row:hover::before { height: 64%; }
.wire-time {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--ink-mute); font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 8px;
}
.wire-time .d { color: var(--ink); }
.wire-time .live { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.wire-head { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; color: var(--ink); }

@media (max-width: 720px) {
  .wire-row { grid-template-columns: 1fr; gap: 4px; padding: 16px 4px; }
  .wire-row:hover { padding-left: 4px; }
  .wire-head { font-size: 16px; }
}

/* ------------------------------------------------------------
   3 · /news INDEX - quiet globe masthead (Round 2)
   Copy left (eyebrow + big title), calm globe right. No description,
   no lead card, no filter bar. Globe hides < 760px so phones reach
   the feed immediately.
   ------------------------------------------------------------ */
.news-hero {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 48px; padding: 46px 0 40px; position: relative;
}
.news-hero-copy { min-width: 0; }
.news-hero-eye {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
}
.news-hero-eye .d { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.news-hero-title {
  font-size: clamp(52px, 8vw, 104px); font-weight: 700;
  letter-spacing: -0.04em; line-height: 0.88; margin: 16px 0 0;
  color: var(--ink); text-wrap: balance;
}
/* Masthead globe: now a relocatable #globe-stage sharing view-transition-name:
   mb-globe with the homepage/simulator stages, so home<->news glides it. Size it
   down to the quiet 300px masthead here (base .globe-stage in styles.css is the big
   interactive one). news.js fills #globe; whirl rings + orbit dots overlay it. */
section[data-route="news"] .globe-stage {
  width: 300px; height: 300px; aspect-ratio: auto; flex-shrink: 0;
  justify-self: end; place-items: center;
  pointer-events: none; cursor: default; opacity: 0.85; transition: none;
}
/* Radar "ping" on the news globe markers only (home/simulator keep the subtle 3x
   pulse). non-scaling-stroke keeps the ring a crisp 1px line as it expands, so it
   reads as a clean radar sweep, not a fat donut. Moderate 5x reach. globe.js staggers
   each marker's animationDelay, so the pings ripple around the globe. */
@keyframes news-marker-scan {
  0%   { transform: scale(1);   opacity: 0; }
  22%  { opacity: 0.7; }
  100% { transform: scale(5);   opacity: 0; }
}
section[data-route="news"] .marker-ring {
  animation-name: news-marker-scan;
  animation-duration: 2.6s;
  animation-timing-function: cubic-bezier(.15,.6,.3,1);
  vector-effect: non-scaling-stroke;
  stroke-width: 1.3;
}
@media (max-width: 900px) { .news-hero { gap: 28px; } }
@media (max-width: 760px) {
  .news-hero { grid-template-columns: 1fr; padding: 30px 0 22px; }
  section[data-route="news"] .globe-stage { display: none; }
}

/* defensive empty state for a filtered log with no posts */
.news-empty {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-mute); padding: 40px 8px; border-top: 1px solid var(--line-strong);
}

/* ------------------------------------------------------------
   4 · /news/<slug> - the dispatch reading page
   Fixed metadata rail (filing header) + a tight-measure body.
   ------------------------------------------------------------ */
.dsp { display: grid; grid-template-columns: 210px 1fr; gap: 60px; align-items: start; }
.dsp-rail { border-top: 1px solid var(--ink); }
.dsp-rail .m { padding: 12px 0; border-bottom: 1px solid var(--line); }
.dsp-rail .m .k { font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); }
.dsp-rail .m .v { font-size: 14px; margin-top: 4px; color: var(--ink); font-weight: 500; }
.dsp-rail .m .v.accent { color: var(--accent); }
.dsp-body { min-width: 0; max-width: 64ch; }
.dsp-slug { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); }
.dsp-slug .br { color: var(--accent); }
.dsp-body h1 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.04; margin: 12px 0 20px; text-wrap: balance; color: var(--ink); }
.dsp-body h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; margin: 30px 0 12px; color: var(--ink); }
.dsp-body p { font-size: 16px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 18px; }
.dsp-body p.lead { font-size: 19px; line-height: 1.55; color: var(--ink); }
.dsp-body p strong, .dsp-body li strong { color: var(--ink); font-weight: 600; }
.dsp-body a { color: var(--accent); border-bottom: 1px solid var(--line-strong); }
.dsp-body a:hover { border-color: var(--accent); }
.dsp-body ul { margin: 0 0 18px; padding-left: 20px; }
.dsp-body li { font-size: 16px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 6px; }
.dsp-body .soft-cta, .dsp-body .relrace { margin: 26px 0; }
@media (max-width: 760px) {
  .dsp { grid-template-columns: 1fr; gap: 24px; }
  .dsp-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
}

/* related-race card - links to /races/<race> */
.relrace {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  border: 1px solid var(--line-strong); padding: 18px 20px;
  transition: border-color 160ms ease, background 160ms ease;
}
.relrace:hover { border-color: var(--ink); background: var(--bg-2); }
.relrace .rr-k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); }
.relrace .rr-name { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin-top: 5px; color: var(--ink); }
.relrace .rr-meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-mute); margin-top: 4px; text-transform: uppercase; }
.relrace .rr-arrow { font-size: 22px; color: var(--ink-mute); transition: transform 160ms ease, color 160ms ease; flex-shrink: 0; }
.relrace:hover .rr-arrow { color: var(--accent); transform: translateX(4px); }

/* soft alerts CTA - appears exactly once per post */
.soft-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border: 1px solid var(--ink); padding: 20px 22px; flex-wrap: wrap;
}
.soft-cta .sc-copy { display: flex; align-items: center; gap: 16px; min-width: 0; }
.soft-cta .sc-copy > span { display: flex; flex-direction: column; min-width: 0; }
.soft-cta .sc-bell { width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.soft-cta .sc-bell svg { width: 18px; height: 18px; }
.soft-cta .sc-k { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.soft-cta .sc-t { display: block; font-size: 16px; letter-spacing: -0.01em; margin-top: 3px; color: var(--ink); }
.soft-cta .btn { white-space: nowrap; }

/* sources line - closes every post */
.sources {
  margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--ink-mute); line-height: 1.75;
}
.sources .lbl { color: var(--accent); letter-spacing: 0.14em; text-transform: uppercase; margin-right: 8px; }
.sources a { color: var(--ink-soft); border-bottom: 1px solid var(--line-strong); }
.sources a:hover { color: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------------
   5 · /races/<race> - "Related news" block
   Slots into the race page's .rsec rhythm (220px label + content).
   Compact wire rows, same label voice as climate / ballot history.
   ------------------------------------------------------------ */
.race-news { border-top: 1px solid var(--line-strong); }
.rn-row {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 18px; align-items: center;
  padding: 16px 6px; border-bottom: 1px solid var(--line); position: relative;
  transition: background 180ms ease, padding-left 200ms ease; cursor: pointer;
}
.rn-row::before {
  content: ""; position: absolute; left: -6px; top: 50%; height: 0; width: 2px;
  background: var(--accent); transform: translateY(-50%); transition: height 200ms ease;
}
.rn-row:hover { background: var(--bg-2); padding-left: 12px; }
.rn-row:hover::before { height: 60%; }
.rn-date { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.rn-cat { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.rn-head { font-size: 15px; font-weight: 500; letter-spacing: -0.005em; line-height: 1.3; color: var(--ink); }
.rn-arrow { color: var(--ink-mute); justify-self: end; transition: transform 160ms ease, color 160ms ease; }
.rn-row:hover .rn-arrow { color: var(--accent); transform: translateX(3px); }
.race-news-all {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
}
.race-news-all .arrow { transition: transform 160ms ease; }
.race-news-all:hover .arrow { transform: translateX(4px); }
@media (max-width: 720px) {
  .rn-row { grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 2px; }
  .rn-row:hover { padding-left: 2px; }
  .rn-date { order: 1; }
  .rn-head { order: 2; grid-column: 1 / -1; }
  .rn-arrow { display: none; }
}
