/* ============ Tokens ============ */
:root {
  --color-ink: #14202e;
  --color-heading: #14202e;
  --color-navy: #0e2a4a;
  --color-navy-deep: #081a30;
  --color-gold: #a9822f;
  --color-gold-bright: #c79b3d;
  --color-paper: #faf8f4;
  --color-paper-dim: #f2efe8;
  --color-line: #e2ddd0;
  --color-text: #1c1c1c;
  --color-text-muted: #5a5a56;
  --color-text-on-navy: #f4f1e8;
  --color-danger: #8a2a2a;
  --color-link: #0e2a4a;
  --color-sponsored: #7a5b12;
  /* Text-safe gold: #a9822f only clears WCAG AA (4.5:1) at large sizes. Kickers,
     nav labels, and widget numerals are small text and need this darker value. */
  --color-gold-text: #7a5b12;

  --font-serif: Georgia, "Times New Roman", Cambria, "Iowan Old Style", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  --container-max: 1280px;
  --radius: 2px;
  --border: 1px solid var(--color-line);
  --shadow-card: 0 1px 2px rgba(20, 32, 46, 0.06), 0 1px 1px rgba(20, 32, 46, 0.04);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-paper: #10161f;
    --color-paper-dim: #161d27;
    --color-line: #2a3341;
    --color-text: #eae7de;
    --color-text-muted: #a3a79b;
    --color-navy: #14304f;
    --color-navy-deep: #0a1826;
    --color-link: #d8c58a;
    --color-heading: #f2efe8;
    --color-gold: #c79b3d;
    --color-sponsored: #d9ae4e;
    --color-gold-text: #c79b3d;
    color-scheme: dark;
  }
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; }
/* Matches the sticky header's real height (masthead + nav row) so the
   skip-link target and in-page anchors don't land hidden underneath it. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 7rem; }
@media (max-width: 900px) {
  html { scroll-padding-top: 0; } /* header is non-sticky below 900px, see .site-header */
}
body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, picture, svg, video { max-width: 100%; display: block; }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 700; line-height: 1.15; margin: 0 0 var(--space-3); color: var(--color-heading); }
/* Headings are frequently links (headlines). Without this, dark mode's gold
   --color-link paints every headline on the page gold instead of just accents
   -- reserve gold for kickers/meta and let headlines read in the ink color. */
h1 a, h2 a, h3 a, h4 a { color: inherit; }
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover { text-decoration: underline; }
p { margin: 0 0 var(--space-4); }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }
input, select, textarea { font: inherit; }
[hidden] { display: none !important; } /* keep the hidden attribute authoritative over display rules */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ Utility ============ */
.container { max-width: var(--container-max); margin-inline: auto; padding-inline: var(--space-4); }
.visually-hidden {
  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; inset-inline-start: 0; top: -3rem; z-index: 200;
  background: var(--color-navy); color: var(--color-text-on-navy);
  padding: var(--space-3) var(--space-4); transition: top .15s ease;
}
.skip-link:focus { top: 0; }
/* --color-gold-bright is only 2.42:1 on paper (fails the 3:1 non-text-contrast
   minimum) -- var(--color-link) passes in both themes. Navy surfaces (footer,
   cookie banner) keep the brighter gold, which reads fine against navy. */
:focus-visible { outline: 2px solid var(--color-link); outline-offset: 2px; }
.site-footer :focus-visible, .cookie-banner :focus-visible {
  outline-color: var(--color-gold-bright);
}
.eyebrow {
  font-family: var(--font-sans); font-size: .72rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--color-gold-text);
}
.section-heading {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 2px solid var(--color-heading); padding-bottom: var(--space-2);
  margin-bottom: var(--space-5);
}
.section-heading h2 { margin: 0; font-size: clamp(1.3rem, 1rem + 1.2vw, 1.85rem); }
.section-heading .see-all { font-family: var(--font-sans); font-size: .85rem; font-weight: 600; white-space: nowrap; }

