/* Pulse — a clean, modern news front page. Light, editorial, type-forward. */
:root {
  --ink: #16181d;
  --ink-soft: #444a54;
  --muted: #8a909b;
  --line: #e7e9ee;
  --line-soft: #f0f1f4;
  --paper: #ffffff;
  --paper2: #fbfbfc;
  --accent: #c1272d;        /* news red */
  --accent-soft: #fbecec;
  --pos: #1a8f5c;
  --neg: #c1272d;
  --neu: #9aa1ac;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.mast-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 26px;
}
.brand { display: flex; flex-direction: column; }
.wordmark {
  font-family: var(--serif); font-weight: 800; font-size: 30px; letter-spacing: -.5px;
  display: flex; align-items: center; gap: 9px; line-height: 1;
}
.dot-live {
  width: 9px; height: 9px; border-radius: 50%; background: var(--muted);
}
.dot-live.on {
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(193,39,45,.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(193,39,45,.5); }
  70% { box-shadow: 0 0 0 7px rgba(193,39,45,0); }
  100% { box-shadow: 0 0 0 0 rgba(193,39,45,0); }
}
.tagline { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; margin-top: 3px; }
.dateblock {
  font-family: var(--serif); font-size: 13.5px; color: var(--ink-soft);
  margin-left: auto; text-align: right; border-right: 1px solid var(--line); padding-right: 22px;
}
.tabs { display: flex; gap: 4px; }
.tab {
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 7px 13px; border-radius: 8px; transition: all .15s;
}
.tab:hover { color: var(--ink); background: var(--line-soft); }
.tab.active { color: var(--accent); background: var(--accent-soft); }

.ticker {
  max-width: 1200px; margin: 0 auto; padding: 0 24px 9px;
  font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.ticker b { color: var(--accent); font-weight: 700; }

/* ---------- layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 30px 24px 60px; }

.section-rule {
  display: flex; align-items: baseline; gap: 12px;
  border-top: 3px solid var(--ink); margin: 42px 0 22px; padding-top: 10px;
}
.section-rule span {
  font-family: var(--serif); font-weight: 800; font-size: 19px; letter-spacing: -.2px;
}
.section-rule em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: auto; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.55fr 1fr; gap: 38px;
  padding-bottom: 30px; border-bottom: 1px solid var(--line);
}
.hero .lede .eyebrow { margin-bottom: 12px; }
.hero h1 {
  font-family: var(--serif); font-weight: 800; font-size: 42px; line-height: 1.08;
  letter-spacing: -.8px; margin: 0 0 14px;
}
.hero h1:hover { color: var(--accent); cursor: pointer; }
.hero .dek { font-size: 17px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 18px; max-width: 40ch; }
.hero .heroline { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* ---------- story grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 34px;
}
.story {
  display: flex; flex-direction: column;
  padding-top: 22px; padding-bottom: 4px;
  border-top: 1px solid var(--line);
}
.story .eyebrow { margin-bottom: 9px; }
.story h2 {
  font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.16;
  letter-spacing: -.3px; margin: 0 0 9px; cursor: pointer;
}
.story h2:hover { color: var(--accent); }
.story .dek { font-size: 14px; color: var(--ink-soft); margin: 0 0 14px; line-height: 1.5; }

/* eyebrow = category + freshness */
.eyebrow {
  display: flex; align-items: center; gap: 9px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
}
.eyebrow .cat { color: var(--accent); }
.eyebrow .ago { color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.eyebrow .ago::before { content: "·"; margin-right: 9px; color: var(--line); }

/* ---------- timeline ---------- */
.timeline {
  position: relative; margin: 4px 0 12px; padding-left: 20px;
  border-left: 2px solid var(--line);
}
.tl-row { position: relative; padding: 0 0 13px; }
.tl-row:last-child { padding-bottom: 2px; }
.tl-row .pt {
  position: absolute; left: -26px; top: 4px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--neu); border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line);
}
.tl-row.positive .pt { background: var(--pos); }
.tl-row.negative .pt { background: var(--neg); }
.tl-row .t { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.tl-row .h { font-size: 13.5px; font-weight: 600; line-height: 1.35; margin: 1px 0 2px; color: var(--ink); }
.tl-row .m { font-size: 11px; color: var(--muted); }
.tl-row .m b { color: var(--accent); font-weight: 700; }

.hero .timeline { margin-top: 6px; }
.hero .tl-row .h { font-size: 15px; }

/* footer meta + view more */
.story .foot-meta, .hero .foot-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted); margin-top: auto; padding-top: 4px;
}
.foot-meta .big { color: var(--ink); font-weight: 700; font-size: 13px; }
.foot-meta .actor {
  background: var(--line-soft); border-radius: 999px; padding: 2px 9px; color: var(--ink-soft);
  font-weight: 600;
}
.viewmore {
  align-self: flex-start; margin-top: 10px; cursor: pointer;
  background: none; border: none; padding: 6px 0; font-family: var(--sans);
  font-size: 12.5px; font-weight: 700; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
.viewmore:hover { gap: 9px; }
.viewmore .arw { transition: transform .15s; }

.empty { text-align: center; padding: 80px 0; color: var(--muted); }
.empty h2 { font-family: var(--serif); color: var(--ink); }
.empty code { background: var(--line-soft); padding: 2px 7px; border-radius: 5px; font-size: 13px; }

.foot {
  border-top: 1px solid var(--line); padding: 26px 24px; text-align: center;
  font-size: 12px; color: var(--muted); max-width: 1200px; margin: 0 auto;
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { font-size: 34px; }
  .dateblock { display: none; }
}
@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  .mast-inner { flex-wrap: wrap; gap: 12px; }
  .tabs { width: 100%; }
  .hero h1 { font-size: 29px; }
}

