/* =========================================================
   EuroPress24 — public stylesheet
   Mobile first. Every min-width query adds; nothing undoes.
   ========================================================= */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  /* brand */
  --navy:      #0d1b2a;
  --navy-mid:  #16283c;
  --navy-soft: #243b55;
  --red:       #d62828;
  --red-dark:  #a41e1e;
  --amber:     #f07800;

  /* surfaces */
  --paper:     #ffffff;
  --canvas:    #f5f6f8;
  --sunk:      #eef0f4;

  /* ink */
  --ink:       #14202c;
  --ink-2:     #3d4a59;
  --ink-3:     #6c7787;
  --line:      #e3e6ec;
  --line-2:    #d3d8e0;

  /* type */
  --display: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* fluid scale */
  --step--1: clamp(.75rem, .72rem + .12vw, .8rem);
  --step-0:  clamp(.875rem, .85rem + .12vw, .94rem);
  --step-1:  clamp(1rem, .96rem + .2vw, 1.1rem);
  --step-2:  clamp(1.15rem, 1.08rem + .35vw, 1.4rem);
  --step-3:  clamp(1.4rem, 1.25rem + .7vw, 1.9rem);
  --step-4:  clamp(1.75rem, 1.45rem + 1.5vw, 2.9rem);

  /* rhythm */
  --gap:     clamp(1rem, .8rem + 1vw, 1.5rem);
  --section: clamp(2.25rem, 1.8rem + 2.4vw, 3.75rem);
  --pad:     clamp(1rem, .7rem + 1.4vw, 1.5rem);

  --radius:  6px;
  --radius-s: 3px;
  --shadow:  0 1px 2px rgba(16, 26, 40, .06), 0 4px 16px rgba(16, 26, 40, .05);
  --shadow-lg: 0 12px 40px rgba(10, 20, 34, .16);
  --ease:    .22s cubic-bezier(.4, 0, .2, 1);

  --rule:    var(--red);   /* per-section accent, overridable inline */
  --header-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; background: var(--sunk); }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; overflow: hidden; white-space: nowrap;
  clip: rect(0 0 0 0); clip-path: inset(50%); border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 999;
  background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-s);
  font-size: var(--step--1); font-weight: 600;
  transition: top var(--ease);
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: max(16px, env(safe-area-inset-left));
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px;
  border: 1px solid transparent; border-radius: var(--radius-s);
  font-size: var(--step-0); font-weight: 600; letter-spacing: .01em;
  cursor: pointer; transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--navy); }
.btn--ghost:hover { background: var(--sunk); }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: 0 0 auto;
  background: none; border: 0; border-radius: var(--radius-s);
  color: var(--navy); cursor: pointer;
  transition: background var(--ease);
}
.icon-btn:hover { background: var(--sunk); }

/* ── Top rail ───────────────────────────────────────────── */
.topbar {
  background: var(--navy);
  color: rgba(255, 255, 255, .68);
  font-size: var(--step--1);
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 32px;
}
.topbar time { letter-spacing: .01em; }
.topbar__live { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #45c17a; box-shadow: 0 0 0 0 rgba(69, 193, 122, .6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(69, 193, 122, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(69, 193, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(69, 193, 122, 0); }
}

/* ── Masthead ───────────────────────────────────────────── */
.masthead {
  position: sticky; top: 0; z-index: 90;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(16, 26, 40, .04);
}
.masthead::after {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--red) 0 38%, var(--navy) 38% 100%);
}
.masthead__inner {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  min-height: var(--header-h);
}

.wordmark {
  font-family: var(--display);
  font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.85rem);
  font-weight: 700; letter-spacing: -.025em; line-height: 1;
  color: var(--navy);
  text-align: center;
  justify-self: center;
}
.wordmark span { color: var(--red); }
.wordmark--footer { color: #fff; text-align: left; font-size: 1.55rem; }

/* Desktop search — hidden on phones, the drawer carries search there */
.searchbox { display: none; }

/* ── Nav drawer (mobile) ────────────────────────────────── */
.site-nav {
  position: fixed; inset: 0 auto 0 0;
  width: min(86vw, 330px);
  background: var(--paper);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(-101%);
  transition: transform var(--ease);
  z-index: 120;
  display: flex; flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom);
}
.site-nav.is-open { transform: translateX(0); }

