:root {
  --ink: #efe6d2;
  --ink-2: #e6dcc6;
  --paper: #f7f1e4;
  --paper-2: #fffaf1;
  --rule: #0a3161;
  --rule-dim: rgba(10, 49, 97, 0.16);
  --ivory: #1a2433;
  --ivory-dim: #4d5a6e;
  --body: #2a3344;
  --red: #b22234;
  --gold: #0a3161;
  --up: #1f7a4d;
  --down: #b22234;
  --blue: #3d7ab5;
  --cream: #f7f1e4;
  --shadow: 0 16px 36px rgba(26, 36, 51, 0.12);
  --serif: "Newsreader", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --display: "Cinzel", "Palatino Linotype", Palatino, serif;
  --sans: "Oswald", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    linear-gradient(180deg, rgba(247, 241, 228, 0.65), rgba(239, 230, 210, 0.92)),
    repeating-linear-gradient(0deg, rgba(26, 36, 51, 0.015) 0 1px, transparent 1px 3px),
    var(--ink);
  color: var(--ivory);
  font-family: var(--serif);
  letter-spacing: 0.01em;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.desk {
  min-height: 100vh;
  width: 100%;
  padding: 0;
}

/* Ticker */
.ticker {
  overflow: hidden;
  border-bottom: 3px solid var(--red);
  background: #0a3161;
  color: #f7f1e4;
  height: 38px;
  display: flex;
  align-items: center;
}
.ticker-track {
  display: flex;
  gap: 2.2rem;
  white-space: nowrap;
  animation: marquee 42s linear infinite;
  padding: 0 1.2rem;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ticker-track span.sym { color: #ffffff; font-weight: 600; }
.ticker-track .up { color: #7dffa8; }
.ticker-track .down { color: #ffb3bc; }
.ticker-wait { color: rgba(247, 241, 228, 0.7); }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Masthead — full width newspaper banner */
.masthead {
  padding: 18px 28px 10px;
  border-bottom: 3px solid var(--red);
  background: var(--paper);
}
.masthead-top, .masthead-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--ivory-dim);
}
.masthead-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 2px;
}
.brand-copy { text-align: center; width: 100%; }
.flag-rule {
  display: grid;
  grid-template-rows: 3px 2px 3px;
  gap: 3px;
  margin: 8px 0 6px;
}
.flag-rule i:nth-child(1) { background: var(--red); }
.flag-rule i:nth-child(2) { background: var(--rule); }
.flag-rule i:nth-child(3) { background: var(--red); }
.kicker {
  margin: 0;
  font-family: var(--sans);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--red);
}
.brand-copy h1 {
  margin: 4px 0 2px;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 0.9;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rule);
  text-shadow: none;
}
.motto {
  margin: 0;
  font-style: italic;
  color: var(--ivory-dim);
  font-size: 1.05rem;
}
.rule-flex { flex: 1; height: 1px; background: var(--rule-dim); }
.ghost {
  border: 1px solid var(--rule-dim);
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ivory-dim);
}
.ghost:hover { border-color: var(--rule); color: var(--ivory); }

/* Breaking strip */
.breaking {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 28px 8px;
}
.break-card {
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
  border: 1px solid var(--rule-dim);
  border-radius: 10px;
  padding: 14px 16px 16px;
  min-height: 118px;
  transition: border-color 0.2s, transform 0.2s;
}
.break-card:hover { border-color: var(--rule); transform: translateY(-1px); }
.break-card.is-lead { border-color: rgba(197, 31, 52, 0.7); box-shadow: inset 0 0 0 1px rgba(197,31,52,0.25); }
.break-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--ivory-dim);
  margin-bottom: 8px;
}
.flag {
  color: var(--red);
  font-weight: 600;
}
.flag::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--red);
}
.break-card p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.28;
  color: var(--ivory);
}

/* Hero map + top stories */
.hero {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
  padding: 12px 28px 8px;
}
.map-panel, .top-stories {
  background: var(--paper);
  border: 1px solid var(--rule-dim);
  border-radius: 14px;
  overflow: hidden;
}
.map-stage {
  position: relative;
  min-height: 420px;
  height: 420px;
  background: #163a63;
}
#globe,
#globe-overlay {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#globe-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.globe-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}
.globe-tools button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--rule-dim);
  background: rgba(10, 49, 97, 0.86);
  color: #f7f1e4;
  cursor: pointer;
  font-size: 16px;
}
.globe-tools button:hover { border-color: var(--rule); }
.map-panel.is-full {
  position: fixed;
  inset: 18px;
  z-index: 40;
  border-radius: 16px;
}
.map-panel.is-full .map-stage,
.map-panel.is-full #globe,
.map-panel.is-full #globe-overlay {
  height: calc(100vh - 110px);
  min-height: calc(100vh - 110px);
}
.legend-auto {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--rule-dim);
  color: var(--gold);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}