/* Shared page-header component for templates that only ever printed a bare,
   unsized <h1>/<p class="dek"> (country, continent, topic, search, 404) --
   without this they fell back to the browser default 2em, smaller than the
   lead story's headline below them. */
.page-header { padding-block: var(--space-4) var(--space-6); }
.page-header h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
.page-header .dek { font-size: 1.05rem; color: var(--color-text-muted); max-width: 65ch; margin-top: var(--space-2); }
.section-block { padding-block: var(--space-6); }
.section-block--tight { padding-block: var(--space-4) var(--space-7); }

/* ============ Header & Nav ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-paper); border-bottom: var(--border);
}
/* A sticky header this tall (masthead + wrapping region nav) eats a quarter
   to a third of a phone's viewport permanently. Below 900px it scrolls away
   like the rest of the page instead. */
@media (max-width: 900px) {
  .site-header { position: static; }
}
.masthead { display: flex; align-items: center; justify-content: space-between; padding-block: var(--space-4); gap: var(--space-4); }
.logo { display: flex; align-items: center; gap: var(--space-2); }
.logo-mark { width: 42px; height: 42px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text .mark { font-family: var(--font-serif); font-weight: 700; font-size: 1.7rem; letter-spacing: .04em; color: var(--color-heading); }
.logo-text .full { font-family: var(--font-sans); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--color-text-muted); margin-top: 2px; }

.masthead-actions { display: flex; align-items: center; gap: var(--space-3); }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: var(--border); background: transparent;
  border-radius: var(--radius); cursor: pointer; color: var(--color-heading);
}
.icon-button:hover { background: var(--color-paper-dim); }
/* The trigger's visible label is the raw locale code ("ZH-HANS" for
   Simplified Chinese) -- let it size to content instead of clipping out of a
   fixed 40px square. */
.lang-switcher > .icon-button { width: auto; min-width: 40px; padding-inline: var(--space-2); }

.primary-nav { border-top: var(--border); }
.primary-nav .container { display: flex; align-items: stretch; }
.primary-nav-list { display: flex; flex-wrap: wrap; }
.primary-nav-list > li { position: relative; }
.primary-nav-list > li > a {
  display: flex; align-items: center; height: 100%; padding: var(--space-3) var(--space-4); font-weight: 600; font-size: .88rem;
  letter-spacing: .02em; color: var(--color-heading); border-bottom: 2px solid transparent;
}
.primary-nav-list > li > a:hover, .primary-nav-list > li.is-open > a, .primary-nav-list > li.is-current > a {
  border-bottom-color: var(--color-gold); text-decoration: none;
}

/* Two-column dropdown anchored to its own nav item: a gold kicker + the "All
   X Markets" link on the left, a gold "All Countries" kicker + a single-column
   country list on the right -- the kickers are what make the link underneath
   them read as a distinct clickable item rather than a plain heading. Logical
   properties (inset-inline-start, not left) so it opens on the correct side
   under RTL automatically; the last item anchors from the end instead so its
   panel doesn't run past the edge of the viewport. */
.mega-menu {
  display: none; position: absolute; inset-inline-start: 0; top: 100%; min-width: 340px;
  background: var(--color-paper); border: var(--border); box-shadow: var(--shadow-card);
  padding: var(--space-6); z-index: 50;
}
.primary-nav-list > li:last-child .mega-menu { inset-inline-start: auto; inset-inline-end: 0; }
.primary-nav-list > li.is-open .mega-menu,
.primary-nav-list > li:hover .mega-menu,
.primary-nav-list > li:focus-within .mega-menu { display: block; } /* keyboard users can Tab into the dropdown */
.mega-menu-grid { display: grid; grid-template-columns: auto auto; gap: var(--space-7); }
.mega-menu-region h3 {
  font-family: var(--font-sans); font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--color-gold-text); margin-bottom: var(--space-3);
}
.mega-menu-all-link {
  display: block; font-size: .95rem; font-weight: 700; color: var(--color-heading); white-space: nowrap;
}
.mega-menu-all-link:hover { text-decoration: underline; }
.mega-menu-countries li a { display: block; padding: var(--space-1) 0; font-size: .92rem; color: var(--color-text); white-space: nowrap; }
.mega-menu-countries li a:hover { color: var(--color-heading); text-decoration: underline; }