.site-nav__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--paper); z-index: 1;
}
.site-nav__title {
  font-size: var(--step--1); font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}
.site-nav__list { padding: 8px 0; flex: 1; }
.site-nav__list a {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px;
  font-size: var(--step-1); font-weight: 500; color: var(--navy);
  border-left: 3px solid transparent;
  transition: background var(--ease), border-color var(--ease);
}
.site-nav__list a:hover { background: var(--sunk); }
.site-nav__list a.is-current { border-left-color: var(--red); color: var(--red); font-weight: 700; }
.site-nav__search { padding: 16px 20px 24px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.site-nav__search input {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-s);
  background: var(--canvas);
}
.site-nav__search input:focus { outline: none; border-color: var(--red); background: var(--paper); }

.nav-scrim {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(9, 17, 28, .5);
  opacity: 0; transition: opacity var(--ease);
}
.nav-scrim.is-open { opacity: 1; }
body.nav-open { overflow: hidden; }

.menu-toggle__bars { display: grid; gap: 5px; width: 20px; }
.menu-toggle__bars span {
  height: 2px; border-radius: 2px; background: var(--navy);
  transition: transform var(--ease), opacity var(--ease);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--dot, var(--red)); flex: 0 0 auto;
}

/* ── Breaking ticker ────────────────────────────────────── */
.ticker {
  display: flex; align-items: stretch;
  background: var(--red); color: #fff;
  overflow: hidden;
}
.ticker__label {
  display: inline-flex; align-items: center; gap: 7px;
  flex: 0 0 auto; padding: 9px 14px;
  background: var(--navy);
  font-size: var(--step--1); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
}
.ticker__pulse {
  width: 7px; height: 7px; border-radius: 50%; background: #ff5a5a;
  animation: pulse-red 1.6s ease-out infinite;
}
@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .45; transform: scale(.8); }
}
.ticker__track { flex: 1; overflow: hidden; display: flex; align-items: center; }
.ticker__inner {
  display: flex; gap: 44px; white-space: nowrap; padding-left: 20px;
  animation: ticker 45s linear infinite;
}
.ticker__inner:hover, .ticker__inner:focus-within { animation-play-state: paused; }
.ticker__inner a { font-size: var(--step--1); font-weight: 500; padding: 9px 0; }
.ticker__inner a:hover { text-decoration: underline; text-underline-offset: 3px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── Section rule (signature) ───────────────────────────── */
.rule {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: calc(var(--gap) * .9);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy);
  position: relative;
}
.rule::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 68px; height: 2px; background: var(--rule);
}
.rule__title {
  font-family: var(--display);
  font-size: var(--step-2);
  letter-spacing: -.015em;
  color: var(--navy);
}
.rule__meta {
  margin-left: auto;
  font-size: var(--step--1); font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--rule); white-space: nowrap;
}
.rule__meta:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Chips & bylines ────────────────────────────────────── */
.story__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block; padding: 3px 8px; border-radius: 2px;
  background: var(--chip, var(--red)); color: #fff;
  font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; line-height: 1.5;
}
.chip--breaking { background: var(--navy); }
.chip-link:hover .chip { filter: brightness(1.12); }

.byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  font-size: var(--step--1); color: var(--ink-3);
}
.byline__sep { opacity: .5; }

/* ── Story component ────────────────────────────────────── */
.story { display: grid; gap: 12px; }
.story__media { display: block; overflow: hidden; border-radius: var(--radius-s); background: var(--sunk); }
.story__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease);
}
.story:hover .story__media img { transform: scale(1.035); }
.story__body { display: grid; gap: 8px; align-content: start; }
.story__title {
  font-family: var(--display);
  font-size: var(--step-1);
  letter-spacing: -.01em; line-height: 1.3;
}
.story__title a { background-image: linear-gradient(var(--red), var(--red));
  background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size var(--ease), color var(--ease); }
.story:hover .story__title a { color: var(--red); background-size: 100% 1px; }
.story__blurb { font-size: var(--step-0); color: var(--ink-2); line-height: 1.55; }