/* ---------- full-timeline popover ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(20,22,26,.55);
  backdrop-filter: blur(3px); animation: fade .18s ease;
}
.modal-panel {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: min(720px, 92vw); max-height: 86vh; background: var(--paper);
  border-radius: 16px; box-shadow: 0 30px 90px rgba(0,0,0,.34);
  overflow: hidden; animation: pop .2s cubic-bezier(.2,.8,.25,1);
  transition: width .22s ease;
}
.modal-cols { display: flex; max-height: 86vh; }
.modal-panel.with-sources { width: min(1100px, 95vw); }
.modal-panel.sources-only { width: min(460px, 92vw); }
.modal-x {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft);
  font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-x:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.modal-body { flex: 1 1 auto; min-width: 0; overflow-y: auto; padding: 36px 40px 34px; }
.modal-panel.sources-only .modal-body { display: none; }

/* sources side panel — its own scroll */
.modal-sources {
  flex: 0 0 340px; width: 340px; display: none;
  border-left: 1px solid var(--line); background: var(--paper2); overflow-y: auto;
}
.modal-panel.with-sources .modal-sources,
.modal-panel.sources-only .modal-sources { display: block; }
.modal-panel.sources-only .modal-sources { border-left: none; flex: 1 1 auto; width: auto; }
.src-head {
  position: sticky; top: 0; z-index: 1; background: var(--paper2);
  padding: 16px 20px 12px; border-bottom: 1px solid var(--line);
}
.src-title { font-family: var(--serif); font-weight: 700; font-size: 14.5px; line-height: 1.25; padding-right: 26px; }
.src-count { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-top: 5px; }
.src-x {
  position: absolute; top: 10px; right: 12px; border: none; background: none;
  font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer;
}
.src-x:hover { color: var(--accent); }
.src-list { padding: 2px 0 8px; }
.src-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 20px; border-bottom: 1px solid var(--line-soft);
}
.src-item:hover { background: #fff; }
.src-art { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.32; }
.src-item:hover .src-art { color: var(--accent); }
.src-sub { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); }
.src-dom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-when { flex: none; }
.src-foot { padding: 12px 20px; font-size: 11px; color: var(--muted); text-align: center; }

/* the clickable "N sources" count */
.srclink {
  background: none; border: none; padding: 0; margin: 0; font: inherit; color: inherit;
  cursor: pointer; -webkit-appearance: none; appearance: none;
}
.srclink:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.modal-title {
  font-family: var(--serif); font-weight: 800; font-size: 28px; line-height: 1.14;
  letter-spacing: -.4px; margin: 12px 0 12px; padding-right: 30px;
}
.modal-dek { font-size: 15.5px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 14px; }
.modal-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.modal-stats {
  font-size: 12px; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 22px;
}
.modal-tl { margin-left: 4px; }
.loading { color: var(--muted); font-size: 13px; padding: 20px 0; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { opacity: 0; transform: translate(-50%,-47%) scale(.97); }
  to   { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}
@media (max-width: 760px) {
  .modal-panel.with-sources { width: min(560px, 92vw); }
  .modal-cols { flex-direction: column; max-height: 86vh; overflow-y: auto; }
  .modal-sources { flex: none; width: auto; border-left: none; border-top: 1px solid var(--line); }
}
@media (max-width: 620px) { .modal-body { padding: 30px 22px; } .modal-title { font-size: 23px; } }

/* per-event collapsible summary — the headline is the toggle, triangle at its end,
   summary drops in between the headline and the source count */
.ev-sum > summary { list-style: none; cursor: pointer; user-select: none; }
.ev-sum > summary::-webkit-details-marker { display: none; }
.ev-sum > summary::after {
  content: "\00a0▸"; color: var(--accent); font-size: 18px;
}
.ev-sum[open] > summary::after { content: "\00a0▾"; }
.ev-sum-body {
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; margin: 5px 0 6px;
}

/* paginated "load more" in the sources list */
.src-more {
  display: block; width: calc(100% - 40px); margin: 12px 20px 6px; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 9px;
  font-family: inherit; font-size: 12px; font-weight: 700; color: var(--accent);
  text-align: center; transition: border-color .15s, background .15s;
}
.src-more:hover { border-color: var(--accent); background: var(--accent-soft); }
.src-more .lm { color: var(--muted); font-weight: 400; margin-left: 7px; }
