/* ==========================================================================
   IOI Journal — design system
   Montserrat (display + reading) · Inter (small UI text)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --brand:            #c2181b;
  --brand-strong:     #9e1215;
  --brand-soft:       rgba(194, 24, 27, 0.08);
  --brand-contrast:   #ffffff;

  --bg:               #ffffff;
  --bg-alt:           #f5f6f8;
  --bg-card:          #ffffff;
  --bg-inset:         #f0f2f5;
  --bg-header:        #ffffff;
  --bg-footer:        #0e1116;

  --ink:              #0e1116;
  --ink-2:            #3d4551;
  --ink-3:            #6b7480;
  --ink-inv:          #f2f4f7;

  --line:             #e3e6eb;
  --line-strong:      #cdd3db;

  --shadow-sm:        0 1px 2px rgba(14, 17, 22, 0.05);
  --shadow-md:        0 4px 18px rgba(14, 17, 22, 0.08);
  --shadow-lg:        0 14px 40px rgba(14, 17, 22, 0.12);

  /* Headlines and brand. */
  --font-display:     'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  /* Nav, meta, buttons — Inter is narrower and stays legible below 13px. */
  --font-ui:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  /* Article body. Swap to var(--font-ui) if long reads feel too wide. */
  --font-read:        'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --r-xs: 3px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --wrap: 1240px;
  --gap: 28px;

  --t: 0.18s ease;
}

:root[data-theme="dark"] {
  --brand:            #ff5a5d;
  --brand-strong:     #ff7b7d;
  --brand-soft:       rgba(255, 90, 93, 0.12);
  --brand-contrast:   #16090a;

  --bg:               #0d1014;
  --bg-alt:           #12161c;
  --bg-card:          #141920;
  --bg-inset:         #1a2029;
  --bg-header:        #0d1014;
  --bg-footer:        #07090c;

  --ink:              #e9edf3;
  --ink-2:            #aeb7c3;
  --ink-3:            #7d8794;
  --ink-inv:          #0d1014;

  --line:             #232a34;
  --line-strong:      #313a46;

  --shadow-sm:        0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md:        0 4px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg:        0 14px 40px rgba(0, 0, 0, 0.6);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

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

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; transition: color var(--t); }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--brand); color: var(--brand-contrast); }

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

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -60px; left: 12px;
  z-index: 999;
  padding: 10px 16px;
  background: var(--brand);
  color: var(--brand-contrast);
  font-weight: 700;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  transition: top var(--t);
}
.skip-link:focus { top: 0; }

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

.dot { color: var(--line-strong); }

/* --------------------------------------------------------------------------
   3. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  /* Must stay above the mobile drawer, otherwise the burger that closes it
     ends up underneath the panel it opened. */
  z-index: 100;
  background: var(--bg-header);
  border-bottom: 1px solid var(--line);
}

