/* ==========================================================================
   News Portal - front-end theme
   --------------------------------------------------------------------------
   Design tokens live in :root. The accent colour is injected from the admin
   settings in templates/header.php, so re-branding needs no CSS edits.
   ========================================================================== */

:root {
  /* Colour - brand palette: amber #ffaa17, black #111111, white, grey #F5F5F5.
     --accent      fills (buttons, ticker, badges)
     --accent-ink  text drawn ON an accent fill
     --accent-text accent used AS text on a page background, darkened for
                   contrast: the raw amber scores 1.9:1 on white, the tint 4.9:1. */
  --accent: #ffaa17;
  --accent-ink: #111111;
  --accent-text: #99660e;
  --bg: #ffffff;
  --bg-soft: #f5f5f5;
  --bg-sunken: #ebebeb;
  --ink: #111111;
  --ink-2: #3f444c;
  --muted: #6b7280;
  --line: #e5e5e5;
  --line-strong: #d4d4d4;

  /* Type */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Newsreader", Georgia, "Times New Roman", serif;

  /* Space + shape */
  --container: 1240px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(16, 18, 22, .05), 0 8px 24px rgba(16, 18, 22, .06);
  --gap: 28px;
}

/* Derive the readable tint from whatever accent the admin picks, where the
   browser supports it; the literal above is the fallback. */