/* Language switcher */
.lang-switcher { position: relative; }
.lang-switcher-panel {
  display: none; position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
  background: var(--color-paper); border: var(--border); box-shadow: var(--shadow-card);
  padding: var(--space-2); min-width: 200px; z-index: 60;
}
.lang-switcher.is-open .lang-switcher-panel { display: block; }
.lang-switcher-panel a {
  display: flex; justify-content: space-between; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius); color: var(--color-text); font-size: .9rem;
}
.lang-switcher-panel a:hover { background: var(--color-paper-dim); text-decoration: none; }
.lang-switcher-panel a[aria-current="true"] { font-weight: 700; color: var(--color-heading); }

/* Mobile nav: no hamburger -- the region bar stays visible and wraps, and the
   hover mega-menu (no-op on touch) is hidden so a tap always just navigates.
   The header itself un-sticks below (see .site-header), which is what
   actually keeps this from eating the screen on a phone. */
@media (max-width: 900px) {
  .primary-nav-list > li:hover .mega-menu,
  .primary-nav-list > li:focus-within .mega-menu { display: none; }
  .primary-nav-list > li > a { padding: var(--space-2) var(--space-3); font-size: .82rem; min-height: 44px; }
}

/* ============ Hero / Featured ============ */
.hero { padding-block: var(--space-6); }
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--space-6); }
.hero-lead { position: relative; }
/* Media now follows the headline/dek (see home.njk) rather than leading them,
   so the lead's own headline is what a reader sees first, not a bare photo. */
.hero-lead .media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--color-paper-dim); margin-top: var(--space-4); }
.hero-lead .media img { width: 100%; height: 100%; object-fit: cover; }
.hero-lead h1, .hero-lead h2 { font-size: clamp(1.6rem, 1.1rem + 2.4vw, 2.6rem); margin-top: 0; }
.hero-lead .dek { font-size: 1.05rem; color: var(--color-text-muted); max-width: 62ch; }
/* Right rail of the hero: compact horizontal cards, each stretching to share
   the column evenly, so the rail matches the lead's height instead of
   overshooting it and leaving a gap under the lead. */
.hero-secondary { display: flex; flex-direction: column; }
.hero-secondary .article-card {
  flex: 1 1 0;
  display: grid;
  grid-template-columns: 104px 1fr;
  column-gap: var(--space-3);
  align-content: center; /* center each card inside its equal share of the rail */
  padding-block: var(--space-3);
  border-bottom: var(--border);
}
.hero-secondary .article-card:first-child { padding-top: 0; }
.hero-secondary .article-card:last-child { border-bottom: none; padding-bottom: 0; }
.hero-secondary .article-card .media {
  grid-column: 1;
  grid-row: 1 / span 3;
  aspect-ratio: 1 / 1;
  margin-bottom: 0;
}
.hero-secondary .article-card > :not(.media) { grid-column: 2; }
.hero-secondary .article-card h3 { font-size: 1.05rem; margin-bottom: var(--space-1); }
.hero-secondary .article-card .dek { display: none; }
.hero-secondary .article-card .card-meta { margin-bottom: var(--space-1); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ============ Weekly regional digest ============ */
/* One card per continent (never per-country) -- a gold top-rule marks each as
   a distinct dispatch, echoing the masthead rule without borrowing any single
   publisher's specific digest layout. */
.digest { background: var(--color-paper-dim); border: var(--border); padding: var(--space-5); }
.digest-header { margin-bottom: var(--space-4); }
.digest-header h2 { font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); margin-bottom: var(--space-1); }
.digest-header .dek { font-size: .92rem; color: var(--color-text-muted); max-width: 60ch; margin: 0; }
.digest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--space-5); }
.digest-card { border-top: 3px solid var(--color-gold); padding-top: var(--space-3); }
.digest-card .continent-label {
  display: block; font-family: var(--font-sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--color-gold-text); margin-bottom: var(--space-1);
}
.digest-card h3 { font-size: 1rem; margin-bottom: var(--space-1); }
.digest-card .dek {
  font-size: .85rem; color: var(--color-text-muted); margin: 0 0 var(--space-1);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============ Cards & Headlines ============ */
/* Container-driven instead of a fixed 3-up: a fixed column count paired with
   the .two-col breakpoint (960px, by viewport not container width) meant
   cards got *narrower* on wider viewports whenever the rail was present
   (961-1150px) than they were just below the breakpoint. auto-fill sizes off
   the grid's own available width, so it can't invert like that. */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-5); }