/* card — the workhorse. Horizontal on phones for a denser read. */
.story--card {
  grid-template-columns: 116px 1fr;
  gap: 14px;
  padding-bottom: var(--gap);
  border-bottom: 1px solid var(--line);
}
.story--card .story__media { aspect-ratio: 4 / 3; }
.story--card .story__blurb { display: none; }
.story--card .story__chips { display: none; }

/* row — compact list item */
.story--row {
  grid-template-columns: 78px 1fr;
  gap: 12px; align-items: start;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.story--row:last-child { border-bottom: 0; padding-bottom: 0; }
.story--row .story__media { aspect-ratio: 1 / 1; }
.story--row .story__chips { display: none; }
.story--row .story__title { font-size: var(--step-0); line-height: 1.4; }
.story--row .story__body { gap: 5px; }

/* side — the hero's runners-up */
.story--side {
  grid-template-columns: 116px 1fr;
  gap: 14px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px;
}
.story--side .story__media { aspect-ratio: 4 / 3; }

/* lead — the front-page hero */
.story--lead {
  position: relative; grid-template-columns: 1fr; gap: 0;
  border-radius: var(--radius); overflow: hidden;
  background: var(--navy);
  box-shadow: var(--shadow);
}
.story--lead .story__media { aspect-ratio: 16 / 10; border-radius: 0; }
.story--lead .story__body {
  padding: var(--pad);
  background: var(--paper);
  gap: 10px;
}
.story--lead .story__title {
  font-size: var(--step-3);
  letter-spacing: -.02em; line-height: 1.18;
}
.story--lead .story__blurb { font-size: var(--step-1); }

/* ── Lead block ─────────────────────────────────────────── */
.lead { display: grid; gap: var(--gap); margin-block: var(--gap) var(--section); }
.lead__side { display: grid; gap: 12px; }

/* ── Split: river + rail ────────────────────────────────── */
.split { display: grid; gap: var(--section); }
.river { min-width: 0; }
.grid { display: grid; gap: var(--gap); }
.grid--stories { grid-template-columns: 1fr; }

/* ── Rail panels ────────────────────────────────────────── */
.rail { display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
}
.panel__title {
  font-family: var(--display);
  font-size: var(--step-1); color: var(--navy);
  padding-bottom: 10px; margin-bottom: 4px;
  border-bottom: 2px solid var(--navy);
}

.ranked li {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px;
  align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.ranked li:last-child { border-bottom: 0; padding-bottom: 0; }
.ranked__num {
  font-family: var(--display); font-size: 1.7rem; font-weight: 700;
  line-height: .9; color: var(--line-2);
  font-variant-numeric: tabular-nums;
}
.ranked__text h3 { font-size: var(--step-0); line-height: 1.4; margin-bottom: 5px; }
.ranked__text h3 a:hover { color: var(--red); }

.cat-list li { border-bottom: 1px solid var(--line); }
.cat-list li:last-child { border-bottom: 0; }
.cat-list a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; font-size: var(--step-0);
  transition: color var(--ease);
}
.cat-list a:hover { color: var(--red); }
.cat-list__name { flex: 1; min-width: 0; }
.cat-list__count {
  font-size: var(--step--1); color: var(--ink-3);
  background: var(--sunk); border-radius: 20px; padding: 1px 9px;
  font-variant-numeric: tabular-nums;
}

/* ── Section blocks ─────────────────────────────────────── */
.block { margin-top: var(--section); }
.block__grid { display: grid; gap: var(--gap); }
.block__rows { display: grid; gap: 14px; align-content: start; }
.block .story--card { border-bottom: 0; padding-bottom: 0; }
.block .story--card .story__chips { display: flex; }

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: grid; gap: 12px; justify-items: center;
  margin-block: var(--section) 0;
  padding-top: var(--gap);
  border-top: 1px solid var(--line);
}
.pagination__status { font-size: var(--step--1); color: var(--ink-3); }
.pagination__status strong { color: var(--ink); }
.pagination__range { display: none; }
.pagination__list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pagination__num { display: none; }
.pagination__gap { display: none; color: var(--ink-3); padding-inline: 2px; }