@supports (color: color-mix(in srgb, red, blue)) {
  :root { --accent-text: color-mix(in srgb, var(--accent) 60%, #000); }
}

/* --------------------------------------------------------------------------
   Dark theme
   --------------------------------------------------------------------------
   Three states, not two:
     - reader has chosen nothing  -> follow the operating system
     - reader picked Light        -> data-theme="light" wins over a dark OS
     - reader picked Dark         -> data-theme="dark" wins over a light OS
   The choice is written to <html data-theme="..."> before first paint, so the
   page never flashes the wrong theme.
   -------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent-text: #ffbb45;
    --bg: #0f1115;
    --bg-soft: #161920;
    --bg-sunken: #1c1f27;
    --ink: #ecedee;
    --ink-2: #c3c7ce;
    --muted: #949aa5;
    --line: #262a33;
    --line-strong: #333843;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  }

  @supports (color: color-mix(in srgb, red, blue)) {
    :root:not([data-theme="light"]) { --accent-text: color-mix(in srgb, var(--accent) 82%, #fff); }
  }
}

:root[data-theme="dark"] {
  --accent-text: #ffbb45;
  --bg: #0f1115;
  --bg-soft: #161920;
  --bg-sunken: #1c1f27;
  --ink: #ecedee;
  --ink-2: #c3c7ce;
  --muted: #949aa5;
  --line: #262a33;
  --line-strong: #333843;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
}

@supports (color: color-mix(in srgb, red, blue)) {
  :root[data-theme="dark"] { --accent-text: color-mix(in srgb, var(--accent) 82%, #fff); }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-text); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.18; letter-spacing: -.015em; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Buttons, alerts, forms
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: transparent; color: var(--ink);
  font: 600 14px/1 var(--font-ui); cursor: pointer; transition: .15s ease;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(.9); color: var(--accent-ink); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.alert {
  padding: 12px 16px; border-radius: var(--radius); margin: 20px 0;
  font-size: 14.5px; border: 1px solid var(--line);
  background: var(--bg-soft);
}
.alert-success { border-color: #b9e6c8; background: #f0fdf4; color: #14532d; }
.alert-error   { border-color: #f3c2c2; background: #fef2f2; color: #7f1d1d; }
.alert-warning { border-color: #f5dfa8; background: #fffbeb; color: #713f12; }

input[type=text], input[type=email], input[type=search], input[type=password], input[type=url], textarea, select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 14px; width: 100%;
}
input::placeholder { color: var(--muted); }

.hp-field { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; }

.form-note { font-size: 13px; margin: 8px 0 0; min-height: 18px; }
.form-note.is-ok  { color: #15803d; }
.form-note.is-bad { color: #b91c1c; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.topbar { border-bottom: 1px solid var(--line); background: var(--bg-soft); font-size: 12.5px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 38px; color: var(--muted); }
.topbar-links { display: flex; gap: 16px; }
.topbar-links a:hover { color: var(--accent-text); }

.masthead { background: var(--bg); }
.masthead-inner { display: flex; align-items: center; gap: 20px; padding: 22px 20px; }

.brand { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.brand-logo { max-height: 52px; width: auto; }
.brand-name { font-family: var(--font-head); font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.brand-tagline { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.brand:hover { color: inherit; }

.masthead-actions { display: flex; align-items: center; gap: 12px; }

.search-form { display: flex; align-items: center; position: relative; }
.search-form input {
  width: 220px; padding: 9px 40px 9px 14px; border-radius: 999px;
  background: var(--bg-soft); border-color: transparent; font-size: 14px;
}
.search-form input:focus { background: var(--bg); border-color: var(--line-strong); }
.search-form button {
  position: absolute; right: 6px; display: grid; place-items: center;
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
}
.search-form button:hover { color: var(--accent-text); }

.search-form--big { position: static; gap: 10px; max-width: 620px; margin: 18px auto 0; }
.search-form--big input { width: 100%; padding: 14px 18px; font-size: 16px; border-color: var(--line-strong); }
.search-form--big button { position: static; width: auto; height: auto; }

.theme-toggle {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); }
.theme-toggle svg { width: 17px; height: 17px; }
/* Only the icon for the active mode is shown. */
.theme-toggle .icon-dark, .theme-toggle .icon-auto { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-light { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-dark  { display: block; }
:root[data-theme="auto"] .theme-toggle .icon-light,
:root[data-theme="auto"] .theme-toggle .icon-dark  { display: none; }
:root[data-theme="auto"] .theme-toggle .icon-auto  { display: block; }

.icon-btn {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 0 9px; border: 1px solid var(--line);
  border-radius: 8px; background: transparent; cursor: pointer;
}
.icon-btn span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }

.mainnav { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 50; }
.mainnav-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.mainnav-inner::-webkit-scrollbar { display: none; }

.nav-link {
  --cat-color: var(--accent);
  position: relative; white-space: nowrap;
  padding: 14px 14px; font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--ink); }
.nav-link.is-active::after,
.nav-link:hover::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px;
  height: 2px; background: var(--cat-color);
}

/* Breaking ticker */
.ticker { background: var(--accent); color: var(--accent-ink); overflow: hidden; }
.ticker-inner { display: flex; align-items: center; gap: 16px; height: 44px; }
.ticker-label {
  flex: none; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(0, 0, 0, .22); padding: 4px 10px; border-radius: 4px;
}
.ticker-track { display: flex; align-items: center; gap: 14px; overflow: hidden; white-space: nowrap; font-size: 14.5px; }
.ticker-track a:hover { color: var(--accent-ink); text-decoration: underline; }
.ticker-dot { opacity: .5; }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

main { padding-bottom: 24px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 44px; align-items: start; }
.layout--narrow { grid-template-columns: minmax(0, 760px); justify-content: center; }
.layout-main { min-width: 0; }

.block { margin: 44px 0; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 24px;
}
.container > .section-head:first-of-type { margin-top: 36px; }
.section-title { font-size: 24px; margin: 0; }
.section-more { font-size: 13px; font-weight: 600; color: var(--muted); }
.section-more:hover { color: var(--accent-text); }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-full { grid-column: 1 / -1; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.section-head + .hero { padding-top: 4px; }
.hero {
  display: grid; gap: var(--gap); padding: 36px 0 8px;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, .8fr);
}
.hero--cols-1 { grid-template-columns: minmax(0, 1fr); }
.hero--cols-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
/* The columns beside the lead spread their cards over the full height rather
   than bunching at the top and leaving a block of white below. The gap is the
   minimum, so with a well-matched number of stories nothing visibly stretches;
   it only opens up when a column is genuinely short. */
.hero-side { display: grid; gap: 22px; align-content: space-between; }
.hero-list { border-left: 1px solid var(--line); padding-left: 24px; }
.hero-list .hl-list { display: grid; align-content: space-between; height: calc(100% - 34px); }
/* A lone second story fills the column rather than floating at the top. */
.hero-side--solo { align-content: start; }
.hero-side--solo .card--wide .card-media img { aspect-ratio: 4 / 3; max-height: 300px; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.card-media { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--bg-sunken); }
.card-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.03); }

.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 4px; background: var(--accent); color: var(--accent-ink);
}

.card-body { display: flex; flex-direction: column; gap: 8px; }

