/* =========================================================================
   Oxford Infrastructure — Ghost theme styles (handoff Part 5)
   Restrained editorial register. Hierarchy by scale and weight, not colour.
   ========================================================================= */

:root {
  /* 5.1 palette */
  --navy: #0a1628;
  --burgundy: #7c1c2e;
  --burgundy-deep: #5a0e20;
  --gold: #b08d57;
  --gold-light: #c8a882;
  --cream: #faf7f1;
  --paper: #ffffff;
  --ink: #14181f;
  --ink-soft: #2a3140;
  --muted: #5a6478;
  --rule: #e4ddd0;

  /* 5.2 type */
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", Arial, Helvetica, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.72;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--burgundy); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---- shared layout ---- */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 56px; }
.wrap-wide { max-width: 1180px; margin: 0 auto; padding: 0 56px; }
@media (max-width: 720px) {
  .wrap, .wrap-wide { padding: 0 24px; }
  body { font-size: 17px; }
}

.label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--muted);
}
.caption {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* Centered section header with side rules (Foreign Affairs convention) */
.section-rule {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 28px;
}
.section-rule::before,
.section-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gold);
  opacity: 0.45;
}
.section-rule span {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--muted);
}

/* ---- masthead / nav ---- */
.site-head {
  background: var(--navy);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-head .wrap-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 22px;
}
.site-mark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--cream);
  letter-spacing: -0.01em;
}
.site-mark em { color: var(--cream); font-style: italic; }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.site-nav a:hover { color: var(--cream); text-decoration: none; }
.btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 3px;
  display: inline-block;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-gold,
.site-nav a.btn-gold { background: var(--gold); color: #ffffff; border: 1px solid #ffffff; box-shadow: 0 0 0 1px rgba(255,255,255,0.25); }
.btn-gold:hover,
.site-nav a.btn-gold:hover { background: var(--gold-light); color: #ffffff; text-decoration: none; filter: brightness(1.15); box-shadow: 0 0 0 2px rgba(255,255,255,0.45); }
.btn-ghost { border-color: rgba(200,168,130,0.4); color: var(--gold-light); }
.btn-ghost:hover { border-color: var(--gold-light); text-decoration: none; }

/* ---- hero / landing ---- */
.hero { background: var(--navy); color: var(--cream); }
.hero .wrap-wide { padding-top: 84px; padding-bottom: 92px; }
.hero h1 {
  font-family: var(--serif);
  font-size: 58px;
  line-height: 1.06;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 18px 0 0;
  max-width: 16ch;
}
.hero h1 em { color: var(--gold); font-style: italic; }
.hero .lede {
  font-size: 22px;
  line-height: 1.6;
  color: rgba(250,247,241,0.82);
  margin: 22px 0 0;
  max-width: 54ch;
}
.hero .cta { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .hero h1 { font-size: 38px; }
  .hero .lede { font-size: 18px; }
}

/* ---- home hero: brief scroll freeze + headline reveal ---- */
html.oin-freeze, html.oin-freeze body { overflow: hidden; }
.hero.oin-anim h1 { opacity: 0; transform: translateY(20px); }
.hero.oin-anim.oin-revealed h1 {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}
@media (prefers-reduced-motion: reduce) {
  .hero.oin-anim h1,
  .hero.oin-anim.oin-revealed h1 { opacity: 1; transform: none; transition: none; }
}

/* ---- issue list ---- */
.section { padding: 64px 0; }
.section.alt { background: var(--cream); }
.issue-list { list-style: none; margin: 0; padding: 0; }
.issue-item { padding: 26px 0; border-bottom: 1px solid var(--rule); }
.issue-item:last-child { border-bottom: none; }
.issue-item .meta {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--burgundy);
}
.issue-item h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  margin: 8px 0 6px;
}
.issue-item h2 a { color: var(--ink); }
.issue-item h2 a:hover { color: var(--burgundy); text-decoration: none; }
.issue-item .excerpt { color: var(--ink-soft); font-size: 17px; margin: 0; }

/* ---- article / issue page ---- */
.article-head { background: var(--navy); color: var(--cream); }
.article-head .wrap { padding-top: 70px; padding-bottom: 56px; }
.article-head .meta {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold-light);
}
.article-head h1 {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 16px 0 0;
}
.article-body { padding: 56px 0 80px; }
.article-body p { margin: 0 0 1.35em; }
.article-body h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  margin: 2em 0 0.6em;
}
.article-body h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 1.6em 0 0.5em;
}
.article-body blockquote {
  margin: 1.6em 0;
  padding: 6px 0 6px 24px;
  border-left: 2px solid var(--gold);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 21px;
}
.article-body a { text-decoration: underline; text-underline-offset: 2px; }
.article-body img { margin: 1.6em auto; border-radius: 2px; }
.article-body hr { border: none; border-top: 1px solid var(--rule); margin: 2.4em 0; }
/* Drop cap on the opening paragraph — one per article (5.4) */
.article-body > p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.4em;
  line-height: 0.86;
  float: left;
  padding: 6px 10px 0 0;
  color: var(--burgundy);
  font-weight: 500;
}

