/* ==========================================================================
   No Wall News — styles
   ========================================================================== */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-2: #4a4f59;
  --ink-3: #7b808a;
  --line: #e6e3dc;
  --brand: #14213d;
  --accent: #e4572e;

  --c-national: #2563eb;
  --c-politics: #b4232c;
  --c-finance: #0f7b5c;
  --c-world: #7c3aed;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 10px;
  --gap: 28px;
  --max: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #171a20;
    --ink: #eceef2;
    --ink-2: #b3b8c2;
    --ink-3: #868c97;
    --line: #262a33;
    --brand: #eceef2;
    --c-national: #6b9bff;
    --c-politics: #f06a72;
    --c-finance: #34c391;
    --c-world: #a78bfa;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a20;
  --ink: #eceef2;
  --ink-2: #b3b8c2;
  --ink-3: #868c97;
  --line: #262a33;
  --brand: #eceef2;
  --c-national: #6b9bff;
  --c-politics: #f06a72;
  --c-finance: #34c391;
  --c-world: #a78bfa;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Category color hook */
[data-cat="national"] { --cat: var(--c-national); }
[data-cat="politics"] { --cat: var(--c-politics); }
[data-cat="finance"]  { --cat: var(--c-finance); }
[data-cat="world"]    { --cat: var(--c-world); }

/* ---------- Top bar ---------- */
.topbar { border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 34px; }
.topbar__date { white-space: nowrap; }
.ticker { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.ticker::-webkit-scrollbar { display: none; }
.ticker b { font-weight: 600; color: var(--ink-2); margin-left: 4px; }
.ticker .up { color: var(--c-finance); }
.ticker .down { color: var(--c-politics); }
@media (max-width: 640px) { .topbar__date { display: none; } }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__inner { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding-top: 14px; padding-bottom: 10px; }
.brand { justify-self: center; text-align: center; }
.brand__name { display: block; font: 700 clamp(28px, 4.5vw, 44px)/1 var(--serif); letter-spacing: -0.02em; color: var(--brand); }
.brand__name em { font-style: italic; font-weight: 500; color: var(--accent); }
.brand__name--sm { font-size: 24px; }
.brand__tag { display: block; margin-top: 6px; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink-2); cursor: pointer; transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.theme-toggle { justify-self: end; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

.nav__inner { display: flex; justify-content: center; gap: 4px; }
.nav__link {
  position: relative; padding: 10px 14px 12px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: color .15s;
}
.nav__link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px;
  background: var(--cat, var(--accent)); border-radius: 2px;
  transform: scaleX(0); transition: transform .2s ease;
}
.nav__link:hover, .nav__link.is-active { color: var(--ink); }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); }

.menu-toggle { display: none; }
@media (max-width: 720px) {
  .menu-toggle { display: inline-grid; }
  .brand__tag { display: none; }
  .header__inner { padding-bottom: 14px; }
  .nav { display: none; border-top: 1px solid var(--line); }
  .nav.is-open { display: block; }
  .nav__inner { flex-direction: column; padding-top: 6px; padding-bottom: 10px; }
  .nav__link::after { left: 0; right: auto; width: 3px; top: 10px; bottom: 10px; height: auto; transform: scaleY(0); }
  .nav__link:hover::after, .nav__link.is-active::after { transform: scaleY(1); }
}
@media (min-width: 721px) { .menu-toggle + .brand { grid-column: 2; } }

/* ---------- Ads ---------- */
.ad { display: flex; flex-direction: column; align-items: center; margin: 24px auto; }
.ad__label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.ad__slot {
  width: 100%; border-radius: 6px; overflow: hidden;
  /* Reserve space so the page doesn't jump when ads load. Remove the
     background once real ads are wired up. */
  background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--line) 55%, transparent) 10px 11px);
  border: 1px solid var(--line);
}
.ad--leaderboard .ad__slot { max-width: 728px; height: 90px; }
.ad--rect { margin: 28px 0 0; width: 100%; }
.ad--rect .ad__slot { max-width: 300px; height: 250px; }
.ad--infeed { margin: 8px auto 48px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ad--infeed .ad__slot { max-width: 970px; height: 250px; }
@media (max-width: 760px) {
  .ad--leaderboard .ad__slot { max-width: 320px; height: 50px; }
  .ad--infeed .ad__slot { max-width: 300px; height: 250px; }
}

/* ---------- Shared bits ---------- */
.kicker {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--cat, var(--accent));
}
.meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.meta span + span::before { content: "·"; margin-right: 10px; }

.media {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--cat) 45%, transparent), transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--cat) 22%, var(--surface)), color-mix(in srgb, var(--cat) 8%, var(--surface)));
}
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.media--wide { aspect-ratio: 16 / 9; }
.media--thumb { aspect-ratio: 1; flex: 0 0 96px; border-radius: 8px; }

.card__link { display: block; }
.card__title { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; transition: color .15s; }
.card__title a { transition: color .15s; }
.card__title a:hover { color: var(--cat, var(--accent)); }
.card__dek { margin: 8px 0 0; color: var(--ink-2); }
.card .kicker + .card__title { margin-top: 6px; }

/* ---------- Top stories ---------- */
.top { padding: 8px 0 40px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.top__grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .top__grid { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr) 300px; }
}
@media (min-width: 640px) and (max-width: 899px) {
  .top__grid { grid-template-columns: 1fr 1fr; }
  .top__lead { grid-column: 1 / -1; }
}

.card--lead { padding-right: 4px; }
.card--lead .card__title { font-size: clamp(30px, 3.8vw, 46px); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; }
.card--lead .card__dek { font-size: 17.5px; }