.kicker {
  --cat-color: var(--accent-text);
  align-self: flex-start;
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cat-color);
}
.kicker:hover { opacity: .75; color: var(--cat-color); }

.card-title { font-size: 20px; margin: 0; }
.card-title a { background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .3s; }
.card-title a:hover { background-size: 100% 1px; }

.card-excerpt { color: var(--ink-2); font-size: 14.5px; margin: 0; }

.card-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--muted); margin: 0; }
.meta-author { font-weight: 600; color: var(--ink-2); }

/* Lead card */
.card--lead .card-media img { aspect-ratio: 3 / 2; max-height: 520px; }
/* A single featured story runs the full width, so it gets a cinematic crop
   instead of a very tall one. */
.hero--cols-1 .card--lead .card-media img { aspect-ratio: 21 / 9; max-height: 420px; }
.hero--cols-1 .card--lead .card-body { max-width: 70ch; }
/* In a two-column hero the lead column is wide, so a 16:9 crop alone still
   produces a 400px-tall image and a lead card far deeper than the stack of
   cards beside it. The cap keeps the two columns level. */
.hero--cols-2 .card--lead .card-media img { aspect-ratio: 16 / 9; max-height: 340px; }
.hero--cols-3 .card--lead .card-media img { max-height: 330px; }
.card--lead .card-title { font-size: clamp(28px, 3.4vw, 42px); }
.card--lead .card-excerpt { font-size: 16.5px; }

/* Wide card */
.card--wide .card-title { font-size: 24px; }

/* Compact card: image beside the headline */
.card--compact { flex-direction: row; gap: 14px; align-items: flex-start; }
.card--compact .card-media { flex: 0 0 116px; }
.card--compact .card-media img { aspect-ratio: 4 / 3; }
.card--compact .card-title { font-size: 16.5px; }

