/* ==========================================================================
   O3Naija News 2.0
   Tokens > base > layout > header > cards > ads > article > comments > footer
   Type: Newsreader (headlines, article text) + Public Sans (interface)
   Colour: ink on white, one brand green, red reserved for "Breaking"
   ========================================================================== */

:root {
  --ink: #161c19;
  --ink-2: #39433e;
  --muted: #5d6762;
  --rule: #d8ddd9;
  --field: #7d8780;
  --paper: #ffffff;
  --tint: #f2f5f2;
  --brand: #0b7a3b;
  --brand-dark: #085c2c;
  --brand-tint: #e7f3ec;
  --alert: #c8102e;

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  --wrap: 1200px;
  --gutter: 20px;
  --header-h: 64px;
  --radius: 4px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video, iframe { max-width: 100%; }
img { display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

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

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; margin: 0; padding: 12px 16px; clip: auto; clip-path: none; background: var(--ink); color: #fff; z-index: 1000; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: calc(760px + var(--gutter) * 2); }

/* ---------- Buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border: 1px solid transparent; border-radius: var(--radius); font: 600 15px/1 var(--sans); transition: background-color .15s, color .15s, border-color .15s; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }

.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink); }
.icon-btn:hover { background: var(--tint); }

.search-form { display: flex; background: #fff; border: 1px solid var(--field); border-radius: var(--radius); }
.search-form:focus-within { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-tint); }
.search-form__input { flex: 1; min-width: 0; padding: 12px 14px; border: 0; background: transparent; font: 400 16px/1.2 var(--sans); color: var(--ink); outline: none; }
.search-form__btn { display: grid; place-items: center; width: 48px; border: 0; background: none; color: var(--ink); }
.search-form__btn:hover { color: var(--brand); }

/* ---------- Top strip: date, breaking, utility links ---------- */
.utility { background: var(--tint); border-top: 3px solid var(--brand); font-size: 13px; }
.utility__inner { display: flex; align-items: center; gap: 24px; min-height: 36px; }
.utility__date { color: var(--muted); white-space: nowrap; }
.utility__links { display: flex; gap: 20px; margin-left: auto; color: var(--ink-2); font-weight: 500; }
.utility-menu { display: flex; gap: 20px; }
.utility__links a:hover { color: var(--brand); text-decoration: underline; }

.breaking { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.breaking__label { flex: none; padding: 2px 8px; border-radius: 2px; background: var(--alert); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.5; }
.breaking__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
a.breaking__text:hover { text-decoration: underline; }

/* ---------- Header and navigation ---------- */
.site-header { position: sticky; top: 0; z-index: 90; background: #fff; border-bottom: 1px solid var(--rule); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.header__inner { display: flex; align-items: center; gap: 32px; height: var(--header-h); }
.site-brand { flex: none; }
.site-brand img, .site-brand .custom-logo { height: 44px; width: auto; max-width: none; }
.site-brand__link, .site-brand .custom-logo-link { display: block; line-height: 0; }

.primary-nav { flex: 1; min-width: 0; height: 100%; }
.primary-menu { display: flex; flex-wrap: nowrap; height: 100%; }
.primary-menu > li { position: relative; flex: none; }
.primary-menu > li > a, .primary-menu > li > button {
  display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 13px; border: 0; background: none;
  font: 600 15px/1 var(--sans); color: var(--ink); white-space: nowrap;
}
.primary-menu > li > a:hover, .primary-menu > li > button:hover,
.primary-menu > li:focus-within > a,
.primary-menu > .current-menu-item > a, .primary-menu > .current-menu-ancestor > a, .primary-menu > .current-category-ancestor > a {
  color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand);
}
.primary-menu .menu-item-has-children > a::after,
.menu-item-more > button::after { content: ''; width: 6px; height: 6px; margin-top: -3px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.primary-menu .sub-menu {
  position: absolute; top: 100%; left: 0; z-index: 95; display: none; min-width: 230px; padding: 6px 0;
  background: #fff; border: 1px solid var(--rule); border-top: 3px solid var(--brand); box-shadow: 0 14px 30px rgba(22, 28, 25, .14);
}
.primary-menu li:hover > .sub-menu, .primary-menu li:focus-within > .sub-menu { display: block; }
.primary-menu .sub-menu a { display: block; padding: 10px 18px; font: 500 15px/1.3 var(--sans); }
.primary-menu .sub-menu a:hover { background: var(--tint); color: var(--brand); }
.primary-menu .sub-menu .sub-menu { position: static; display: block; min-width: 0; padding: 0 0 0 14px; border: 0; box-shadow: none; }
.menu-item-more > .sub-menu { left: auto; right: 0; }

.header__tools { display: flex; gap: 4px; margin-left: auto; }
.menu-toggle { display: none; }

.search-panel { position: absolute; top: 100%; left: 0; right: 0; padding: 16px 0; background: #fff; border-bottom: 1px solid var(--rule); box-shadow: 0 14px 30px rgba(22, 28, 25, .1); }

/* ---------- Mobile drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 200; visibility: hidden; pointer-events: none; transition: visibility 0s linear .25s; }
.drawer.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(10, 20, 15, .55); opacity: 0; transition: opacity .25s; }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(88vw, 360px); padding: 0 20px 32px; overflow-y: auto; background: #fff; transform: translateX(100%); transition: transform .25s ease; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.drawer__title { font: 700 18px/1 var(--serif); }
.drawer .search-form { margin: 4px 0 8px; }
.drawer-menu > li > a { display: block; padding: 14px 0; border-bottom: 1px solid var(--rule); font: 600 18px/1.3 var(--sans); }
.drawer-menu .sub-menu a { display: block; padding: 10px 0 10px 16px; border-bottom: 1px solid var(--rule); font: 400 16px/1.3 var(--sans); color: var(--ink-2); }
.drawer-menu .current-menu-item > a { color: var(--brand); }
.drawer-secondary { margin-top: 24px; }
.drawer-secondary__list { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--muted); }
body.has-drawer { overflow: hidden; }

/* ---------- Page layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding-top: 32px; padding-bottom: 64px; align-items: stretch; }
.layout--article { grid-template-columns: minmax(0, 720px) 300px; justify-content: center; }
.layout__main { min-width: 0; }
.sidebar { min-width: 0; }
.page-main { padding: 32px 0 64px; }

/* ---------- Section heading, kicker, meta ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 4px; padding-top: 12px; border-top: 3px solid var(--ink); }
.section-head__title { font: 700 24px/1.2 var(--serif); }
.section-head__title a:hover { color: var(--brand); }
.section-head__more { font: 600 14px/1.2 var(--sans); color: var(--brand); white-space: nowrap; }
.section-head__more:hover { text-decoration: underline; }

.kicker { display: inline-block; margin-bottom: 6px; font: 700 14px/1.2 var(--sans); color: var(--brand); }
.kicker:hover { text-decoration: underline; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 8px; font: 400 13px/1.3 var(--sans); color: var(--muted); }
.meta__author { color: var(--ink); font-weight: 600; }

/* ---------- Cards ---------- */
.card__media { display: block; overflow: hidden; background: var(--tint); aspect-ratio: 16 / 9; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__title { font-family: var(--serif); font-weight: 600; letter-spacing: -.005em; }
.card__title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .2s; }
.card__title a:hover { background-size: 100% 1px; }
.card__dek { margin-top: 8px; font: 400 16px/1.5 var(--serif); color: var(--ink-2); }

.card--lead .card__media { margin-bottom: 16px; }
.card--lead .card__title { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.12; font-weight: 700; letter-spacing: -.012em; }
.card--lead .card__dek { margin-top: 12px; font-size: 20px; line-height: 1.45; }

.card--standard .card__media { margin-bottom: 12px; }
.card--standard .card__title { font-size: 21px; line-height: 1.22; }

.card--row { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: start; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.card--row.card--noimg { grid-template-columns: minmax(0, 1fr); }
.card--row .card__title { font-size: 22px; line-height: 1.22; }
.card--row .card__dek { font-size: 16px; }

.card--compact { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.card--compact:last-child { border-bottom: 0; }
.card--compact .card__title { font-size: 19px; line-height: 1.25; }

.feed > .card--row:first-child { padding-top: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 16px; }

/* ---------- Home: top stories ---------- */
.top-stories { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 40px; padding-top: 32px; padding-bottom: 8px; }
.top-stories__rail { padding-left: 40px; border-left: 1px solid var(--rule); }
.top-stories__rail .card--compact:first-child { padding-top: 0; }

/* ---------- Home: section blocks ---------- */
.section-block { margin-top: 48px; }
.section-block__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; margin-top: 16px; }
.section-block__list .card--compact:first-child { padding-top: 0; }

/* ---------- Sidebar ---------- */
.rail-block + .rail-block { margin-top: 32px; }
.rail-block__title { margin-bottom: 4px; padding-top: 12px; border-top: 3px solid var(--ink); font: 700 22px/1.2 var(--serif); }
.most-read__item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.most-read__item:last-child { border-bottom: 0; }
.most-read__rank { flex: none; width: 24px; font: 700 28px/1 var(--serif); color: var(--brand); }
.most-read__title { font: 600 17px/1.3 var(--serif); }
.most-read__title:hover { color: var(--brand); text-decoration: underline; }

/* ---------- Advertising (rules live in inc/ads.php) ---------- */
.ad { margin: 32px 0; text-align: center; clear: both; }
.ad__label { margin: 0 0 6px; font: 500 12px/1 var(--sans); color: var(--muted); }
.ad__body { min-height: 250px; background: var(--tint); }
.ad .adsbygoogle { width: 100%; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad--article_1 .ad__body, .ad--article_2 .ad__body { min-height: 280px; }
.ad--sidebar { position: sticky; top: calc(var(--header-h) + 24px); margin: 32px 0 0; }
.admin-bar .ad--sidebar { top: calc(var(--header-h) + 56px); }
.ad--sidebar .ad__body { min-height: 600px; }
.feed > .ad { margin: 24px 0; }

/* ---------- Newsletter ---------- */
.newsletter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 32px; align-items: center; margin: 48px 0; padding: 28px; background: var(--brand-tint); border-top: 3px solid var(--brand); }
.newsletter__title { font: 700 24px/1.2 var(--serif); }
.newsletter__blurb { margin-top: 6px; color: var(--ink-2); }
.newsletter__form { display: flex; flex-wrap: wrap; gap: 8px; }
.newsletter__input { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 1px solid var(--field); border-radius: var(--radius); background: #fff; font: 400 16px/1 var(--sans); color: var(--ink); }
.newsletter__input:focus { outline: 3px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.newsletter__msg { flex-basis: 100%; font-size: 14px; font-weight: 600; color: var(--brand-dark); }
.newsletter__msg.is-error { color: var(--alert); }

/* ---------- Article ---------- */
.article__header { padding-bottom: 4px; }
.article__title { margin: 4px 0 14px; font: 700 clamp(30px, 4.6vw, 46px)/1.1 var(--serif); letter-spacing: -.015em; }
.article__dek { margin-bottom: 20px; font: 400 clamp(19px, 2.3vw, 22px)/1.4 var(--serif); color: var(--ink-2); }

.byline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font: 400 14px/1.4 var(--sans); color: var(--muted); }
.byline__author { color: var(--ink); font-weight: 600; }
.byline__author a:hover { color: var(--brand); text-decoration: underline; }
.byline__updated { margin-left: 12px; }
.byline__read { margin-left: auto; }

.article__figure { margin: 24px 0; }
.article__figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article__figure figcaption, .entry-content figcaption, .wp-caption-text { padding-top: 8px; font: 400 13px/1.4 var(--sans); color: var(--muted); }

.entry-content { font: 400 19px/1.7 var(--serif); color: var(--ink); overflow-wrap: break-word; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2 { margin-top: 1.8em; font: 700 28px/1.2 var(--serif); letter-spacing: -.01em; }
.entry-content h3 { margin-top: 1.6em; font: 700 22px/1.25 var(--serif); }
.entry-content h4 { margin-top: 1.4em; font: 700 18px/1.3 var(--sans); }
.entry-content a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry-content a:hover { color: var(--brand-dark); text-decoration-thickness: 2px; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li + li { margin-top: .4em; }
.entry-content blockquote { padding-left: 20px; border-left: 4px solid var(--brand); font-style: italic; color: var(--ink-2); }
.entry-content blockquote cite { display: block; margin-top: .5em; font: 600 14px/1.4 var(--sans); font-style: normal; color: var(--muted); }
.entry-content figure, .entry-content .wp-caption { margin: 1.6em 0; max-width: 100%; }
.entry-content img { max-width: 100%; height: auto; }
.entry-content iframe, .entry-content video, .entry-content embed { max-width: 100%; }
.entry-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font: 400 16px/1.4 var(--sans); }
.entry-content th, .entry-content td { padding: 10px 12px; border: 1px solid var(--rule); text-align: left; }
.entry-content th { background: var(--tint); }
.entry-content hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.entry-content .alignleft { float: left; margin: .3em 1.4em 1em 0; }
.entry-content .alignright { float: right; margin: .3em 0 1em 1.4em; }
.entry-content .aligncenter { margin-left: auto; margin-right: auto; }
.page-links { margin-top: 1.5em; font: 600 15px/1 var(--sans); }

.article__footer { margin-top: 32px; }
.topics, .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 7px 14px; border: 1px solid var(--rule); border-radius: 999px; font: 500 14px/1.2 var(--sans); color: var(--ink-2); transition: border-color .15s, color .15s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chips--center { justify-content: center; margin-top: 16px; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.share__label { margin-right: 8px; font: 700 15px/1 var(--sans); }
.share__btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--field); border-radius: var(--radius); background: #fff; font: 600 14px/1 var(--sans); color: var(--ink); }
.share__btn:hover { border-color: var(--brand); color: var(--brand); }

.author-box { display: flex; gap: 16px; align-items: flex-start; margin-top: 28px; }
.author-box__avatar { border-radius: 50%; }
.author-box__name { font: 700 18px/1.3 var(--serif); }
.author-box__name:hover { color: var(--brand); }
.author-box__bio { margin-top: 4px; font-size: 15px; color: var(--ink-2); }

.related { margin-top: 48px; }
.read-progress { position: fixed; top: 0; left: 0; z-index: 120; width: 100%; height: 3px; background: var(--brand); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }
.admin-bar .read-progress { top: 32px; }

/* ---------- Archive, search, empty states, pagination ---------- */
.archive-head { padding-bottom: 16px; margin-bottom: 4px; border-bottom: 3px solid var(--ink); }
.archive-head__parent { margin-bottom: 4px; font: 600 14px/1.2 var(--sans); }
.archive-head__parent a { color: var(--brand); }
.archive-head__parent a:hover { text-decoration: underline; }
.archive-head__title { font: 700 clamp(32px, 4.4vw, 44px)/1.1 var(--serif); letter-spacing: -.015em; }
.archive-head__desc { margin-top: 10px; max-width: 62ch; font: 400 18px/1.5 var(--serif); color: var(--ink-2); }
.archive-head .chips { margin-top: 16px; }
.archive-head .search-form { margin-top: 16px; max-width: 520px; }
.archive-head__author { display: flex; gap: 20px; align-items: center; }
.archive-head__avatar { border-radius: 50%; }

.feed + .pagination, .grid-3 + .pagination { margin-top: 32px; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 32px; font: 600 15px/1 var(--sans); }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px; border: 1px solid var(--rule); border-radius: var(--radius); }
.pagination a.page-numbers:hover { border-color: var(--brand); color: var(--brand); }
.pagination .current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination .dots { border-color: transparent; }

.empty { max-width: 560px; margin: 48px auto; text-align: center; color: var(--ink-2); }
.empty__title { margin-bottom: 8px; font: 700 28px/1.2 var(--serif); color: var(--ink); }
.empty .btn { margin-top: 16px; }
.more-wrap { margin-top: 48px; text-align: center; }

/* ---------- Comments ---------- */
.comments { margin-top: 56px; padding-top: 12px; border-top: 3px solid var(--ink); }
.comments__title { margin-bottom: 8px; font: 700 24px/1.2 var(--serif); }
.comment-list { margin-bottom: 32px; }
.comment-list .children { margin-left: 28px; padding-left: 20px; border-left: 2px solid var(--rule); }
.comment-body { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.comment-avatar img { border-radius: 50%; }
.comment-main { min-width: 0; flex: 1; }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.comment-author { font: 700 15px/1.3 var(--sans); }
.comment-badge { padding: 1px 8px; border-radius: 2px; background: var(--brand-tint); color: var(--brand-dark); font: 700 12px/1.6 var(--sans); }
.comment-time { font: 400 13px/1.3 var(--sans); color: var(--muted); }
.comment-pending { margin-top: 6px; font: 600 14px/1.4 var(--sans); color: var(--muted); }
.comment-text { margin-top: 6px; font: 400 16px/1.6 var(--sans); overflow-wrap: anywhere; }
.comment-text > * + * { margin-top: .7em; }
.comment-actions { margin-top: 8px; font: 600 14px/1 var(--sans); }
.comment-actions a { color: var(--brand); }
.comment-actions a:hover { text-decoration: underline; }
.comments__closed { margin: 16px 0; color: var(--muted); }

.comment-reply-title { margin-bottom: 12px; font: 700 20px/1.2 var(--serif); }
.comment-reply-title small { margin-left: 12px; font: 600 14px/1 var(--sans); }
.comment-form p { margin-bottom: 16px; }
.comment-form label { display: block; margin-bottom: 6px; font: 600 14px/1.3 var(--sans); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--field); border-radius: var(--radius); background: #fff; font: 400 16px/1.5 var(--sans); color: var(--ink); }
.comment-form input:focus, .comment-form textarea:focus { outline: 3px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.comment-form-cookies-consent { display: flex; gap: 10px; align-items: flex-start; }
.comment-form-cookies-consent label { margin: 0; font-weight: 400; }
.comment-notes, .logged-in-as { font: 400 14px/1.5 var(--sans); color: var(--muted); }
.comment-navigation, .comments-pagination { margin-bottom: 24px; font: 600 14px/1 var(--sans); }
.comment-navigation .nav-links { display: flex; justify-content: space-between; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 32px; background: var(--tint); border-top: 3px solid var(--ink); }
.footer__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: 40px; padding-top: 40px; padding-bottom: 40px; }
.footer__logo img, .footer__logo .custom-logo { height: 44px; width: auto; }
.footer__logo a { display: block; line-height: 0; }
.footer__desc { max-width: 44ch; margin-top: 14px; color: var(--ink-2); }
.footer__social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.social-link { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--field); border-radius: 50%; color: var(--ink); background: #fff; }
.social-link:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.footer__heading { margin-bottom: 12px; font: 700 16px/1.2 var(--serif); }
.footer__links li + li { margin-top: 8px; }
.footer__links a { font-size: 15px; color: var(--ink-2); }
.footer__links a:hover { color: var(--brand); text-decoration: underline; }
.footer__base { border-top: 1px solid var(--rule); }
.footer__base-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 16px; padding-bottom: 16px; font-size: 14px; color: var(--muted); }
.footer__legal-list { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer__legal-list a:hover { color: var(--brand); text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .layout { gap: 36px; }
}

@media (max-width: 999px) {
  .layout, .layout--article { grid-template-columns: minmax(0, 1fr); }
  .layout--article .layout__main, .layout--article .sidebar { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; }
  .ad--sidebar { display: none; }
  .sidebar { margin-top: 8px; }
  .top-stories { grid-template-columns: minmax(0, 1fr); }
  .top-stories__rail { margin-top: 24px; padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); padding-top: 16px; }
  .top-stories__rail .card--compact:first-child { padding-top: 16px; }
}

@media (max-width: 959px) {
  :root { --header-h: 56px; }
  .primary-nav { display: none; }
  .menu-toggle { display: inline-grid; }
  .header__inner { gap: 12px; }
  .site-brand { flex: 1; }
  .site-brand img, .site-brand .custom-logo { height: 36px; }
  .header__tools { margin-left: 0; }
}

@media (max-width: 759px) {
  .utility__links { display: none; }
  .utility--has-breaking .utility__date { display: none; }
  .section-block__grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .section-block__list .card--compact:first-child { padding-top: 16px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer__about { grid-column: 1 / -1; }
  .newsletter { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; margin: 36px 0; }
}

@media (max-width: 599px) {
  :root { --gutter: 16px; }
  .card--row { grid-template-columns: minmax(0, 1fr) 112px; gap: 14px; padding: 16px 0; }
  .card--row .card__title { font-size: 18px; }
  .card--row .card__dek { display: none; }
  .card--row.card--noimg .card__dek { display: block; }
  .card--lead .card__dek { font-size: 18px; }
  .section-head__title { font-size: 22px; }
  .entry-content { font-size: 18px; line-height: 1.65; }
  .entry-content h2 { font-size: 24px; }
  .byline__read { margin-left: 0; }
  .share__label { flex-basis: 100%; margin: 0 0 4px; }
  .newsletter__form .btn { flex: 1 1 100%; }
  .comment-list .children { margin-left: 10px; padding-left: 12px; }
}

/* ---------- Motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .utility, .site-header, .drawer, .sidebar, .ad, .newsletter, .share, .related, .comments, .site-footer, .read-progress, .skip-link { display: none !important; }
  .layout, .layout--article { display: block; padding: 0; }
  .entry-content { font-size: 12pt; }
  .entry-content a { color: inherit; text-decoration: underline; }
}