.top__secondary { display: flex; flex-direction: column; }
.card--secondary { padding: 18px 0; border-bottom: 1px solid var(--line); }
.card--secondary:first-child { padding-top: 0; }
.card--secondary:last-child { border-bottom: 0; }
.card--secondary .card__title { font-size: 20px; }
.card--secondary .card__dek { font-size: 14.5px; }

.top__aside { display: flex; flex-direction: column; align-items: center; }
@media (min-width: 900px) { .top__aside { border-left: 1px solid var(--line); padding-left: var(--gap); } }
@media (min-width: 640px) and (max-width: 899px) { .top__aside { grid-column: 1 / -1; } }
.aside-title {
  align-self: stretch; font: 700 13px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase;
  padding-bottom: 12px; border-bottom: 2px solid var(--ink);
}
.most-read { align-self: stretch; list-style: none; margin: 0; padding: 0; counter-reset: mr; }
.most-read li { counter-increment: mr; display: grid; grid-template-columns: 32px 1fr; padding: 14px 0; border-bottom: 1px solid var(--line); }
.most-read li::before { content: counter(mr); font: 600 24px/1 var(--serif); color: var(--ink-3); grid-row: 1 / span 3; }
.most-read li > * { grid-column: 2; }
.most-read .meta { margin-top: 4px; }
.most-read a { font: 600 16px/1.3 var(--serif); }
.most-read a:hover { color: var(--accent); }
.most-read .kicker { display: block; font-size: 10px; margin-bottom: 4px; }

/* ---------- Category sections ---------- */
.section { margin-bottom: 56px; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-bottom: 12px; margin-bottom: 24px; border-bottom: 1px solid var(--line); position: relative;
}
.section__head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 3px; background: var(--cat); border-radius: 2px; }
.section__title { font: 700 28px/1 var(--serif); letter-spacing: -0.015em; }
.section__more { font-size: 13.5px; font-weight: 600; color: var(--cat); white-space: nowrap; }
.section__more:hover { text-decoration: underline; text-underline-offset: 3px; }

.section__grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 720px) { .section__grid { grid-template-columns: 1.4fr 1fr; } .section__list { grid-column: 1 / -1; } }
@media (min-width: 1024px) { .section__grid { grid-template-columns: 1.5fr 1fr 1fr; } .section__list { grid-column: auto; } }

.card--feature .card__title { font-size: 26px; line-height: 1.15; }
.card--feature { padding-right: 8px; }

.section__col { display: flex; flex-direction: column; gap: 18px; }
.card--compact { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.card--compact:last-child { border-bottom: 0; padding-bottom: 0; }
.card--compact .card__title { font-size: 17px; }
.card--compact .meta { margin-top: 6px; }

.section__list { list-style: none; margin: 0; padding: 0; }
.section__list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.section__list li:first-child { padding-top: 0; }
.section__list a { font: 600 16px/1.3 var(--serif); }
.section__list a:hover { color: var(--cat); }
.section__list .meta { margin-top: 4px; }
@media (min-width: 1024px) { .section__list { border-left: 1px solid var(--line); padding-left: var(--gap); } }

/* ---------- Status line ---------- */
.status { margin: 0 0 18px; font-size: 13px; color: var(--ink-3); text-align: center; }
.status--ok { text-align: right; font-size: 12px; margin-bottom: 10px; }

/* ---------- Sources ("Also:") ---------- */
.meta__source { font-weight: 600; color: var(--ink-2); }
.meta__count { color: var(--cat, var(--accent)); font-weight: 600; }
.also { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; }
.also__label { color: var(--ink-3); margin-right: 2px; }
.also__link {
  padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2);
  background: var(--surface); transition: border-color .15s, color .15s;
}
.also__link:hover { color: var(--ink); border-color: var(--ink-3); }

/* ---------- The TL;DR ---------- */
.tldr {
  margin: 4px 0 40px; padding: 28px 28px 22px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden;
}
.tldr::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.tldr__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 18px; }
.tldr__title { font: 700 30px/1 var(--serif); letter-spacing: -0.02em; }
.tldr__title span { color: var(--accent); font-style: italic; }
.tldr__tag { margin: 0; color: var(--ink-3); font-size: 14px; }
.tldr__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px 36px; counter-reset: tl; }
@media (min-width: 860px) { .tldr__list { grid-template-columns: 1fr 1fr; } }
.tldr__item { counter-increment: tl; position: relative; padding-left: 34px; }
.tldr__item::before {
  content: counter(tl); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 999px;
  display: grid; place-items: center; font: 700 12px/1 var(--sans); color: #fff; background: var(--ink);
}
:root[data-theme="dark"] .tldr__item::before { color: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tldr__item::before { color: var(--bg); } }
.tldr__headline { font: 600 19px/1.25 var(--serif); }
.tldr__summary { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.tldr__note { margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
@media (max-width: 640px) { .tldr { padding: 22px 18px 18px; } .tldr__title { font-size: 26px; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 28px; background: var(--surface); }
.footer__inner { display: grid; gap: 28px; }
@media (min-width: 800px) { .footer__inner { grid-template-columns: 1fr 1fr; align-items: start; } }
.footer__blurb { max-width: 380px; margin: 10px 0 0; color: var(--ink-3); font-size: 14px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 14px; color: var(--ink-2); }
@media (min-width: 800px) { .footer__links { justify-content: flex-end; } }
.footer__links a:hover { color: var(--ink); }
.footer__legal { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
.topbar__note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