/* Headline lists */
.hl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hl-item { display: flex; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.hl-item:last-child { border-bottom: 0; padding-bottom: 0; }
.hl-rank { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--accent-text); line-height: 1.1; min-width: 22px; }
.hl-title { font-family: var(--font-head); font-size: 16.5px; font-weight: 600; line-height: 1.3; display: block; }
.hl-meta { font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.sidebar { display: grid; gap: 28px; align-content: start; padding-top: 44px; }

.widget { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; background: var(--bg); }
.widget-title {
  font-family: var(--font-ui); font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.widget-text { font-size: 14px; color: var(--ink-2); }
.widget--newsletter { background: var(--bg-soft); }

.cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cat-list a {
  --cat-color: var(--accent-text);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 0; font-size: 14.5px; font-weight: 500; border-bottom: 1px solid var(--line);
}
.cat-list li:last-child a { border-bottom: 0; }
.cat-list a:hover { color: var(--cat-color); }
.cat-count { font-size: 12px; color: var(--muted); background: var(--bg-sunken); border-radius: 999px; padding: 2px 9px; }

.sidebar-sticky { position: sticky; top: 80px; }

/* --------------------------------------------------------------------------
   Ads
   -------------------------------------------------------------------------- */

.promo-unit {
  margin: 28px 0; padding: 12px; text-align: center;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
}
.promo-tag {
  display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.promo-inner { display: flex; justify-content: center; }
/* Keep an oversized banner from taking over the page: each slot caps its height
   and the image scales down proportionally. */
.promo-inner img { border-radius: 6px; width: auto; max-width: 100%; max-height: 320px; object-fit: contain; }
.promo-unit--header_top .promo-inner img,
.promo-unit--below_header .promo-inner img,
.promo-unit--footer .promo-inner img { max-height: 130px; }
.promo-unit--sidebar_top .promo-inner img,
.promo-unit--sidebar_mid .promo-inner img,
.promo-unit--sidebar_sticky .promo-inner img { max-height: 620px; }
.promo-unit--header_top { margin: 0; border-radius: 0; border-width: 0 0 1px; }
.promo-unit--sidebar_top, .promo-unit--sidebar_mid, .promo-unit--sidebar_sticky { margin: 0; }
.promo-unit--article_middle { margin: 34px 0; }

/* --------------------------------------------------------------------------
   Archives
   -------------------------------------------------------------------------- */

.archive-head { --cat-color: var(--accent-text); padding: 40px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.archive-eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cat-color); margin: 0 0 6px; }
.archive-head h1 { font-size: clamp(30px, 4vw, 44px); margin: 0 0 8px; }
.archive-desc { color: var(--ink-2); max-width: 62ch; margin: 0 0 6px; }
.archive-count { font-size: 13px; color: var(--muted); margin: 0; }
.author-head { display: flex; gap: 24px; align-items: center; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h1, .empty-state h2 { color: var(--ink); }
.empty-state--lg { padding: 90px 20px; }
.empty-state .btn { margin-top: 18px; }

/* --------------------------------------------------------------------------
   Article
   -------------------------------------------------------------------------- */

.story { padding: 32px 0 8px; max-width: 780px; }
.story--page { max-width: none; }

.breadcrumb { display: flex; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--accent-text); }

.story-head { margin-bottom: 26px; }
.story-title { font-size: clamp(32px, 4.6vw, 50px); line-height: 1.1; margin: 10px 0 14px; }
.story-standfirst { font-size: 19px; line-height: 1.5; color: var(--ink-2); font-family: var(--font-head); margin-bottom: 18px; }
.story-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13.5px; color: var(--muted); padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.story-meta a:hover { color: var(--accent-text); }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 0; font-size: 13px; }
.share-label { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; color: var(--muted); }
.share a, .share-copy {
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px;
  font: 600 12.5px/1 var(--font-ui); color: var(--ink-2); background: transparent; cursor: pointer;
}
.share a:hover, .share-copy:hover { border-color: var(--accent); color: var(--accent-text); }

.story-figure { margin: 0 0 28px; }
.story-figure img { width: 100%; border-radius: var(--radius-lg); object-fit: cover; }
.story-figure figcaption { font-size: 12.5px; color: var(--muted); padding-top: 10px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }

/* Long-form typography */
.story-body { font-size: 18px; line-height: 1.75; color: var(--ink); }
.story-body p { margin: 0 0 1.15em; }
.story-body h2 { font-size: 27px; margin: 1.8em 0 .5em; }
.story-body h3 { font-size: 22px; margin: 1.6em 0 .4em; }
.story-body a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.story-body img { border-radius: var(--radius); margin: 1.6em 0; }
.story-body figure { margin: 1.8em 0; }
.story-body figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 8px; }
.story-body ul, .story-body ol { margin: 0 0 1.3em; padding-left: 1.3em; }
.story-body li { margin-bottom: .5em; }
.story-body blockquote {
  margin: 1.8em 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--accent);
  font-family: var(--font-head); font-size: 22px; line-height: 1.45; color: var(--ink);
}
.story-body blockquote p:last-child { margin-bottom: 0; }
.story-body table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 15.5px; }
.story-body th, .story-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.story-body th { background: var(--bg-soft); }
.story-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--bg-sunken); padding: 2px 6px; border-radius: 4px; }
.story-body pre { background: var(--bg-sunken); padding: 16px; border-radius: var(--radius); overflow-x: auto; }
.story-body hr { margin: 2em 0; }

.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 32px 0 8px; }
.tag-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tag { font-size: 13px; padding: 6px 13px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); }
.tag:hover { border-color: var(--accent); color: var(--accent-text); }

.author-box {
  display: flex; gap: 18px; align-items: flex-start; margin: 40px 0;
  padding: 24px; background: var(--bg-soft); border-radius: var(--radius-lg);
}
.author-box h2 { font-size: 18px; margin: 0 0 6px; }
.author-box p { font-size: 14.5px; color: var(--ink-2); margin: 0 0 8px; }
.author-box a { font-size: 13.5px; font-weight: 600; color: var(--accent-text); }

.author-avatar {
  flex: none; width: 60px; height: 60px; border-radius: 50%; overflow: hidden;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font: 700 24px/1 var(--font-head);
}
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-avatar--lg { width: 92px; height: 92px; font-size: 36px; }