.article-card { display: flex; flex-direction: column; }
/* Gives a flat river of identical cards (continent/topic hubs) a single
   weighted lead instead of every story reading as equally important. Only
   above 620px: on an auto-fill grid, "span 2" doesn't just clamp to what's
   there when just ONE 230px column fits -- it forces the grid to create a
   second, narrow *implicit* column to satisfy the span, squeezing every
   card after it and overflowing the viewport. Below 620px the grid is
   already single-column, so a lead treatment has nothing to span across. */
@media (min-width: 620px) {
  .article-card--lead { grid-column: span 2; }
}
.article-card--lead .media { aspect-ratio: 21 / 9; }
.article-card--lead h3 { font-size: clamp(1.3rem, 1rem + 1.5vw, 1.8rem); }
.article-card .media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--color-paper-dim); margin-bottom: var(--space-3); }
.article-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.article-card:hover .media img { transform: scale(1.03); }
.article-card h3 { font-size: 1.1rem; margin-bottom: var(--space-2); }
.article-card .dek {
  font-size: .92rem; color: var(--color-text-muted); margin-bottom: var(--space-2);
  /* Hub grids show a dozen-plus cards at once; an unclamped 5-8 line dek made
     row heights vary wildly and the grid read as a wall of gray text. */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { font-size: .78rem; color: var(--color-text-muted); display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-2); }

.headline-list { display: flex; flex-direction: column; }
.headline-item { padding-block: var(--space-3); border-bottom: var(--border); }
.headline-item:first-child { padding-top: 0; }
.headline-item a { color: var(--color-heading); font-weight: 600; font-size: 1rem; }
.headline-item .card-meta { margin-top: var(--space-1); }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-7); align-items: start; }
@media (max-width: 960px) {
  .two-col { grid-template-columns: 1fr; }
}

.tag-badge {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--color-heading); background: var(--color-paper-dim);
  border: 1px solid var(--color-line); padding: 5px 10px; border-radius: var(--radius);
}
.sponsored-badge { color: var(--color-sponsored); border-color: var(--color-sponsored); }

/* ============ Region grid (continent hub) ============ */
.region-grid { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.region-tile {
  flex: 1 1 140px; max-width: 220px;
  border: var(--border); padding: var(--space-4); text-align: center; background: var(--color-paper-dim);
  transition: border-color .15s ease, background-color .15s ease;
}
.region-tile:hover { border-color: var(--color-gold); background: var(--color-paper); text-decoration: none; }
.region-tile .code { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; color: var(--color-heading); }
.region-tile .name { font-size: .9rem; margin-top: var(--space-1); }

/* ============ Article page ============ */
/* .article-header/.article-body/.article-footer share one 65ch
   measure and one padding-inline -- previously the header alone ran 780px
   against the body's 720px (a visible left-edge mismatch), and none of them
   had inline padding, so text ran flush against the viewport edge on mobile. */
.article-header, .article-body, .article-footer {
  max-width: 65ch; margin-inline: auto; padding-inline: var(--space-4);
}
.article-header { padding-block: var(--space-6) var(--space-4); }
.article-header h1 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.8rem); }
.article-header .dek { font-size: 1.15rem; color: var(--color-text-muted); margin-top: var(--space-3); }
.byline { display: flex; align-items: center; gap: var(--space-2); font-size: .88rem; color: var(--color-text-muted); margin-top: var(--space-4); flex-wrap: wrap; }
.byline strong { color: var(--color-text); }
/* Segments (author / published / read time / language) ran together as one
   grey line with no delimiter -- a small separator between them reads far
   more like a byline and less like a wrapped sentence, and stays RTL-safe
   since it's inserted by content order, not a physical side. */