.topbar {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
}
.topbar-date {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-weight: 500;
}
.live-date { color: var(--ink-2); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.topbar-social { display: flex; gap: 2px; }

.social-ico {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  transition: color var(--t), background var(--t);
}
.social-ico:hover { color: var(--brand); background: var(--brand-soft); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  transition: color var(--t), background var(--t);
}
.theme-toggle:hover { color: var(--brand); background: var(--brand-soft); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Masthead */
.masthead-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  background: var(--brand);
  color: var(--brand-contrast);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
  border-radius: var(--r-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.brand-tagline {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.masthead-search {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 380px;
  width: 100%;
  justify-self: end;
  padding: 0 6px 0 14px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color var(--t), background var(--t);
}
.masthead-search:focus-within { border-color: var(--brand); background: var(--bg-card); }
.masthead-search input {
  flex: 1;
  min-width: 0;
  padding: 9px 0;
  font-size: 14px;
  background: none;
  border: 0;
  outline: none;
}
.masthead-search input::placeholder { color: var(--ink-3); }
.masthead-search button {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--ink-2);
}
.masthead-search button:hover { color: var(--brand); }

.masthead-cta {
  padding: 10px 18px;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--r-sm);
  transition: background var(--t);
}
.masthead-cta:hover { background: var(--brand-strong); }

.burger { display: none; flex-direction: column; gap: 4px; width: 34px; padding: 6px 4px; }
.burger span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Nav */
.navbar { border-top: 1px solid var(--line); background: var(--bg-header); }
.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-list > li { position: relative; }
.nav-list > li > a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 13px 14px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  transition: color var(--t), border-color var(--t);
}
.nav-list > li > a:hover { color: var(--brand); }
.nav-list > li.is-current > a { color: var(--ink); border-bottom-color: var(--brand); }

.nav-chevron { opacity: 0.55; }

.sub-menu {
  position: absolute;
  top: 100%; left: 0;
  min-width: 210px;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--t), transform var(--t), visibility var(--t);
}
.nav-list > li:hover > .sub-menu,
.nav-list > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.sub-menu a {
  display: block;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  border-radius: var(--r-sm);
}
.sub-menu a:hover { background: var(--bg-alt); color: var(--brand); }

.nav-search-mobile { display: none; }

.reading-progress {
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%; height: 2px;
  background: transparent;
  pointer-events: none;
}
.reading-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 0.08s linear;
}

/* --------------------------------------------------------------------------
   4. Ticker
   -------------------------------------------------------------------------- */
.ticker {
  background: var(--ink);
  color: var(--ink-inv);
  overflow: hidden;
}
:root[data-theme="dark"] .ticker { background: var(--bg-alt); color: var(--ink); border-bottom: 1px solid var(--line); }

.ticker-inner { display: flex; align-items: center; gap: 16px; height: 42px; }
.ticker-label {
  flex-shrink: 0;
  padding: 4px 10px;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--r-xs);
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 500;
  mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.ticker-track a { opacity: 0.9; }
.ticker-track a:hover { opacity: 1; color: var(--brand); }
.ticker-track .dot { opacity: 0.35; }

/* --------------------------------------------------------------------------
   5. Layout
   -------------------------------------------------------------------------- */
main { padding-bottom: 64px; }

.page-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 52px;
  align-items: start;
  margin-top: 44px;
}
.content-col { min-width: 0; }

.block { margin-top: 52px; }
.block:first-child { margin-top: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
:root[data-theme="dark"] .section-head { border-bottom-color: var(--line-strong); }

.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-link {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}
.section-link:hover { color: var(--brand-strong); }

.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)); }

.section-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

/* --------------------------------------------------------------------------
   6. Cards
   -------------------------------------------------------------------------- */
.card { display: flex; flex-direction: column; min-width: 0; }

/* The branded gradient sits behind every thumbnail, so a slow, missing or
   broken image shows a deliberate block rather than an empty grey rectangle. */
.card-media,
.list-thumb,
.article-hero img {
  background-image: linear-gradient(135deg, #1d2836 0%, #131a24 55%, #0d1219 100%);
}

.card-media {
  display: block;
  overflow: hidden;
  border-radius: var(--r-md);
  aspect-ratio: 16 / 10;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.card:hover .card-media img { transform: scale(1.04); }

.card-body { padding-top: 14px; }

.kicker {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--brand);
}
.kicker:hover { color: var(--brand-strong); }

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.card-title a { background-image: linear-gradient(var(--brand), var(--brand)); background-size: 0 1.5px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size 0.25s ease, color var(--t); }
.card-title a:hover { color: var(--brand); background-size: 100% 1.5px; }

.card-excerpt {
  margin-top: 9px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.6;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.card-byline { font-weight: 700; color: var(--ink-2); }
.card-byline:hover { color: var(--brand); }

.card-lg .card-title { font-size: clamp(24px, 2.9vw, 33px); letter-spacing: -0.028em; }
.card-lg .card-excerpt { font-size: 16px; }
.card-lg .card-media { aspect-ratio: 16 / 9; }

.card-md .card-title { font-size: 18.5px; }
.card-sm .card-title { font-size: 16px; }
.card-sm .card-media { aspect-ratio: 16 / 10; }

/* Lead package */
.lead-package {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 40px;
  padding-top: 36px;
}
.lead-side { display: grid; gap: 28px; align-content: start; }
.lead-side .card + .card { padding-top: 28px; border-top: 1px solid var(--line); }

/* --------------------------------------------------------------------------
   7. List rows
   -------------------------------------------------------------------------- */
.list-stack { display: flex; flex-direction: column; }
.list-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.list-stack .list-item:first-child { padding-top: 0; }
.list-stack .list-item:last-child { border-bottom: 0; }

.list-thumb {
  flex-shrink: 0;
  width: 92px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-sm);
  /* background-image comes from the shared placeholder rule above — do not
     add a background shorthand here, it would reset it. */
}
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }

