:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #17150f;
  --muted: #6b665c;
  --line: #e6e1d6;
  --accent: #d9481f;
  --accent-soft: #fbe3da;
  --visited: #8f897f;
  --shadow: 0 1px 2px rgba(23,21,15,.05), 0 4px 16px rgba(23,21,15,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121110; --surface: #1b1a18; --ink: #f1ede5; --muted: #a39d92;
    --line: #2e2c28; --accent: #ff6b42; --accent-soft: #3a211a; --visited: #77716a;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121110; --surface: #1b1a18; --ink: #f1ede5; --muted: #a39d92;
  --line: #2e2c28; --accent: #ff6b42; --accent-soft: #3a211a; --visited: #77716a;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: Fraunces, Georgia, serif; letter-spacing: -0.01em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
header.site { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.top { display: flex; align-items: center; gap: 18px; padding: 14px 20px 10px; }
.brand { font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: 30px; letter-spacing: -0.02em; line-height: 1; }
.brand span { color: var(--accent); }
.brand.small { font-size: 22px; }
.regions { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.regions a { font: 500 13px Inter, sans-serif; color: var(--muted); padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.regions a:hover { color: var(--ink); }
.regions a.on { background: var(--ink); color: var(--bg); }
.spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--surface); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; width: 240px;
}
.search:focus-within { border-color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; width: 100%; }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn:hover { border-color: var(--muted); }
.cats { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
.cats::-webkit-scrollbar { display: none; }
.cats a { color: var(--muted); font: 500 14px Inter, sans-serif; padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
.cats a:hover { color: var(--ink); }
.cats a.on { background: var(--accent-soft); color: var(--accent); }

/* ---------- page head ---------- */
main { padding: 22px 20px 64px; min-height: 60vh; }
.pagehead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead h1 { font-size: 26px; margin: 0; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.edition { font: 500 13px Inter, sans-serif; color: var(--muted); letter-spacing: 0; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; max-width: 100%; }
/* One line, always: the text changes after load ("12 new since…") and must not move the page. */
#since { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.new-banner {
  /* Floats over the page, so appearing later doesn't push the stories down. */
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 20;
  display: block; margin: 0; background: var(--accent); color: #fff; border: 0;
  font: 600 13px Inter, sans-serif; padding: 8px 16px; border-radius: 999px; cursor: pointer; box-shadow: var(--shadow);
}
.new-banner[hidden] { display: none; }

/* ---------- byline ---------- */
.byline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.byline .cat, .byline .src { font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.byline .cat + .srcs, .byline .cat + .src { margin-left: 2px; }
.srcs { font-weight: 600; color: var(--ink); background: var(--accent-soft); padding: 1px 7px; border-radius: 4px; }
.byline .srcs { color: var(--accent); }
.dot { opacity: .6; }
.new-tag { font: 600 10px Inter, sans-serif; letter-spacing: .05em; color: #fff; background: var(--accent); padding: 1px 6px; border-radius: 4px; }

/* ---------- thumbnails ---------- */
.thumb { position: relative; overflow: hidden; border-radius: 8px; background: var(--accent-soft); aspect-ratio: 16/9; display: grid; place-items: center; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb-label { font: 800 20px Fraunces, Georgia, serif; color: var(--accent); opacity: .75; padding: 0 12px; text-align: center; }
.thumb-lead { aspect-ratio: 16/10; border-radius: 10px; }
.thumb-mini { aspect-ratio: 1; width: 84px; border-radius: 6px; flex: none; }
.thumb-mini .thumb-label { font-size: 11px; }
.thumb-story { aspect-ratio: 16/9; border-radius: 10px; }

/* ---------- lead + grid ---------- */
.lead { display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.lead-body { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.lead h2 { font-size: 34px; line-height: 1.12; margin: 0; }
.lead p { color: var(--muted); font-size: 16px; margin: 0; }
.lead-sources { font-size: 13px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 24px; }
.card { display: flex; flex-direction: column; gap: 8px; }
.card h3 { font-weight: 600; font-size: 19px; line-height: 1.25; margin: 0; }
.card:hover h3, .lead:hover h2, .mini:hover h3, .row:hover .row-title { color: var(--accent); }
.visited h3, .visited h2, .visited h3, .visited .row-title { color: var(--visited); }
.is-new .byline::after { content: 'NEW'; font: 600 10px Inter, sans-serif; letter-spacing: .05em; color: #fff; background: var(--accent); padding: 1px 6px; border-radius: 4px; }

/* ---------- sections ---------- */
.section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; border-top: 2px solid var(--ink); padding-top: 10px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 22px; }
.section-head a { font-size: 13px; font-weight: 500; color: var(--accent); }
.minis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.mini { display: flex; gap: 12px; align-items: flex-start; }
.mini h3 { font-weight: 600; font-size: 15px; line-height: 1.3; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rows { border-top: 1px solid var(--line); }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.row-title { font-weight: 500; }
.row .byline { flex: none; justify-content: flex-end; }

/* ---------- story page ---------- */
.story { max-width: 760px; margin: 0 auto; }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a:hover { color: var(--accent); }
.story h1 { font-size: 40px; line-height: 1.1; margin: 0 0 14px; }
.story-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.story-meta .src { font-weight: 600; color: var(--accent); }
.story-img { margin: 0 0 22px; }
.story-img figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.dek { font-size: 19px; line-height: 1.55; margin: 0; }
.attrib { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.coverage { margin-top: 38px; }
.coverage h2 { font-size: 22px; border-top: 2px solid var(--ink); padding-top: 10px; margin: 0 0 6px; }
.coverage ol { list-style: none; margin: 0; padding: 0; }
.coverage li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.cov-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cov-src { font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.cov-title { display: block; font: 600 18px/1.3 Fraunces, Georgia, serif; }
.cov-title:hover { color: var(--accent); }
.coverage p { color: var(--muted); margin: 6px 0 8px; font-size: 14px; }
.cov-read { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); }
.cov-read:hover { text-decoration: underline; }

/* ---------- static pages ---------- */
.prose { max-width: 680px; margin: 0 auto; font-size: 16px; line-height: 1.7; }
.prose h1 { font-size: 36px; margin: 0 0 20px; }
.prose h2 { font-size: 21px; margin: 32px 0 8px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose code { background: var(--surface); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; font-size: 14px; }
.big-email { font-size: 22px; }

.elsewhere { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 20px; font-size: 13px; color: var(--muted); }
.elsewhere a { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 500; padding: 4px 6px 4px 12px; border-radius: 999px; }
.elsewhere a:hover { border-color: var(--accent); color: var(--accent); }
.elsewhere .count { background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12px; padding: 0 7px; border-radius: 999px; }
.empty { text-align: center; color: var(--muted); padding: 90px 0; }
.empty h2 { color: var(--ink); }
.empty a { color: var(--accent); }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--line); padding: 26px 0 44px; color: var(--muted); font-size: 13px; }
.foot-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.foot-top nav { display: flex; gap: 18px; }
footer a:hover { color: var(--accent); }
footer p { margin: 6px 0; max-width: 720px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .minis { grid-template-columns: repeat(2, 1fr); }
  .lead { grid-template-columns: 1fr; gap: 16px; }
  .lead h2 { font-size: 28px; }
  .search { width: 180px; }
}
@media (max-width: 680px) {
  .wrap, .top, main { padding-left: 16px; padding-right: 16px; }
  header.site { position: static; } /* too tall to pin on a phone */
  .top { flex-wrap: wrap; gap: 10px 12px; }
  .brand { font-size: 26px; }
  .regions { order: 4; width: 100%; justify-content: space-between; }
  .regions a { flex: 1; text-align: center; padding: 5px 6px; }
  .search { order: 5; width: 100%; }
  .grid, .minis { grid-template-columns: 1fr; }
  .lead h2 { font-size: 24px; }
  .story h1 { font-size: 28px; }
  .dek { font-size: 17px; }
  .row { flex-direction: column; gap: 4px; }
  .row .byline { justify-content: flex-start; }
  .foot-top { flex-direction: column; align-items: flex-start; gap: 10px; }
}
.search-status { margin-top: 6px; }
.no-match { color: var(--muted); margin: 4px 0 28px; }
.result-count { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; font-size: 14px; color: var(--muted); }
.pager a { color: var(--accent); font-weight: 600; }
.topics a { padding: 4px 12px; }
mark { background: var(--accent-soft); color: inherit; padding: 0 2px; border-radius: 3px; }
.snippet { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.mention-head { font: 600 12px Inter, sans-serif; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 22px 0 8px; border-bottom: 1px solid var(--line); }