.byline > span + span::before { content: "·"; margin-inline-end: var(--space-2); color: var(--color-text-muted); }
.article-hero-media { max-width: 1040px; margin: var(--space-5) auto; padding-inline: var(--space-4); }
.article-hero-media img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
.article-hero-media figcaption { font-size: .8rem; color: var(--color-text-muted); padding-top: var(--space-2); }

.article-body { font-size: 1.08rem; line-height: 1.75; }
.article-body h2 { font-size: 1.4rem; margin-top: var(--space-6); }
.article-body h3 { font-size: 1.25rem; margin-top: var(--space-5); }
.article-body blockquote {
  border-inline-start: 3px solid var(--color-gold); margin: var(--space-5) 0; padding-inline-start: var(--space-4);
  font-style: italic; color: var(--color-text-muted);
}
.article-body a { text-decoration: underline; }
.article-body figure { margin: var(--space-5) 0; }
.article-footer { margin: var(--space-6) auto 0; padding-top: var(--space-4); border-top: var(--border); }
.tag-row { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-3); }

/* Share row: plain buttons styled like the masthead's icon buttons, so a
   distribution-dependent, 9-locale site has at least a copy-link/native-share
   affordance at the point a reader is most likely to want it. */
.share-row { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-4); flex-wrap: wrap; }
.share-row .btn-outline { color: var(--color-heading); border-color: var(--color-line); }
.share-row .btn-outline:hover { background: var(--color-paper-dim); border-color: var(--color-heading); }

.sponsor-notice {
  max-width: 65ch; margin: var(--space-4) auto; padding: var(--space-3) var(--space-4);
  background: var(--color-paper-dim); border: 1px dashed var(--color-sponsored);
  font-size: .85rem; color: var(--color-sponsored);
}

.breadcrumbs { font-size: .82rem; color: var(--color-text-muted); padding-block: var(--space-3); }
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs .sep { margin-inline: var(--space-2); }

/* ============ Ad slots ============ */
/* Ads are opt-in to layout: a slot occupies zero space (height 0, clipped, no
   margins) until main.js confirms a real fill via AdSense's data-ad-status and
   adds .is-filled, at which point it expands to fit the rendered ad. While a
   slot is still trying to fill, the page reads exactly as if there were no ads
   at all -- and Google's iframe (which paints white before content arrives)
   stays clipped, so it can never flash against the dark theme. A confirmed
   non-fill (.is-empty) stays collapsed for good. The container keeps its full
   width while collapsed so adsbygoogle.js can still measure availableWidth;
   only its height is zeroed, never display:none, which would break that. */
.ad-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-2);
  height: 0; min-height: 0; margin-block: 0; overflow: hidden;
}
.ad-slot.is-filled {
  height: auto; overflow: visible; margin-block: var(--space-6);
}
/* align-items:center un-stretches flex children, which would leave the empty
   responsive <ins> at shrink-to-fit width 0 -- and adsbygoogle.js sizes
   "auto"/fluid units from the ins's own width, throwing "No slot size for
   availableWidth=0" when it's 0. Stretch it explicitly; the fixed-size desktop
   sidebar variant wins over this via its inline width/height from main.js. */