.list-rank {
  flex-shrink: 0;
  width: 30px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--line-strong);
  line-height: 1.1;
}
.ranked .list-item:hover .list-rank { color: var(--brand); }

.list-body { min-width: 0; }
.list-title {
  display: block;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -0.01em;
}
.list-title:hover { color: var(--brand); }
.list-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   8. Sidebar & widgets
   -------------------------------------------------------------------------- */
.sidebar { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.sidebar-sticky { position: sticky; top: 130px; }

.widget {
  padding: 22px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.widget-title {
  margin-bottom: 14px;
  padding-bottom: 10px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--line);
}
.widget-text { font-size: 14px; color: var(--ink-2); }
.widget-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}
.widget .list-item { padding: 13px 0; }
.widget .list-item:first-child { padding-top: 0; }

.widget-subscribe { background: var(--brand-soft); border-color: transparent; }
.widget-subscribe .widget-title { border-bottom-color: rgba(194, 24, 27, 0.2); }

.toc-list { counter-reset: toc; }
.toc-list li {
  counter-increment: toc;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.toc-list li:last-child { border-bottom: 0; }
.toc-list a {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.45;
}
.toc-list a::before {
  content: counter(toc, decimal-leading-zero);
  flex-shrink: 0;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.toc-list a:hover { color: var(--brand); }
.toc-list a.is-active { color: var(--brand); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background var(--t), color var(--t), border-color var(--t);
}
a.tag:hover { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.tag-static { cursor: default; }
.tag-count { color: var(--ink-3); font-weight: 700; font-size: 11px; }
a.tag:hover .tag-count { color: inherit; opacity: 0.75; }

.author-stack { display: flex; flex-direction: column; gap: 4px; }
.author-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px;
  margin-inline: -9px;
  border-radius: var(--r-sm);
  transition: background var(--t);
}
.author-row:hover { background: var(--bg-inset); }
.author-row img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.author-row span { display: flex; flex-direction: column; min-width: 0; }
.author-row strong { font-size: 14px; font-weight: 700; }
.author-row em { font-style: normal; font-size: 12px; color: var(--ink-3); }

/* --------------------------------------------------------------------------
   9. Newsletter
   -------------------------------------------------------------------------- */
.newsletter {
  margin-top: 64px;
  padding: 46px 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.newsletter-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 40px;
  align-items: center;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}
.newsletter-title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.3vw, 26px);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.newsletter-text { margin-top: 8px; color: var(--ink-2); font-size: 15px; }

.newsletter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.newsletter-form input {
  padding: 12px 15px;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color var(--t);
}
.newsletter-form input:focus { border-color: var(--brand); }
.newsletter-note,
.newsletter-done {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--ink-3);
}
.newsletter-done { color: var(--brand); font-weight: 600; }
.newsletter-form.compact { grid-template-columns: minmax(0, 1fr); margin-top: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 700;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.btn-primary { background: var(--brand); color: var(--brand-contrast); }
.btn-primary:hover { background: var(--brand-strong); }

/* --------------------------------------------------------------------------
   10. Breadcrumbs, page heads, pagination
   -------------------------------------------------------------------------- */
.breadcrumbs { padding: 20px 0 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; }
.breadcrumbs li { display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.breadcrumbs li + li::before { content: '/'; color: var(--line-strong); }
.breadcrumbs a { color: var(--ink-3); font-weight: 500; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs [aria-current] { color: var(--ink-2); font-weight: 600; }

.page-head { padding: 30px 0 34px; border-bottom: 1px solid var(--line); margin-bottom: 38px; }
.page-title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(27px, 3.9vw, 40px);
  font-weight: 800;
  letter-spacing: -0.032em;
  line-height: 1.16;
}
.page-intro { margin-top: 14px; max-width: 62ch; color: var(--ink-2); font-size: 15.5px; font-family: var(--font-read); line-height: 1.65; }
.page-count { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.page-head .search-form { margin-top: 20px; }

.search-form { display: flex; gap: 10px; max-width: 520px; }
.search-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 15px;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  outline: none;
}
.search-form input:focus { border-color: var(--brand); }

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 44px;
  justify-content: center;
}
.page-btn {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
  transition: background var(--t), color var(--t), border-color var(--t);
}
a.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.current { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.page-btn.dots { border-color: transparent; background: none; }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-2);
}
.empty-state h1, .empty-state h2, .empty-state h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--ink);
}
.empty-state a { color: var(--brand); font-weight: 600; }
.empty-404 { padding-bottom: 40px; }
.empty-404 .search-form { margin: 22px auto 0; }