.prev-next { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 36px 0; }
.pn-item { display: grid; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.pn-item span { font-size: 12px; color: var(--muted); }
.pn-item strong { font-family: var(--font-head); font-size: 16px; font-weight: 600; }
.pn-item:hover { border-color: var(--accent); }
.pn-item--next { text-align: right; }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 40px 0 10px; }
.page-btn {
  min-width: 40px; padding: 9px 13px; text-align: center;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.page-btn:hover { border-color: var(--ink); color: var(--ink); }
.page-btn.is-current { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.page-gap { padding: 9px 4px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Newsletter band
   -------------------------------------------------------------------------- */

.newsletter {
  background: var(--bg-soft);
  border-top: 3px solid var(--accent);
  margin-top: 40px;
}
.newsletter-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 48px; align-items: center; padding: 56px 20px;
}
.newsletter-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-text); margin: 0 0 8px;
}
.newsletter-copy h2 { font-size: clamp(26px, 3vw, 34px); margin: 0 0 10px; }
.newsletter-copy p { color: var(--ink-2); margin: 0; max-width: 46ch; }
.newsletter-form { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 10px; align-items: start; }
.newsletter-form input { background: var(--bg); }
.newsletter-form .form-note { grid-column: 1 / -1; }
.newsletter-form--stack { grid-template-columns: 1fr; }

/* --------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------
   Deliberately a single dark block in both themes: it closes the page, and the
   brand's black + amber reads strongest here. Colours are literals rather than
   theme tokens for that reason.
   -------------------------------------------------------------------------- */

.site-footer {
  --f-ink: #f3f2ef;
  --f-muted: #9c9c98;
  --f-line: rgba(255, 255, 255, .13);
  background: #111111;
  color: var(--f-ink);
  padding: 56px 0 26px;
  border-top: 3px solid var(--accent);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 44px;
  padding-bottom: 40px;
}

.footer-brand .brand--footer { display: inline-block; margin-bottom: 12px; }
.footer-brand .brand-name { font-size: 27px; color: var(--f-ink); }
.footer-brand .brand-logo { max-height: 44px; }
.footer-tagline {
  font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}
.footer-about { color: var(--f-muted); font-size: 14.5px; line-height: 1.65; max-width: 38ch; margin: 0 0 20px; }

.footer-social { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-social a {
  font-size: 12.5px; font-weight: 500; color: var(--f-ink);
  border: 1px solid var(--f-line); border-radius: 999px; padding: 6px 14px;
  transition: border-color .15s ease, color .15s ease;
}
.footer-social a:hover { border-color: var(--accent); color: var(--accent); }

.footer-col h3 {
  font-family: var(--font-ui); font-size: 11px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--f-muted);
  margin: 6px 0 16px;
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; font-size: 14.5px; }
.footer-links a { color: var(--f-ink); }
.footer-links a:hover { color: var(--accent); }
/* Eight sections would run twice as tall as the other columns - split them. */
.footer-links--split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 20px; }

.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  padding-top: 22px; border-top: 1px solid var(--f-line);
  font-size: 13px; color: var(--f-muted);
}
.footer-bottom p { margin: 0; }
.footer-note { color: var(--f-muted); }
.footer-uptop { margin-left: auto; margin-right: 52px; color: var(--f-muted); font-size: 13px; }
.footer-uptop:hover { color: var(--accent); }


.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--ink); font-size: 18px; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .25s; box-shadow: var(--shadow);
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .hero-list { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; }
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { padding-top: 0; border-top: 1px solid var(--line); padding-top: 32px; }
  .footer-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
  .newsletter-inner { grid-template-columns: 1fr; gap: 26px; padding: 44px 20px; }
}

@media (max-width: 760px) {
  .topbar-date { display: none; }
  .masthead-inner { padding: 16px 20px; gap: 12px; }
  .icon-btn { display: flex; }
  .brand { align-items: center; text-align: center; margin: 0 auto; }
  .brand-name { font-size: 26px; }
  .search-form { display: none; }
  .theme-toggle { width: 36px; height: 36px; }
  .mainnav-inner { flex-direction: column; gap: 0; display: none; padding: 8px 20px 16px; }
  .mainnav-inner.is-open { display: flex; }
  .nav-link { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-link.is-active::after, .nav-link:hover::after { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 24px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .newsletter-form { grid-template-columns: 1fr; }
  .prev-next { grid-template-columns: 1fr; }
  .pn-item--next { text-align: left; }
  .story-body { font-size: 17px; }
  .author-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-top { grid-template-columns: 1fr; gap: 30px; padding-bottom: 30px; }
  .footer-brand .brand-name { font-size: 24px; }
  .site-footer { padding-top: 40px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-uptop { margin-left: 0; margin-right: 0; }
}

@media print {
  .site-header, .sidebar, .promo-unit, .newsletter, .site-footer, .share, .to-top, .ticker { display: none !important; }
  .layout { grid-template-columns: 1fr; }
  body { font-size: 12pt; }
}