.src-chip {
  display: inline-block;
  border: 1px solid var(--rule-dim);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--ivory-dim);
}
.src-chip.kind-x { color: var(--rule); border-color: rgba(10, 49, 97, 0.4); }
.src-chip.kind-substack { color: var(--red); border-color: rgba(178, 34, 52, 0.4); }
.src-chip.kind-place { color: var(--gold); }
.src-chip.kind-test { color: var(--red); border-color: rgba(197,31,52,0.5); }
.src-chip:hover { color: var(--ivory); }
.map-art {
  width: 100%;
  height: 420px;
  object-fit: cover;
  opacity: 0.95;
}
.pin {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  box-shadow: 0 0 0 6px rgba(255,255,255,0.04);
}
.pin.spiking { background: var(--red); box-shadow: 0 0 0 7px rgba(197,31,52,0.18), 0 0 18px var(--red); }
.pin.rising { background: var(--gold); box-shadow: 0 0 0 7px rgba(212,180,131,0.16); }
.pin.active { background: var(--blue); }
.pin:hover { transform: translate(-50%, -50%) scale(1.25); }
.map-legend {
  display: flex;
  gap: 18px;
  padding: 8px 14px 12px;
  font-family: var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--ivory-dim);
}
.map-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.map-legend i.spiking { background: var(--red); }
.map-legend i.rising { background: var(--gold); }
.map-legend i.active { background: var(--blue); }
.map-popup {
  position: absolute;
  z-index: 4;
  min-width: 220px;
  max-width: 280px;
  background: rgba(247, 241, 228, 0.96);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ivory);
  box-shadow: var(--shadow);
}
.map-popup strong { display: block; font-size: 0.95rem; margin-bottom: 4px; }
.map-popup span { color: var(--ivory-dim); font-size: 0.82rem; }

.top-stories { padding: 16px 18px 10px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule-dim);
  padding-bottom: 8px;
}
.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.panel-head span {
  font-family: var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--gold);
}
.top-stories ol { list-style: none; margin: 0; padding: 0; }
.top-stories li { border-bottom: 1px solid var(--rule-dim); }
.top-stories a { display: block; padding: 12px 2px; }
.top-stories a:hover strong { color: var(--gold); }
.top-stories strong {
  display: block;
  font-size: 1.02rem;
  line-height: 1.3;
  font-weight: 600;
}
.top-stories span {
  display: block;
  margin-top: 4px;
  color: var(--ivory-dim);
  font-size: 0.82rem;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 28px 10px;
}
.pill {
  background: transparent;
  border: 1px solid var(--rule-dim);
  color: var(--ivory-dim);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  cursor: pointer;
}
.pill.is-on, .pill:hover {
  background: var(--rule);
  color: #f7f1e4;
  border-color: var(--rule);
}