/* --------------------------------------------------------------------------
   11. Article
   -------------------------------------------------------------------------- */
.article-head { padding-bottom: 26px; border-bottom: 1px solid var(--line); }

.article-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.article-kicker a {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--brand);
}
.badge {
  padding: 3px 9px;
  background: var(--bg-inset);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.article-title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: clamp(27px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.034em;
  line-height: 1.18;
  text-wrap: balance;
}

.article-standfirst {
  margin-top: 18px;
  max-width: 60ch;
  font-family: var(--font-read);
  font-size: clamp(16.5px, 1.7vw, 18.5px);
  line-height: 1.62;
  color: var(--ink-2);
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 26px;
}
.byline-author { display: flex; align-items: center; gap: 11px; }
.byline-author img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.byline-author span { display: flex; flex-direction: column; }
.byline-author strong { font-size: 14.5px; font-weight: 700; }
.byline-author:hover strong { color: var(--brand); }
.byline-author em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.byline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
}

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; }
.share-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 4px;
}
.share-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  transition: background var(--t), color var(--t), border-color var(--t);
}
.share-btn:hover { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }

.article-hero { margin: 30px 0 8px; }
.article-hero img { width: 100%; border-radius: var(--r-md); }
.article-hero figcaption {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-3);
  padding-left: 12px;
  border-left: 2px solid var(--brand);
}

/* Reading column */
.article-body {
  margin-top: 30px;
  font-family: var(--font-read);
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--ink);
}
.article-body > * + * { margin-top: 1.35em; }
.article-body p { max-width: 66ch; }

.article-body h2 {
  margin-top: 2em;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.3vw, 25px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.32;
  scroll-margin-top: 130px;
}
.article-body h3 {
  margin-top: 1.7em;
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.article-body h4 { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; }

.article-body a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(194, 24, 27, 0.35);
}
.article-body a:hover { text-decoration-color: currentColor; }

.article-body ul, .article-body ol { padding-left: 1.3em; max-width: 66ch; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li + li { margin-top: 0.5em; }
.article-body li::marker { color: var(--brand); }

.article-body blockquote {
  margin-inline: 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--brand);
  font-size: 17.5px;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-2);
}
.article-body blockquote p { max-width: none; }