/* ---- members / gate ---- */
.gate {
  margin: 40px 0;
  padding: 36px 40px;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-align: center;
}
.gate h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 8px;
}
.gate p { color: var(--ink-soft); margin: 0 0 18px; font-size: 16px; }

/* ---- footer ---- */
.site-foot {
  background: var(--navy);
  color: rgba(250,247,241,0.7);
  padding: 50px 0 60px;
  font-family: var(--sans);
  font-size: 13px;
}
.site-foot a { color: var(--gold-light); }
.site-foot .cols {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.site-foot .mark {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--cream);
  margin-bottom: 8px;
}
.site-foot .sectors { display: flex; gap: 14px; flex-wrap: wrap; }
.site-foot .colophon { margin-top: 36px; font-size: 11px; opacity: 0.6; }

/* ---- pagination ---- */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 0;
  font-family: var(--sans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---- page (about / methodology) ---- */
.page-head .wrap { padding-top: 64px; padding-bottom: 12px; }
.page-head h1 {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 10px 0 0;
}
.page-body { padding: 30px 0 80px; }
.page-body p { margin: 0 0 1.3em; }

/* ---- Koenig editor card widths (required by Ghost) ---- */
.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin-left: 50%;
  transform: translateX(-50%);
  max-width: 1100px;
}
.kg-width-full {
  position: relative;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  max-width: none;
}
.kg-width-full img { width: 100%; }
figure.kg-card { margin: 1.6em 0; }
figcaption { font-family: var(--sans); font-size: 13px; color: var(--muted); text-align: center; margin-top: 8px; }
.kg-embed-card { display: flex; justify-content: center; }
.kg-bookmark-card a { text-decoration: none; }

/* ---- Ghost custom fonts (admin) override brand defaults if set ---- */
:root {
  --serif: var(--gh-font-heading, "Lora", Georgia, "Times New Roman", serif);
  --sans: var(--gh-font-body, "Inter", Arial, Helvetica, sans-serif);
}

/* ---- weekly issue (oin-* blocks pasted via HTML card) ---- */
.oin-issue { width: 100%; }
.oin-issue .oin-dropcap { -webkit-font-smoothing: antialiased; }
.oin-issue h2.oin-dev-headline { letter-spacing: -0.01em; }
.oin-issue .oin-wim p { margin-top: 6px; }
@media (max-width: 720px) {
  .oin-issue { font-size: 17px !important; }
  .oin-issue .oin-dropcap { font-size: 42px !important; }
}
/* The article body already constrains width; let the issue own its rhythm */
.article-body .oin-issue { max-width: 100%; }

/* ---- timed subscribe prompt ---- */
.oin-subprompt {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--navy);
  color: var(--cream);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 20px 22px 22px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  z-index: 1000;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.oin-subprompt.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.oin-subprompt .x {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.oin-subprompt .x:hover { color: var(--cream); }
.oin-subprompt h4 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 12px;
}
.oin-subprompt ul { list-style: none; margin: 0 0 16px; padding: 0; }
.oin-subprompt li {
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(250,247,241,0.85);
  padding: 4px 0 4px 18px;
  position: relative;
}
.oin-subprompt li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  color: var(--gold-light);
}
.oin-subprompt a.cta {
  display: inline-block;
  background: var(--gold);
  color: #ffffff;
  border: 1px solid #ffffff;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 3px;
}
.oin-subprompt a.cta:hover { background: var(--gold-light); text-decoration: none; }

/* ---- full-screen subscribe modal (stage 1, ~30s) — FP style ---- */
.oin-modal {
  position: fixed;
  inset: 0;
  background: rgba(10,13,18,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.oin-modal.show { opacity: 1; pointer-events: auto; }
.oin-modal .panel {
  position: relative;
  background: #ffffff;
  max-width: 560px;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  text-align: center;
}
.oin-modal .bar { height: 6px; background: var(--navy); }
.oin-modal .inner { padding: 42px 48px 40px; }
.oin-modal .x {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--navy);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
}
.oin-modal .x:hover { opacity: 1; }
.oin-modal .brand {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--navy);
}
.oin-modal h3 {
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.28;
  font-weight: 700;
  color: var(--navy);
  margin: 16px 0 14px;
}
.oin-modal .sub {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--ink-soft);
  margin: 0 0 14px;
}
.oin-modal ul {
  list-style: none;
  margin: 0 auto 4px;
  padding: 0;
  display: inline-block;
  text-align: left;
}
.oin-modal li {
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink);
  padding: 4px 0 4px 24px;
  position: relative;
}
.oin-modal li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  color: var(--navy);
  font-weight: 700;
}
.oin-modal hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 24px 0 16px;
}
.oin-modal .fineprint {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 20px;
}
/* Subscribe button: identical to the main-site .btn .btn-gold, sized up */
.oin-modal .btn { padding: 13px 36px; font-size: 13px; }
.oin-modal .signin {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin: 18px 0 0;
}
.oin-modal .signin a { color: var(--gold); font-weight: 600; }

/* ---- error ---- */
.error-wrap { text-align: center; padding: 120px 0; }
.error-code {
  font-family: var(--serif);
  font-size: 72px;
  color: var(--burgundy);
  font-weight: 500;
}