/* Wire table — full width, not a centered micro card */
.wire {
  padding: 0 18px 40px;
}
.wire table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--rule-dim);
  border-radius: 12px;
  overflow: hidden;
}
.wire th, .wire td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--rule-dim);
}
.wire th {
  font-family: var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  color: #f7f1e4;
  font-weight: 500;
  background: #0a3161;
}
.wire tbody tr { cursor: pointer; }
.wire tbody tr:hover { background: rgba(10, 49, 97, 0.06); }
.rank { color: var(--ivory-dim); font-variant-numeric: tabular-nums; width: 40px; }
.summary a {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}
.desk-tag {
  display: inline-block;
  border: 1px solid var(--rule-dim);
  border-radius: 999px;
  padding: 3px 10px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.muted { color: var(--ivory-dim); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.delta.up { color: var(--up); font-variant-numeric: tabular-nums; }
.open {
  display: inline-block;
  border: 1px solid var(--rule);
  color: var(--rule);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}
.open:hover { background: var(--rule); color: #f7f1e4; }
.bm-icon {
  background: none;
  border: 0;
  cursor: pointer;
  width: 16px;
  height: 20px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
  background: rgba(10, 49, 97, 0.18);
  padding: 0;
}
.bm-icon.is-on { background: var(--red); }
.wire tr.is-hidden { display: none; }

.colophon {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px 40px;
  border-top: 1px solid var(--rule-dim);
  color: var(--ivory-dim);
}
.colophon img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.colophon strong {
  display: block;
  color: var(--ivory);
  font-family: var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.colophon p { margin: 4px 0 0; max-width: 720px; }

/* Newspaper reader — almost full screen broadsheet */
.reader {
  width: min(1240px, 96vw);
  max-height: 94vh;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}
.reader::backdrop {
  background: rgba(10, 49, 97, 0.42);
  backdrop-filter: blur(8px);
}
.paper {
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.92), rgba(247, 241, 228, 0.98));
  border: 1px solid var(--rule);
  box-shadow: var(--shadow), inset 0 0 0 8px rgba(178, 34, 52, 0.06);
  padding: 28px 42px 48px;
  overflow: auto;
  max-height: 94vh;
  animation: unfold 0.45s cubic-bezier(.2,.8,.2,1);
  color: var(--ivory);
}
@keyframes unfold {
  from { transform: rotateX(7deg) scale(0.96); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.paper-kicker {
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--red);
  border-bottom: 2px solid var(--rule);
  padding-bottom: 8px;
}
.paper-flag {
  margin: 14px 0 0;
  color: var(--red);
  font-family: var(--sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 12px;
}
.paper h1, .story-page h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1.05;
  margin: 12px 0 10px;
  letter-spacing: 0.02em;
}
.dek {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--ivory-dim);
  margin: 0 0 16px;
  max-width: 58ch;
}
.byline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--rule-dim);
  border-bottom: 1px solid var(--rule-dim);
  padding: 10px 0;
  margin-bottom: 22px;
  color: var(--ivory-dim);
  font-size: 0.92rem;
}
.byline strong { color: var(--ivory); display: block; }
.lead-art { margin: 0 0 22px; }
.lead-art img { width: 100%; max-height: 420px; object-fit: cover; border: 1px solid var(--rule-dim); }
.lead-art figcaption { color: var(--ivory-dim); font-size: 0.85rem; margin-top: 6px; }
.columns {
  column-count: 2;
  column-gap: 2.4rem;
  column-rule: 1px solid var(--rule-dim);
  font-size: 1.12rem;
  line-height: 1.55;
  color: var(--body);
}
.columns p { margin: 0 0 0.95em; }
.columns p:first-of-type::first-letter {
  float: left;
  font-family: var(--display);
  font-size: 4.6rem;
  line-height: 0.75;
  padding: 8px 10px 0 0;
  color: var(--gold);
}
.source-line { margin-top: 1.4rem; color: var(--ivory-dim); }
.paper-actions { display: flex; gap: 10px; margin-top: 22px; }
.paper-actions button, .paper-actions .open {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ivory);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 11px;
}
.reader-close {
  position: sticky;
  top: 0;
  float: right;
  margin: -8px -12px 0 0;
}

.story-shell { padding: 0 0 48px; }
.story-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
}
.wordmark {
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.16em;
}
.story-page {
  width: min(1100px, 94vw);
  margin: 24px auto;
  max-height: none;
  overflow: visible;
}
.related {
  width: min(1100px, 94vw);
  margin: 0 auto;
  display: grid;
  gap: 8px;
}
.related h2 {
  font-family: var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--red);
}
.related a {
  border-top: 1px solid var(--rule-dim);
  padding: 10px 0;
  font-size: 1.1rem;
}
.related a:hover { color: var(--gold); }

@media (max-width: 1100px) {
  .breaking { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; }
  .columns { column-count: 1; }
}
@media (max-width: 720px) {
  .masthead, .breaking, .hero, .filters, .wire, .colophon, .story-bar { padding-left: 14px; padding-right: 14px; }
  .breaking { grid-template-columns: 1fr; }
  .brand-copy h1 {
    font-size: 1.7rem;
    letter-spacing: 0.08em;
    max-width: 12ch;
    line-height: 1.02;
    white-space: normal;
  }
  .masthead-brand { flex-direction: column; gap: 10px; }
  .masthead-bottom span:last-child { display: none; }
  .map-stage, .map-art, #globe, #globe-overlay { min-height: 260px; height: 260px; }
  .map-panel.is-full .map-stage, .map-panel.is-full #globe, .map-panel.is-full #globe-overlay { height: calc(100vh - 90px); min-height: calc(100vh - 90px); }
  .wire table, .wire thead, .wire tbody, .wire th, .wire td, .wire tr { display: block; }
  .wire thead { display: none; }
  .wire td { border: 0; padding: 6px 12px; }
  .wire tr { padding: 12px 0; border-bottom: 1px solid var(--rule-dim); }
  .paper { padding: 22px 18px 32px; }
}