.article-body figure img, .article-body img { border-radius: var(--r-md); }
.article-body figcaption { margin-top: 9px; font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-3); }

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 15px;
}
.article-body th, .article-body td { padding: 11px 13px; border: 1px solid var(--line); text-align: left; }
.article-body th { background: var(--bg-alt); font-weight: 700; }

.article-body code {
  padding: 2px 6px;
  background: var(--bg-inset);
  border-radius: var(--r-xs);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
}
.article-body pre {
  padding: 18px;
  overflow-x: auto;
  background: var(--bg-inset);
  border-radius: var(--r-md);
}
.article-body hr { border: 0; border-top: 1px solid var(--line); }

/* Key facts (ACF "In brief") */
.widget-facts { background: var(--bg-card); border-color: var(--line-strong); }
.fact-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  font-size: 13.5px;
}
.fact-list > div + div { border-top: 1px solid var(--line); }
.fact-list dt { color: var(--ink-3); flex-shrink: 0; }
.fact-list dd { font-weight: 700; text-align: right; }

/* Sources (ACF) */
.article-sources {
  margin-top: 40px;
  padding: 22px 24px;
  background: var(--bg-alt);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.article-sources-title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.article-sources ol { list-style: decimal; padding-left: 1.2em; }
.article-sources li { font-size: 14px; color: var(--ink-2); }
.article-sources li + li { margin-top: 7px; }
.article-sources li::marker { color: var(--brand); font-weight: 700; }
.article-sources a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

.article-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.article-tags-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.author-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  margin-top: 36px;
  padding: 26px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.author-box-photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.author-box-role { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand); }
.author-box-name { margin-top: 5px; font-family: var(--font-display); font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.author-box-name a:hover { color: var(--brand); }
.author-box-bio { margin-top: 9px; font-size: 14.5px; color: var(--ink-2); max-width: 62ch; }
.author-box-social { display: flex; gap: 4px; margin-top: 12px; margin-left: -7px; }

.related { margin-top: 56px; }

/* --------------------------------------------------------------------------
   12. Author pages
   -------------------------------------------------------------------------- */
.author-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 30px;
  align-items: start;
  padding: 32px 0 34px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.author-hero-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }
.author-hero-bio { margin-top: 14px; max-width: 58ch; font-family: var(--font-read); font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.author-hero-loc { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--ink-3); }
.author-hero .tag-cloud { margin-top: 16px; }
.author-hero-social { display: flex; gap: 4px; margin-top: 14px; margin-left: -7px; }

.author-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 170px;
  padding: 18px 22px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.author-stats > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 7px 0; }
.author-stats > div + div { border-top: 1px solid var(--line); }
.author-stats dt { font-size: 12.5px; color: var(--ink-3); }
.author-stats dd { font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }

.author-sections { margin-bottom: 34px; }

.author-grid { margin-top: 0; }
.author-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color var(--t), box-shadow var(--t);
}
.author-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.author-card-head { display: flex; align-items: center; gap: 13px; }
.author-card-head img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.author-card-head span { display: flex; flex-direction: column; min-width: 0; }
.author-card-head strong { font-family: var(--font-display); font-size: 16px; font-weight: 800; letter-spacing: -0.015em; }
.author-card-head em { font-style: normal; font-size: 12px; color: var(--brand); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.author-card-bio { font-size: 14px; color: var(--ink-2); }
.author-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
}
.author-card-foot a { color: var(--brand); font-weight: 700; }

/* --------------------------------------------------------------------------
   13. Static pages
   -------------------------------------------------------------------------- */