.page-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 42px; min-height: 42px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-s);
  background: var(--paper);
  font-size: var(--step-0); font-weight: 600; color: var(--navy);
  font-variant-numeric: tabular-nums;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.page-link:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.page-link.is-active {
  background: var(--red); border-color: var(--red); color: #fff; cursor: default;
}
.page-link.is-disabled {
  opacity: .4; cursor: not-allowed; background: transparent;
}
.page-link.is-disabled:hover { background: transparent; border-color: var(--line-2); color: var(--navy); }
.page-link--nav { padding-inline: 18px; }

/* ── Empty state ────────────────────────────────────────── */
.empty {
  display: grid; gap: 10px; justify-items: center; text-align: center;
  padding: clamp(2.5rem, 8vw, 4.5rem) var(--pad);
  background: var(--paper); border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}
.empty h2 { font-family: var(--display); font-size: var(--step-2); color: var(--navy); }
.empty p { color: var(--ink-3); max-width: 42ch; }

/* ── Page banners ───────────────────────────────────────── */
.banner {
  background: var(--navy); color: #fff;
  padding-block: clamp(1.75rem, 5vw, 3rem);
  border-bottom: 4px solid var(--rule);
}
.banner__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--step--1); font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, .6); margin-bottom: 8px;
}
.banner h1 {
  font-family: var(--display);
  font-size: var(--step-4); letter-spacing: -.025em;
}
.banner p { color: rgba(255, 255, 255, .72); margin-top: 6px; font-size: var(--step-0); }
.banner .searchbox--hero {
  display: flex; gap: 8px; margin-top: 18px; max-width: 520px;
}
.banner .searchbox--hero input {
  flex: 1; min-height: 46px; padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .26); border-radius: var(--radius-s);
  background: rgba(255, 255, 255, .08); color: #fff;
}
.banner .searchbox--hero input::placeholder { color: rgba(255, 255, 255, .5); }
.banner .searchbox--hero input:focus { outline: none; border-color: #fff; background: rgba(255, 255, 255, .14); }

main { padding-bottom: var(--section); }
.page-top { padding-top: var(--gap); }

/* ── Article ────────────────────────────────────────────── */
.article { min-width: 0; }
.article__hero {
  border-radius: var(--radius); overflow: hidden; margin-bottom: var(--gap);
  background: var(--sunk);
}
.article__hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article__head { display: grid; gap: 12px; margin-bottom: var(--gap); }
.article__head h1 {
  font-family: var(--display);
  font-size: var(--step-4); line-height: 1.14; letter-spacing: -.025em;
  color: var(--navy);
}
.article__meta {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  padding-block: 12px; border-block: 1px solid var(--line);
  font-size: var(--step--1); color: var(--ink-3);
}
.article__meta strong { color: var(--navy); font-weight: 600; }
.article__standfirst {
  font-family: var(--display); font-size: var(--step-2);
  line-height: 1.45; color: var(--ink-2);
  border-left: 3px solid var(--red); padding-left: 16px;
}
.article__body { font-size: var(--step-1); line-height: 1.75; color: #24303e; }
.article__body > * + * { margin-top: 1.15em; }
.article__body h2 { font-family: var(--display); font-size: var(--step-3); color: var(--navy); margin-top: 1.7em; }
.article__body h3 { font-family: var(--display); font-size: var(--step-2); margin-top: 1.5em; }
.article__body a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.article__body blockquote {
  border-left: 3px solid var(--red); background: var(--paper);
  padding: 14px 20px; border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--display); font-style: italic; color: var(--ink-2);
}
.article__body img { border-radius: var(--radius); margin-inline: auto; }
.article__body ul, .article__body ol { padding-left: 1.35em; }
.article__body ul { list-style: disc; }
.article__body ol { list-style: decimal; }
.article__body li + li { margin-top: .4em; }

.source-note {
  background: var(--paper); border: 1px solid var(--line);
  border-left: 3px solid var(--navy);
  border-radius: var(--radius-s);
  padding: 12px 16px; font-size: var(--step--1); color: var(--ink-3);
  margin-bottom: var(--gap);
}
.source-note a { color: var(--red); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: var(--gap); }
.tags__label { font-size: var(--step--1); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.tag {
  display: inline-block; padding: 6px 13px;
  border: 1px solid var(--line-2); border-radius: 20px;
  font-size: var(--step--1); color: var(--ink-2);
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.tag:hover { background: var(--navy); border-color: var(--navy); color: #fff; }

.share {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: var(--gap); padding-top: var(--gap); border-top: 1px solid var(--line);
}
.share__label { font-size: var(--step--1); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); width: 100%; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 8px 15px; border: 0; border-radius: var(--radius-s);
  font-size: var(--step--1); font-weight: 600; color: #fff; cursor: pointer;
  transition: filter var(--ease);
}
.share-btn:hover { filter: brightness(1.1); }
.share-btn.fb { background: #1877f2; }
.share-btn.tw { background: #101418; }
.share-btn.wa { background: #22c15e; }
.share-btn.lk { background: #0a66c2; }
.share-btn.cp { background: var(--ink-2); }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  background: var(--navy); color: rgba(255, 255, 255, .68);
  margin-top: var(--section);
  border-top: 4px solid var(--red);
}
.site-footer__grid {
  display: grid; gap: var(--gap);
  padding-block: var(--section) var(--gap);
}
.site-footer__brand p { font-size: var(--step-0); opacity: .7; margin-top: 8px; max-width: 46ch; }
.site-footer__col h2 {
  color: #fff; font-size: var(--step--1); font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px;
}
.site-footer__col li + li { margin-top: 9px; }
.site-footer__col a { font-size: var(--step-0); transition: color var(--ease); }
.site-footer__col a:hover { color: #fff; }
.site-footer__bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding-block: 18px; border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: var(--step--1); color: rgba(255, 255, 255, .5);
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
.site-footer__top:hover { color: #fff; }

/* =========================================================
   ≥ 560px — cards get their images back on top
   ========================================================= */
@media (min-width: 560px) {
  .story--card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-bottom: 0;
    border-bottom: 0;
  }
  .story--card .story__media { aspect-ratio: 16 / 10; }
  .story--card .story__blurb,
  .story--card .story__chips { display: block; }
  .story--card .story__chips { display: flex; }

  .grid--stories { grid-template-columns: repeat(2, 1fr); }
  .lead__side { grid-template-columns: repeat(2, 1fr); }
  .pagination__range { display: inline; }
  .pagination { justify-items: stretch; }
  .pagination__list { justify-content: center; }
}

/* =========================================================
   ≥ 768px — numbers appear, hero overlays, footer splits
   ========================================================= */
@media (min-width: 768px) {
  :root { --header-h: 68px; }

  .pagination__num, .pagination__gap { display: inline-flex; }
  .pagination {
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
  }
  .pagination__list { justify-self: end; }

  /* Hero: text sits on the image */
  .story--lead .story__media { aspect-ratio: 21 / 9; }
  .story--lead .story__body {
    position: absolute; inset: auto 0 0 0;
    background: linear-gradient(to top, rgba(9, 17, 28, .95) 12%, rgba(9, 17, 28, .72) 58%, rgba(9, 17, 28, 0) 100%);
    padding: clamp(2rem, 6vw, 3.5rem) var(--pad) var(--pad);
    color: #fff;
  }
  .story--lead .story__title a { color: #fff; }
  .story--lead .story__blurb { color: rgba(255, 255, 255, .82); max-width: 62ch; }
  .story--lead .byline { color: rgba(255, 255, 255, .7); }
  .story--lead:hover .story__title a { color: #fff; background-size: 100% 1px; }

  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; gap: var(--section); }
  .block__grid { grid-template-columns: 1.3fr 1fr; }
  .article__hero img { aspect-ratio: 2 / 1; }
}

/* =========================================================
   ≥ 900px — three-up grid, lead becomes hero + column
   ========================================================= */
@media (min-width: 900px) {
  .grid--stories { grid-template-columns: repeat(3, 1fr); }

  /* Hero and its two runners-up share one baseline. The hero's 4:3 ratio
     sets the floor; whichever column is taller, the image stretches to fill
     it so no card background is ever left showing under the gradient. */
  .lead { grid-template-columns: 1.85fr 1fr; align-items: stretch; }
  .lead__side { grid-template-columns: 1fr; grid-template-rows: repeat(2, 1fr); gap: var(--gap); }
  .story--side {
    grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto;
    padding: 0; border: 0; background: none; min-height: 0;
  }
  .story--side .story__media { aspect-ratio: auto; min-height: 0; }
  .story--side .story__media img { height: 100%; }

  .story--lead { grid-template-rows: minmax(0, 1fr); }
  .story--lead .story__media { aspect-ratio: 4 / 3; height: 100%; min-height: 0; }
}

/* =========================================================
   ≥ 1024px — nav goes horizontal, rail sits beside the river
   ========================================================= */
@media (min-width: 1024px) {
  .masthead__inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav search";
    gap: 24px;
    min-height: 76px;
  }
  .menu-toggle { display: none; }
  .wordmark { grid-area: brand; justify-self: start; text-align: left; }

  .site-nav {
    grid-area: nav;
    position: static; width: auto; transform: none; box-shadow: none;
    border: 0; background: none; overflow: visible;
    flex-direction: row; align-items: center; justify-content: center;
    padding: 0;
  }
  .site-nav__head, .site-nav__search { display: none; }
  .site-nav__list {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 2px; padding: 0;
  }
  .site-nav__list a {
    padding: 8px 12px; border-left: 0; border-radius: var(--radius-s);
    font-size: var(--step-0); font-weight: 600;
    position: relative;
  }
  .site-nav__list a .dot { display: none; }
  .site-nav__list a::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px;
    height: 2px; background: var(--red);
    transform: scaleX(0); transform-origin: left;
    transition: transform var(--ease);
  }
  .site-nav__list a:hover { background: none; color: var(--red); }
  .site-nav__list a:hover::after,
  .site-nav__list a.is-current::after { transform: scaleX(1); }

  .searchbox {
    grid-area: search;
    display: flex; align-items: center;
    border: 1px solid var(--line-2); border-radius: var(--radius-s);
    background: var(--canvas);
    transition: border-color var(--ease), background var(--ease);
  }
  .searchbox:focus-within { border-color: var(--red); background: var(--paper); }
  .searchbox input {
    width: 170px; border: 0; background: none; outline: none;
    padding: 9px 12px; font-size: var(--step-0);
  }
  .searchbox button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: 0; border-radius: 0 2px 2px 0;
    background: var(--red); color: #fff; cursor: pointer;
    transition: background var(--ease);
  }
  .searchbox button:hover { background: var(--red-dark); }
  .nav-scrim { display: none; }

  .split { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--section); }
  .rail { position: sticky; top: calc(var(--header-h) + 20px); }
}

@media (min-width: 1200px) {
  .searchbox input { width: 210px; }
  .split { grid-template-columns: minmax(0, 1fr) 340px; }
}

/* ── Motion & print ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .ticker__inner { animation: none; }
}

@media print {
  .topbar, .masthead, .ticker, .rail, .share, .pagination, .site-footer { display: none !important; }
  body { background: #fff; }
  .article__body { font-size: 11pt; }
}

/* ── Auto-rotated Live News strip ───────────────────────── */
.live-news { margin: 0 0 var(--section); }
.live-news__rule { --rule: var(--red); }
.live-news__rule .rule__title { display: inline-flex; align-items: center; gap: 8px; }
.live-news__pulse {
  width: 8px; height: 8px; border-radius: 999px; background: var(--red);
  box-shadow: 0 0 0 0 rgba(214, 40, 40, .45); animation: live-news-pulse 1.8s infinite;
}
.live-news__grid { display: grid; gap: 12px; }
.live-news__grid .story--row { padding: 12px 0; border-bottom: 1px solid var(--line); }
@keyframes live-news-pulse { 70% { box-shadow: 0 0 0 7px rgba(214, 40, 40, 0); } 100% { box-shadow: 0 0 0 0 rgba(214, 40, 40, 0); } }
@media (min-width: 700px) {
  .live-news__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); }
}
@media (prefers-reduced-motion: reduce) { .live-news__pulse { animation: none; } }

/* ── Brand logo ─────────────────────────────────────────── */
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-width: 0;
}
.brand-logo img {
  width: auto;
  height: 38px;
  max-width: min(58vw, 240px);
  object-fit: contain;
  background: transparent;
}
.brand-logo--footer {
  justify-content: flex-start;
  margin-bottom: 10px;
}
.brand-logo--footer img {
  height: 42px;
  max-width: 250px;
}
@media (min-width: 760px) {
  .brand-logo img { height: 42px; max-width: 260px; }
}
