/* The Geopolitical Economist — stylesheet v3
   Classic broadsheet on white: black ink, hairline rules, one crimson accent, the TGPE monogram. */

:root {
  --paper: #FFFFFF;
  --surface: #F4F4F1;
  --surface-2: #EAEAE6;
  --ink: #111111;
  --ink-2: #3B3B3B;
  --muted: #6E6E6E;
  --rule: #DDDDDA;
  --rule-strong: #111111;
  --accent: #A31621;
  --accent-soft: #F6E4E5;
  --on-accent: #FFFFFF;
  --focus: #A31621;
  --mark-filter: none;

  --f-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-sans: "Libre Franklin", "Franklin Gothic Medium", "Helvetica Neue", Arial, sans-serif;

  --max: 1200px;
  --gutter: clamp(16px, 3vw, 32px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141414; --surface: #1C1C1C; --surface-2: #262626; --ink: #EDEDED; --ink-2: #CFCFCF; --muted: #9C9C9C;
    --rule: #2E2E2E; --rule-strong: #EDEDED; --accent: #E4737C; --accent-soft: #3A1F22; --on-accent: #141414; --focus: #E4737C; --mark-filter: invert(1);
  }
}
:root[data-theme="dark"] {
  --paper: #141414; --surface: #1C1C1C; --surface-2: #262626; --ink: #EDEDED; --ink-2: #CFCFCF; --muted: #9C9C9C;
  --rule: #2E2E2E; --rule-strong: #EDEDED; --accent: #E4737C; --accent-soft: #3A1F22; --on-accent: #141414; --focus: #E4737C; --mark-filter: invert(1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-serif); font-size: 17px; line-height: 1.5; font-optical-sizing: auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.prose a, .desc a, .lede a { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.15; text-wrap: balance; letter-spacing: -.005em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- Type helpers ---------- */
.kicker { font-family: var(--f-sans); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.kicker a:hover { text-decoration: underline; }
.meta { font-family: var(--f-sans); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.meta .sep { margin-inline: .5em; }
.dek { color: var(--ink-2); font-size: 1rem; line-height: 1.45; }
.label { font-family: var(--f-sans); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }

/* ---------- Masthead ---------- */
.topbar { border-bottom: 1px solid var(--rule); font-family: var(--f-sans); font-size: 12px; color: var(--muted); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 36px; gap: 16px; }
.topbar .left, .topbar .right { display: flex; align-items: center; gap: 18px; }
.topbar .date { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.btn-accent { font-family: var(--f-sans); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--accent); color: var(--on-accent); padding: 7px 14px; border-radius: 2px; }
.btn-accent:hover { color: var(--on-accent); filter: brightness(1.1); }
.theme-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.theme-btn:hover { color: var(--accent); }
.theme-btn svg { width: 14px; height: 14px; }

.masthead { text-align: center; padding: 26px 0 18px; }
.masthead .lockup { display: inline-flex; align-items: center; gap: 18px; }
.masthead .mark { width: 64px; height: auto; filter: var(--mark-filter); }
.masthead .wordmark { font-family: var(--f-serif); font-weight: 700; font-size: clamp(22px, 3.6vw, 40px); letter-spacing: .06em; text-transform: uppercase; line-height: 1; color: var(--ink); text-align: left; }
.masthead .wordmark a:hover { color: var(--ink); }
.masthead .tagline { margin-top: 10px; font-family: var(--f-sans); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.nav { border-top: 2px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); background: var(--paper); position: sticky; top: 0; z-index: 30; }
.nav .wrap { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.nav__brand { display: none; align-items: center; gap: 10px; margin-right: 12px; white-space: nowrap; font-family: var(--f-serif); font-weight: 700; font-size: 15px; letter-spacing: .05em; text-transform: uppercase; }
.nav__brand img { width: 26px; filter: var(--mark-filter); }
.nav.is-stuck .nav__brand { display: inline-flex; }
.nav__list { list-style: none; display: flex; gap: 0; flex: 1; overflow-x: auto; scrollbar-width: none; justify-content: center; }
.nav__list::-webkit-scrollbar { display: none; }
.nav.is-stuck .nav__list { justify-content: flex-start; }
.nav__list a { display: block; padding: 13px 14px; font-family: var(--f-sans); font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav__list a:hover { color: var(--accent); }
.nav__list a[aria-current="page"] { border-bottom-color: var(--accent); }
.nav__search { margin-left: auto; }

/* ---------- Section furniture ---------- */
.section { padding: 36px 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section--surface { background: var(--surface); border-top: 0 !important; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; border-top: 2px solid var(--rule-strong); padding-top: 8px; }
.section__head h2 { font-family: var(--f-sans); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.section__head .more { font-family: var(--f-sans); font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.section__head .more:hover { color: var(--accent); }
.section__intro { color: var(--ink-2); max-width: 64ch; margin: -6px 0 22px; }

/* Top story */
.top { display: grid; grid-template-columns: 7fr 5fr; gap: 0 40px; padding: 26px 0 36px; }
.top__lead .img { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface); }
.top__lead .img img { width: 100%; height: 100%; object-fit: cover; }
.top__lead .kicker { margin-top: 16px; }
.top__lead h1 { font-size: clamp(30px, 3.8vw, 46px); font-weight: 600; margin-top: 8px; }
.top__lead .dek { font-size: clamp(16px, 1.5vw, 19px); margin-top: 12px; max-width: 36em; }
.top__lead .meta { margin-top: 12px; }
.top__side { border-left: 1px solid var(--rule); padding-left: 40px; }
.top__side .label { padding-bottom: 8px; border-bottom: 2px solid var(--rule-strong); display: block; }
.side-list { list-style: none; }
.side-list li { display: grid; grid-template-columns: 1fr 92px; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.side-list li:last-child { border-bottom: 0; }
.side-list h3 { font-size: 18px; margin-top: 4px; font-weight: 600; }
.side-list .dek { font-size: 14px; margin-top: 6px; }
.side-list .meta { margin-top: 6px; }
.side-list .thumb { aspect-ratio: 1; overflow: hidden; background: var(--surface); }
.side-list .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Cards & rows */
.grid { display: grid; gap: 32px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--rules > * + * { border-left: 1px solid var(--rule); padding-left: 32px; margin-left: -16px; }
.card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card__img { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface); }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card .kicker { margin-top: 6px; }
.card h3 { font-size: 21px; font-weight: 600; }
.card .dek { font-size: 14.5px; }
.rows { list-style: none; }
.row { display: grid; grid-template-columns: 1fr 140px; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.row:first-child { border-top: 1px solid var(--rule); }
.row h3 { font-size: 22px; margin-top: 4px; font-weight: 600; }
.row .dek { font-size: 15px; margin-top: 6px; max-width: 44em; }
.row .meta { margin-top: 8px; }
.row .thumb { aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface); }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.rows--compact .row { grid-template-columns: 1fr; padding: 12px 0; }
.rows--compact .row h3 { font-size: 18px; }

/* Research panel */
.research { display: grid; grid-template-columns: 7fr 4fr; gap: 48px; align-items: start; }
.papers { list-style: none; }
.paper { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.paper:first-child { border-top: 1px solid var(--rule); }
.paper h3 { font-size: 24px; margin-top: 6px; font-weight: 600; }
.paper .abstract { color: var(--ink-2); font-size: 15px; margin-top: 8px; max-width: 50em; }
.paper .meta { margin-top: 8px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag { font-family: var(--f-sans); font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 2px; padding: 3px 8px; background: var(--paper); }
.tag:hover { border-color: var(--accent); color: var(--accent); }
.note { border-top: 2px solid var(--rule-strong); padding-top: 14px; font-size: 15px; color: var(--ink-2); }
.note .label { display: block; margin-bottom: 8px; }
.note ul { list-style: none; display: grid; gap: 8px; margin-top: 8px; }
.note li { padding-left: 16px; position: relative; line-height: 1.45; }
.note li::before { content: ""; position: absolute; left: 0; top: .65em; width: 7px; height: 2px; background: var(--accent); }
.note p + p { margin-top: 10px; }

/* Topics chips */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-sans); font-size: 12.5px; font-weight: 600; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 2px; background: var(--paper); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip__n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.is-active .chip__n { color: var(--paper); opacity: .7; }

/* Newsletter panel */
.newsletter { display: grid; grid-template-columns: 6fr 5fr; gap: 48px; align-items: center; border-top: 3px solid var(--accent); padding: 30px 0 34px; }
.newsletter h2 { font-size: clamp(24px, 2.8vw, 34px); font-weight: 600; margin-top: 8px; }
.newsletter .lede { color: var(--ink-2); margin-top: 10px; max-width: 34em; font-size: 16px; }
.newsletter form { display: flex; gap: 8px; flex-wrap: wrap; }
.newsletter input { flex: 1 1 200px; font-family: var(--f-sans); font-size: 14px; padding: 11px 13px; border: 1px solid var(--rule-strong); border-radius: 2px; background: var(--paper); color: var(--ink); }
.newsletter .btn { font-family: var(--f-sans); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 2px; }
.newsletter .btn:hover { background: var(--accent); color: var(--on-accent); }
.newsletter .fine { font-family: var(--f-sans); font-size: 12px; color: var(--muted); margin-top: 10px; }

/* About strip */
.about-strip { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: start; }
.about-strip h2 { font-size: clamp(24px, 2.8vw, 34px); font-weight: 600; margin-top: 6px; }
.about-strip .lede { color: var(--ink-2); margin-top: 12px; max-width: 36em; font-size: 16.5px; }
.person { display: grid; grid-template-columns: 72px 1fr; gap: 18px; align-items: start; padding: 20px; border: 1px solid var(--rule); background: var(--paper); }
.avatar { display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-family: var(--f-serif); font-weight: 600; }
.avatar--72 { width: 72px; height: 72px; font-size: 28px; }
.avatar--56 { width: 56px; height: 56px; font-size: 22px; }
.avatar--40 { width: 40px; height: 40px; font-size: 16px; }
.avatar--120 { width: 120px; height: 120px; font-size: 48px; }
.person .name { font-size: 22px; font-weight: 600; margin-top: 4px; }
.person .role { font-family: var(--f-sans); font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.person p { font-size: 14.5px; color: var(--ink-2); margin-top: 8px; }

/* Page head */
.page-head { padding: 36px 0 22px; border-bottom: 1px solid var(--rule); }
.page-head h1 { font-size: clamp(32px, 4.2vw, 52px); font-weight: 600; }
.page-head .desc { margin-top: 12px; color: var(--ink-2); font-size: 17px; max-width: 36em; }
.crumbs { font-family: var(--f-sans); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.crumbs a:hover { color: var(--accent); }

/* Article */
.article-head { padding: 36px 0 0; }
.article-head .inner { max-width: 780px; margin: 0 auto; text-align: center; }
.article-head h1 { font-size: clamp(32px, 4.6vw, 54px); font-weight: 600; margin-top: 12px; }
.article-head .dek { font-size: clamp(17px, 1.8vw, 21px); margin-top: 14px; line-height: 1.4; }
.byline { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.byline .who { font-family: var(--f-sans); font-size: 13px; text-align: left; }
.byline .who b { font-weight: 700; }
.byline .who .role { color: var(--muted); font-size: 12px; display: block; }
.byline .meta { margin-left: 8px; }
.article-hero { max-width: 980px; margin: 28px auto 0; padding-inline: var(--gutter); }
.article-hero figure { margin: 0; }
.article-hero img { width: 100%; height: auto; }
figcaption { font-family: var(--f-sans); font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.article-body { max-width: 700px; margin: 0 auto; padding: 32px var(--gutter) 48px; }
.prose { font-size: 18.5px; line-height: 1.65; }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { font-size: 27px; margin-top: 1.7em; font-weight: 600; }
.prose h3 { font-size: 21px; margin-top: 1.4em; font-weight: 600; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent); font-size: 21px; line-height: 1.4; color: var(--ink); font-style: italic; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .5em; }
.prose figure { margin: 1.8em 0; }
.prose figure.wide { margin-inline: -60px; }
.prose hr { border: 0; text-align: center; margin: 2em 0; }
.prose hr::after { content: "\2022 \2022 \2022"; color: var(--muted); letter-spacing: .6em; font-size: 14px; }
.prose > p:first-of-type::first-letter { font-size: 3.4em; float: left; line-height: .8; padding: .1em .1em 0 0; font-weight: 600; }
.prose pre { font-family: ui-monospace, Menlo, monospace; font-size: 13px; overflow-x: auto; background: var(--surface); padding: 12px; }
.article-foot { max-width: 700px; margin: 0 auto; padding: 0 var(--gutter) 48px; }
.article-foot .tags { margin-top: 0; }
.origin { font-family: var(--f-sans); font-size: 12px; color: var(--muted); margin-top: 18px; }
.author-box { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start; margin-top: 28px; padding: 20px; background: var(--surface); }
.author-box .name { font-size: 18px; font-weight: 600; }
.author-box .role { font-family: var(--f-sans); font-size: 12px; color: var(--muted); }
.author-box p { font-size: 14.5px; color: var(--ink-2); margin-top: 8px; }
.related { border-top: 1px solid var(--rule); padding: 32px 0 52px; }

/* Contributors / author */
.author-head { display: grid; grid-template-columns: 120px 1fr; gap: 32px; align-items: start; padding: 36px 0 24px; border-bottom: 1px solid var(--rule); }
.author-head h1 { font-size: clamp(32px, 4.2vw, 50px); font-weight: 600; }
.author-head .role { font-family: var(--f-sans); font-size: 13px; color: var(--muted); margin-top: 6px; letter-spacing: .02em; }
.author-head .desc { margin-top: 12px; color: var(--ink-2); font-size: 16.5px; max-width: 40em; }
.author-grid { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start; }
.focus { list-style: none; margin-top: 8px; display: grid; gap: 6px; font-size: 15px; }
.focus li { border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.people { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

/* Newsletter page / about */
.two-col { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: start; }
.prose--page { font-size: 17.5px; }
.prose--page > p:first-of-type::first-letter { all: unset; }
.panel { background: var(--surface); padding: 24px; border-top: 3px solid var(--accent); }
.panel h3 { font-family: var(--f-sans); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.panel p { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.panel form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.panel input { flex: 1 1 180px; font-family: var(--f-sans); font-size: 14px; padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: 2px; background: var(--paper); color: var(--ink); }
.panel .btn { font-family: var(--f-sans); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 2px; }
.panel .btn:hover { background: var(--accent); color: var(--on-accent); }
.panel .fine { font-family: var(--f-sans); font-size: 12px; color: var(--muted); margin-top: 10px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 15.5px; margin-top: 10px; }
.dl dt { font-family: var(--f-sans); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.dl dd { margin: 0; color: var(--ink-2); }

/* Footer */
.footer { border-top: 3px solid var(--rule-strong); padding: 36px 0 24px; font-family: var(--f-sans); font-size: 13px; color: var(--ink-2); }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer .lockup { display: flex; align-items: center; gap: 12px; }
.footer .lockup img { width: 36px; filter: var(--mark-filter); }
.footer .wordmark { font-family: var(--f-serif); font-weight: 700; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.footer p { margin-top: 10px; max-width: 34em; font-family: var(--f-serif); font-size: 15px; color: var(--ink-2); }
.footer h4 { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin-bottom: 12px; }
.footer ul { list-style: none; display: grid; gap: 8px; }
.footer a:hover { color: var(--accent); }
.footer .bottom { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.foot-form { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; max-width: 420px; }
.foot-form input { flex: 1 1 180px; font-family: var(--f-sans); font-size: 13px; padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: 2px; background: var(--paper); color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .top { grid-template-columns: 1fr; }
  .top__side { border-left: 0; padding-left: 0; margin-top: 28px; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--rules > * + * { border-left: 0; padding-left: 0; margin-left: 0; }
  .research, .newsletter, .about-strip, .two-col, .author-grid { grid-template-columns: 1fr; }
  .people { grid-template-columns: 1fr; }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .prose figure.wide { margin-inline: 0; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .topbar .est, .theme-label { display: none; }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .row .thumb { order: -1; }
  .side-list li { grid-template-columns: 1fr 72px; }
  .author-head { grid-template-columns: 1fr; }
  .footer .cols { grid-template-columns: 1fr; }
  .prose { font-size: 17px; }
  .masthead .mark { width: 44px; }
  .masthead .lockup { gap: 12px; }
}