.ad-slot ins.adsbygoogle { width: 100%; }
.ad-slot .ad-label {
  display: none;
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-muted);
}
.ad-slot.is-filled .ad-label { display: block; }
.ad-slot.is-empty { display: none; }
/* Widths apply even while collapsed (adsbygoogle.js sizes against them); the
   min-heights only kick in once a fill is confirmed, sized to what an
   "auto"/fullWidthResponsive unit typically renders at each breakpoint
   (Google's guidance: a mobile fallback commonly fills 250-320px tall; a
   desktop leaderboard settles around 90-100px). */
.ad-slot--leaderboard { max-width: 970px; margin-inline: auto; }
.ad-slot--leaderboard.is-filled { min-height: 300px; }
@media (min-width: 768px) {
  .ad-slot--leaderboard.is-filled { min-height: 100px; }
}
.ad-slot--sidebar.is-filled { min-height: 300px; }
.ad-slot--native.is-filled { min-height: 120px; }
/* Matches .article-body/.article-footer's reading width -- without this, the fluid
   in-article unit has no container width to size against and stretches full-bleed. */
.ad-slot--inArticle { max-width: 65ch; margin-inline: auto; }
.ad-slot--inArticle.is-filled { min-height: 280px; }

/* >960px is exactly where .two-col stops stacking (see below) and the sidebar becomes a
   real rail, so a sticky rectangle only makes sense above that width. AdSense's sticky-ad
   rules (support.google.com/adsense/answer/10734935) require this to be desktop-only and
   <=300px wide, sized here for a 300x600 half-page unit; .two-col's align-items: start is
   what gives the sticky element room to travel inside its grid cell. */
@media (min-width: 961px) {
  .ad-slot--sidebar.is-filled {
    min-height: 600px;
    position: sticky;
    top: 4.75rem;
  }
}

/* ============ Sidebar widgets ============ */
.widget { margin-bottom: var(--space-6); }
.widget h2 { font-size: 1.05rem; border-bottom: 2px solid var(--color-heading); padding-bottom: var(--space-2); margin-bottom: var(--space-3); }
.widget ol { counter-reset: widget-counter; }
.widget ol li { counter-increment: widget-counter; display: flex; gap: var(--space-3); padding-block: var(--space-2); border-bottom: var(--border); }
.widget ol li::before { content: counter(widget-counter); font-family: var(--font-serif); font-weight: 700; color: var(--color-gold-text); font-size: 1.2rem; }
/* A tappable row list (country hub's "Sections" widget) instead of cramped
   tag-badge chips, which read as decorative labels rather than navigation. */
.widget-list li { border-bottom: var(--border); }
.widget-list li:last-child { border-bottom: none; }
.widget-list a { display: block; padding: var(--space-2) 0; font-size: .92rem; color: var(--color-text); }
.widget-list a:hover { color: var(--color-heading); text-decoration: none; }

/* ============ Footer ============ */
.site-footer { background: var(--color-navy-deep); color: var(--color-text-on-navy); margin-top: var(--space-8); }
.footer-top { padding-block: var(--space-7); display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: var(--space-5); }
.footer-brand .logo-text .mark { color: var(--color-text-on-navy); }
.footer-brand .logo-text .full { color: rgba(244,241,232,.6); }
.footer-brand p { color: rgba(244,241,232,.75); font-size: .9rem; margin-top: var(--space-3); max-width: 34ch; }
.footer-col h3 { font-family: var(--font-sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--color-gold-bright); margin-bottom: var(--space-3); }
.footer-col ul li { margin-bottom: var(--space-1); }
.footer-col a { display: inline-block; padding-block: 3px; color: rgba(244,241,232,.85); font-size: .88rem; }
.footer-col a:hover { color: #fff; }
.footer-brand .footer-entity { font-size: .8rem; color: rgba(244,241,232,.55); }
/* Buttons that sit inside footer link lists (e.g. Manage Preferences) render as links */
.footer-link-button {
  display: inline-block; background: none; border: none; padding: 3px 0; cursor: pointer;
  color: rgba(244,241,232,.85); font-size: .88rem; font-family: inherit; text-align: inherit;
}
.footer-link-button:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(244,241,232,.15); padding-block: var(--space-4);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-3);
  font-size: .78rem; color: rgba(244,241,232,.65);
}
.footer-bottom a { color: rgba(244,241,232,.65); }
.footer-disclaimer { font-size: .76rem; color: rgba(244,241,232,.55); padding-bottom: var(--space-5); max-width: 90ch; }