.prose-page { max-width: 780px; margin-inline: auto; }
.prose-page .page-head { border-bottom: 0; margin-bottom: 0; padding-bottom: 8px; }

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 0;
  padding: 56px 0 28px;
  background: var(--bg-footer);
  color: #b9c1cc;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
}
.brand-footer .brand-name { color: #fff; }
.brand-footer .brand-tagline { color: #78828f; }
.footer-about { margin-top: 18px; max-width: 42ch; font-size: 14px; line-height: 1.65; }
.footer-contact { margin-top: 12px; font-size: 14px; }
.footer-contact a { color: var(--brand); font-weight: 600; }
.footer-social { display: flex; gap: 4px; margin-top: 16px; margin-left: -7px; }
.footer-social .social-ico { color: #8b95a2; }
.footer-social .social-ico:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.footer-col-title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 16px;
}
.footer-links ul { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 14px; color: #b9c1cc; }
.footer-links a:hover { color: var(--brand); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12.5px;
  color: #78828f;
}

/* --------------------------------------------------------------------------
   15. Floating UI
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  background: var(--brand);
  color: var(--brand-contrast);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--t), transform var(--t), visibility var(--t), background var(--t);
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--brand-strong); }

.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  z-index: 200;
  transform: translate(-50%, 14px);
  padding: 12px 20px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity var(--t), transform var(--t);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   16. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1120px) {
  .page-body { grid-template-columns: minmax(0, 1fr) 300px; gap: 38px; }
  .masthead-search { max-width: 300px; }
}

@media (max-width: 980px) {
  .page-body { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .sidebar-sticky { position: static; }
  .lead-package { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .lead-side { grid-template-columns: repeat(2, minmax(0, 1fr)); display: grid; }
  .lead-side .card + .card { padding-top: 0; border-top: 0; }
  .section-layout { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; }
  .newsletter-inner { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .author-hero { grid-template-columns: auto minmax(0, 1fr); }
  .author-stats { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .author-stats > div { flex: 1; flex-direction: column; align-items: flex-start; gap: 2px; }
  .author-stats > div + div { border-top: 0; border-left: 1px solid var(--line); padding-left: 18px; }
}

@media (max-width: 860px) {
  .topbar-note { display: none; }
  .masthead-inner { grid-template-columns: auto 1fr auto; gap: 14px; padding: 14px 20px; }
  .burger { display: flex; }
  .masthead-search { display: none; }
  .brand-mark { width: 40px; height: 40px; font-size: 15px; }
  .brand-name { font-size: 22px; }
  .brand-tagline { display: none; }

  /* The drawer is a child of .site-header, so it has to be out-stacked from
     inside that stacking context — a higher z-index on .site-header alone
     would still leave the burger buried. */
  .masthead { position: relative; z-index: 96; background: var(--bg-header); }

  .navbar { display: none; }
  .navbar.is-open { display: block; position: fixed; inset: 0; top: 0; z-index: 95; background: var(--bg); overflow-y: auto; padding: 86px 0 40px; }
  .navbar.is-open .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .navbar.is-open .nav-list > li > a { display: flex; justify-content: space-between; padding: 15px 0; font-size: 16px; border-bottom: 1px solid var(--line); border-left: 0; }
  .navbar.is-open .nav-list > li.is-current > a { border-bottom-color: var(--brand); }
  .navbar.is-open .sub-menu {
    position: static;
    opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; background: none;
    padding: 0 0 8px 14px;
  }
  .nav-search-mobile { display: block; margin-top: 22px; }
  .nav-search-mobile input {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    outline: none;
  }
  body.nav-open { overflow: hidden; }

  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .author-box { grid-template-columns: minmax(0, 1fr); }
  .author-box-photo { width: 60px; height: 60px; }
}

@media (max-width: 620px) {
  :root { --gap: 22px; }
  .topbar { display: none; }
  .masthead-cta { display: none; }
  .ticker-inner { height: 38px; }

  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .lead-side { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .lead-package { padding-top: 24px; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .section-title { font-size: 19px; }

  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .article-body { font-size: 15.8px; }
  .article-body blockquote { font-size: 16px; }
  .author-hero { grid-template-columns: minmax(0, 1fr); }
  .author-stats > div + div { border-left: 0; padding-left: 0; }
  .author-stats { flex-direction: column; }
  .back-to-top { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .sidebar, .share, .newsletter, .back-to-top, .ticker, .related { display: none !important; }
  .page-body { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; }
}