@media (max-width: 980px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* ============ Cookie consent ============ */
.cookie-banner {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 300;
  background: var(--color-ink); color: var(--color-text-on-navy);
  padding: var(--space-4); display: none;
}
.cookie-banner.is-visible { display: block; }
.cookie-banner .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; }
.cookie-banner p { margin: 0; font-size: .88rem; max-width: 70ch; }
.cookie-banner a { color: var(--color-gold-bright); }
.cookie-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius); font-size: .85rem; font-weight: 600;
  border: 1px solid transparent;
}
.btn-primary { background: var(--color-gold-bright); color: var(--color-ink); }
.btn-primary:hover { background: var(--color-gold); text-decoration: none; }
.btn-outline { background: transparent; border-color: rgba(244,241,232,.4); color: var(--color-text-on-navy); }
.btn-outline:hover { border-color: #fff; text-decoration: none; }

/* ============ "See more" reveal on listing pages ============ */
.load-more {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: var(--space-6) auto 0;
  padding: var(--space-3) var(--space-6);
  font-size: .95rem;
  font-weight: 700;
  color: var(--color-heading);
  background: transparent;
  border: var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
/* .load-more is self-sufficient; if a template still also applies btn-outline
   (styled for the on-navy cookie banner) its :hover{border-color:#fff} would
   otherwise win and the border would vanish against the paper page background
   right at the moment of interaction. */
.load-more:hover { background: var(--color-paper-dim); border-color: var(--color-heading); }

/* ============ Search page ============ */
.search-form { display: flex; gap: var(--space-2); margin-block: var(--space-4) var(--space-4); }
.search-form input[type="search"] {
  flex: 1;
  padding: var(--space-3) var(--space-3);
  border: var(--border);
  border-radius: var(--radius);
  background: var(--color-paper-dim);
  color: var(--color-text);
  font-size: 1rem;
}
.search-hint { color: var(--color-text-muted); }
.search-count { margin-bottom: var(--space-3); font-size: .9rem; }
#js-search-results .dek { font-size: .9rem; color: var(--color-text-muted); margin-block: var(--space-1); }

/* ============ Policy / long-form pages ============ */
.policy-page { max-width: 780px; margin-inline: auto; padding-block: var(--space-6); padding-inline: var(--space-4); }
.policy-page h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
.policy-page .updated { font-size: .85rem; color: var(--color-text-muted); margin-bottom: var(--space-5); }
.policy-page h2 { font-size: 1.25rem; margin-top: var(--space-6); }
.policy-page ul, .policy-page ol { list-style: disc; margin-inline-start: 1.4em; margin-bottom: var(--space-4); }
.policy-page ol { list-style: decimal; }
.policy-page li { margin-bottom: var(--space-2); }
.policy-page table { border-collapse: collapse; width: 100%; margin-bottom: var(--space-4); font-size: .92rem; }
.policy-page th, .policy-page td { border: var(--border); padding: var(--space-2) var(--space-3); text-align: left; }

/* ============ RTL ============ */
[dir="rtl"] .hero-lead .dek,
[dir="rtl"] body { direction: rtl; }
[dir="rtl"] .breadcrumbs .sep { transform: scaleX(-1); display: inline-block; }
[dir="rtl"] .widget ol li::before { order: 2; }
/* .article-body blockquote and every skip-link/mega-menu/lang-panel rule above
   now use logical (inset-inline-*/margin-inline-*/padding-inline-*) properties,
   which already flip for dir="rtl" on their own -- no override needed here. */

/* ============ Print ============ */
@media print {
  .site-header, .site-footer, .ad-slot, .cookie-banner, .lang-switcher { display: none !important; }
  .article-body { max-width: 100%; }
}
