/* ==========================================================
   The History of Nauru — main stylesheet
   ========================================================== */

:root {
  --ink: #17222c;
  --ink-soft: #3a4752;
  --muted: #65717b;
  --paper: #fbf9f4;
  --paper-2: #f2eee4;
  --card: #ffffff;
  --line: #e2dccf;
  --navy: #0d2c44;
  --navy-2: #173f5f;
  --gold: #d9a21b;
  --gold-deep: #a87a0c;
  --gold-soft: #f6e7bd;

  --early: #2e6b62;
  --colonial: #97562a;
  --modern: #1f5486;

  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 1180px;
  --measure: 42rem;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(13, 44, 68, 0.05), 0 6px 20px rgba(13, 44, 68, 0.07);
  --header-h: 68px;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--navy-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-deep); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.5em;
}

p { margin: 0 0 1.1em; }

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--radius);
  font-family: var(--sans); font-size: 0.9rem; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

.kicker {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.9rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251, 249, 244, 0.94);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; border-radius: 5px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.brand-sub {
  font-family: var(--sans); font-size: 0.66rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); margin-top: 3px;
}

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav a {
  display: block; padding: 8px 12px;
  font-family: var(--sans); font-size: 0.9rem; font-weight: 500;
  color: var(--ink-soft); text-decoration: none; border-radius: var(--radius);
  position: relative;
}
.site-nav a:hover { color: var(--ink); background: var(--paper-2); }
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px;
  height: 2px; background: var(--gold); border-radius: 2px;
}

.nav-toggle {
  display: none;
  align-items: center; gap: 8px;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 12px; cursor: pointer;
  font-family: var(--sans); font-size: 0.9rem; font-weight: 500; color: var(--ink);
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px;
  position: relative; transition: transform 0.2s ease;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-open .nav-toggle-bars { background: transparent; }
.nav-open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600;
  text-decoration: none; border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-primary { background: var(--gold); color: #1b1405; }
.btn-primary:hover { background: #e8b53a; color: #1b1405; }
.btn-ghost { border-color: rgba(255, 255, 255, 0.55); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn-outline { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn-outline:hover { border-color: var(--ink-soft); color: var(--ink); }

.text-link {
  font-family: var(--sans); font-size: 0.92rem; font-weight: 600;
  color: var(--navy-2); text-decoration: none;
}
.text-link:hover { color: var(--gold-deep); }
.text-link::after { content: " \2192"; }

/* ---------- Media & image placeholders ---------- */

.media {
  position: relative; overflow: hidden;
  background: var(--paper-2);
  aspect-ratio: 3 / 2;
}
.media img { width: 100%; height: 100%; object-fit: cover; }
.media.wide { aspect-ratio: 16 / 9; }
.media.square { aspect-ratio: 1 / 1; }
.media.portrait { aspect-ratio: 4 / 5; }
.media.map { aspect-ratio: 4 / 3; background: #fff; }
.media.map img { object-fit: contain; }

/* Portrait photos (hn6 warrior, hn11 Ellis, hn16 DeRoburt): keep faces in frame when cropped to landscape */
img[src*="/hn6."], img[src*="/hn11."], img[src*="/hn16."] { object-position: center 22%; }

/* Show the whole photo (used for tall portraits in wide banners) */
.media.contain { background: #e7e1d4; }
.media.contain img { object-fit: contain; }

.img-missing img { display: none; }
.img-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 16px; text-align: center;
  background-color: #e9e3d5;
  background-image: repeating-linear-gradient(135deg, rgba(13, 44, 68, 0.05) 0 12px, transparent 12px 24px);
  color: var(--ink-soft);
  font-family: var(--sans);
}
.ph-code {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em;
  background: var(--navy); color: #fff; padding: 3px 9px; border-radius: 999px;
}
.ph-desc { font-size: 0.82rem; max-width: 32ch; line-height: 1.4; }

/* ---------- Home hero ---------- */

.hero {
  position: relative; isolation: isolate;
  min-height: min(82vh, 760px);
  display: flex; align-items: flex-end;
  color: #fff; background: var(--navy);
}
.hero-media { position: absolute; inset: 0; z-index: -2; aspect-ratio: auto; background: var(--navy); }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(8, 26, 41, 0.15) 0%, rgba(8, 26, 41, 0.45) 45%, rgba(8, 26, 41, 0.88) 100%);
}
.hero-media .img-placeholder,
.page-hero-media .img-placeholder {
  background-color: #123550;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 14px, transparent 14px 28px);
  color: rgba(255, 255, 255, 0.75);
  justify-content: flex-start; align-items: flex-end;
  padding: calc(var(--header-h) - 40px) 24px 24px;
}
.hero-media .ph-code, .page-hero-media .ph-code { background: rgba(255, 255, 255, 0.16); }

.hero-content { padding: 140px 0 72px; max-width: 760px; }
.hero .kicker { color: var(--gold); }
.hero h1 {
  color: #fff;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 600; letter-spacing: -0.02em; margin-bottom: 0.35em;
}
.hero-lead {
  font-size: clamp(1.1rem, 1.8vw, 1.3rem); line-height: 1.55;
  color: rgba(255, 255, 255, 0.9); max-width: 40rem; margin-bottom: 2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero h1, .hero-lead, .hero .kicker,
.page-hero h1, .page-hero .standfirst, .page-hero .era-badge, .page-hero .breadcrumb {
  text-shadow: 0 1px 14px rgba(8, 26, 41, 0.55);
}

/* ---------- Page hero (era pages) ---------- */

.page-hero {
  position: relative; isolation: isolate;
  min-height: 460px; display: flex; align-items: flex-end;
  color: #fff; background: var(--navy);
}
.page-hero-media { position: absolute; inset: 0; z-index: -2; aspect-ratio: auto; background: var(--navy); }
.page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(8, 26, 41, 0.2) 0%, rgba(8, 26, 41, 0.9) 100%);
}
.page-hero-content { padding: 120px 0 56px; max-width: 780px; }
.page-hero h1 { color: #fff; font-size: clamp(2.4rem, 5vw, 3.8rem); margin-bottom: 0.3em; }
.page-hero .standfirst { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: rgba(255, 255, 255, 0.9); margin: 0; max-width: 42rem; }
.page-hero .kicker { color: var(--gold); }

.era-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 1rem;
}
.era-badge::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.page-hero .era-badge { color: var(--gold); }

.breadcrumb { font-family: var(--sans); font-size: 0.82rem; margin-bottom: 1.4rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; opacity: 0.6; }
.breadcrumb a { color: inherit; text-decoration: none; opacity: 0.85; }
.breadcrumb a:hover { opacity: 1; text-decoration: underline; }
.page-hero .breadcrumb { color: rgba(255, 255, 255, 0.85); }
.page-header .breadcrumb, .article-header .breadcrumb { color: var(--muted); }

/* ---------- Simple page header ---------- */

.page-header { padding: 72px 0 40px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.page-header h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); }
.page-header .standfirst { font-size: 1.2rem; color: var(--ink-soft); max-width: 44rem; margin: 0; }

/* ---------- Sections ---------- */

.section { padding: 84px 0; }
.section-alt { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-dark { background: var(--navy); color: #e8eef3; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .kicker { color: var(--gold); }
.section-dark .section-head p { color: rgba(232, 238, 243, 0.75); }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 40px; flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); margin: 0; }
.section-head p { color: var(--muted); margin: 10px 0 0; max-width: 40rem; }
.section-head .kicker { margin-bottom: 0.6rem; }

/* ---------- Intro + facts (home) ---------- */

.intro-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.intro-text .lead { font-size: 1.35rem; line-height: 1.55; color: var(--ink); }
.intro-text p { color: var(--ink-soft); }

.factbox {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.factbox .media { border-bottom: 1px solid var(--line); }
.factbox-body { padding: 24px 26px 18px; }
.factbox h3 {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; font-family: var(--sans); font-size: 0.9rem; }
.facts dt, .facts dd { padding: 9px 0; border-top: 1px solid var(--line); margin: 0; }
.facts dt { color: var(--muted); padding-right: 18px; }
.facts dd { color: var(--ink); font-weight: 500; }
.facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; }

/* ---------- Cards ---------- */

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }

.era-card, .article-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--ink);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.era-card:hover, .article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.era-card .media, .article-card .media { aspect-ratio: 3 / 2; }
.era-card-body, .article-card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.era-card { border-top: 4px solid var(--era, var(--gold)); }
.era-card .era-num {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--era, var(--gold-deep));
}
.era-card h3 { font-size: 1.6rem; margin: 8px 0 4px; }
.era-card .dates { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.era-card p { color: var(--ink-soft); font-size: 1rem; }
.era-card .text-link { margin-top: auto; color: var(--era, var(--navy-2)); }

.tag {
  align-self: flex-start;
  font-family: var(--sans); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--era, var(--muted));
  margin-bottom: 10px;
}
.article-card h3 { font-size: 1.3rem; line-height: 1.25; margin-bottom: 10px; }
.article-card p { color: var(--ink-soft); font-size: 0.98rem; margin-bottom: 16px; }
.card-meta { margin-top: auto; font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }

.era-early { --era: var(--early); }
.era-colonial { --era: var(--colonial); }
.era-modern { --era: var(--modern); }

/* ---------- Timeline strip (home) ---------- */

.strip {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0;
  position: relative;
}
.strip::before {
  content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px;
  background: rgba(255, 255, 255, 0.2);
}
.strip li { position: relative; padding: 36px 16px 0 0; }
.strip li::before {
  content: ""; position: absolute; top: 4px; left: 0;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--navy); border: 3px solid var(--era, var(--gold));
}
.strip .yr { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: #fff; margin-bottom: 6px; }
.strip .ev { font-family: var(--sans); font-size: 0.86rem; line-height: 1.45; color: rgba(232, 238, 243, 0.85); }
.section-dark .era-early { --era: #5fb3a6; }
.section-dark .era-colonial { --era: #e0925a; }
.section-dark .era-modern { --era: #6fa8e0; }
.section-dark .text-link { color: var(--gold); }

/* ---------- Callouts ---------- */

.callout {
  background: var(--gold-soft); border-left: 4px solid var(--gold);
  padding: 26px 30px; border-radius: 0 var(--radius) var(--radius) 0;
}
.callout h3 { font-size: 1.25rem; margin-bottom: 8px; }
.callout p:last-child { margin-bottom: 0; }
.callout .kicker { margin-bottom: 0.5rem; }

.home-callout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }

/* ---------- Era page layout ---------- */

.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 72px;
  padding: 64px 24px 24px;
}
.sidebar { position: relative; }
.sidebar-inner { position: sticky; top: calc(var(--header-h) + 28px); display: flex; flex-direction: column; gap: 28px; }

.toc h2, .side-box h2 {
  font-family: var(--sans); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a {
  display: block; padding: 6px 0 6px 16px; margin-left: -2px;
  border-left: 2px solid transparent;
  font-family: var(--sans); font-size: 0.88rem; line-height: 1.4;
  color: var(--ink-soft); text-decoration: none;
}
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); font-weight: 600; border-left-color: var(--era, var(--gold)); }

.side-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }

.box-title,
.prose .box-title {
  font-family: var(--sans); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 12px; line-height: 1.3;
}
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 2em 0 2.6em; }
.summary-grid .facts { font-size: 0.86rem; }

.side-links { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 0.9rem; }
.side-links li { padding: 9px 0; border-top: 1px solid var(--line); line-height: 1.4; }
.side-links li:first-child { border-top: 0; padding-top: 0; }
.side-links a { color: var(--ink); text-decoration: none; font-weight: 500; }
.side-links a:hover { color: var(--gold-deep); text-decoration: underline; }

.era-nav-wrap { padding-top: 56px; }
.keydates { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 0.86rem; }
.keydates li { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); line-height: 1.4; }
.keydates li:first-child { border-top: 0; }
.keydates b { color: var(--era, var(--gold-deep)); font-weight: 700; }

/* ---------- Prose ---------- */

.prose { max-width: var(--measure); font-size: 1.14rem; line-height: 1.75; }
.prose > p:first-of-type.lede { font-size: 1.32rem; line-height: 1.6; color: var(--ink); }
.prose p { color: #25313b; }
.prose h2 {
  font-size: 1.95rem; margin: 2.4em 0 0.7em; padding-top: 0.2em; clear: both;
}
.prose h2:first-child { margin-top: 0; }
.prose h2 .h-num {
  display: block; font-family: var(--sans); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--era, var(--gold-deep));
  margin-bottom: 10px;
}
.prose h3 { font-size: 1.35rem; margin: 1.8em 0 0.6em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose blockquote {
  margin: 2em 0; padding: 0 0 0 24px; border-left: 3px solid var(--gold);
  font-size: 1.3rem; line-height: 1.5; font-style: italic; color: var(--ink);
}

.figure { margin: 2.2em 0; }
.figure .media { border-radius: var(--radius); }
.figure figcaption {
  font-family: var(--sans); font-size: 0.84rem; line-height: 1.5; color: var(--muted);
  padding-top: 10px; border-bottom: 1px solid var(--line); padding-bottom: 12px;
}
.figure-wide { margin-left: -4%; margin-right: -4%; }
.figure-inset { float: right; width: 44%; margin: 0.4em 0 1.2em 2em; }
.figure-inset .media { aspect-ratio: 4 / 5; }

.inline-box {
  margin: 2.2em 0; padding: 24px 28px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 1.02rem; clear: both;
}
.inline-box h3 { margin-top: 0; font-size: 1.2rem; }
.inline-box p:last-child, .inline-box ul:last-child { margin-bottom: 0; }
.inline-box .kicker { margin-bottom: 0.4rem; }
.clan-list { columns: 2; column-gap: 32px; list-style: none; padding: 0 !important; font-family: var(--sans); font-size: 0.95rem; }
.clan-list li { break-inside: avoid; padding: 4px 0; border-bottom: 1px dotted var(--line); }

.readmore {
  display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center;
  margin: 2.2em 0; padding: 14px; clear: both;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.readmore:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); }
.readmore .media { aspect-ratio: 4 / 3; border-radius: 4px; }
.readmore .ph-desc { display: none; }
.readmore-label {
  display: block; font-family: var(--sans); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--era, var(--gold-deep)); margin-bottom: 6px;
}
.readmore-title { display: block; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; line-height: 1.25; }
.readmore-desc { display: block; font-family: var(--sans); font-size: 0.86rem; color: var(--muted); margin-top: 6px; line-height: 1.45; }

/* ---------- Era prev/next ---------- */

.era-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.era-nav a {
  display: block; padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); text-decoration: none; color: var(--ink);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.era-nav a:hover { box-shadow: var(--shadow); border-color: var(--ink-soft); color: var(--ink); }
.era-nav .dir { display: block; font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.era-nav .ttl { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; }
.era-nav .next { text-align: right; }
.era-nav .next:only-child { grid-column: 2; }

/* ---------- Article pages ---------- */

.article-header { padding: 56px 0 32px; }
.article-header .inner { max-width: 820px; margin: 0 auto; }
.article-header h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
.article-header .dek { font-size: 1.3rem; line-height: 1.5; color: var(--ink-soft); margin-bottom: 22px; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-family: var(--sans); font-size: 0.85rem; color: var(--muted);
  padding-top: 18px; border-top: 1px solid var(--line);
}
.article-meta span + span::before { content: "\00b7"; margin-right: 18px; }
.article-lead { max-width: 1040px; margin: 0 auto 8px; padding: 0 24px; }
.article-lead .media { border-radius: var(--radius); }
.article-lead figcaption { font-family: var(--sans); font-size: 0.84rem; color: var(--muted); padding: 10px 0 0; }
.article-body { padding: 40px 24px 24px; }
.article-body .prose { margin: 0 auto; }

.further {
  margin-top: 3em; padding-top: 1.6em; border-top: 2px solid var(--ink);
  font-family: var(--sans); font-size: 0.92rem;
}
.further h2 { font-family: var(--sans); font-size: 0.8rem !important; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 1em !important; }
.further ul { padding-left: 1.1em; }
.further li { color: var(--ink-soft); }

/* ---------- Filter chips ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.chip {
  font-family: var(--sans); font-size: 0.88rem; font-weight: 500;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-soft);
}
.chip:hover { border-color: var(--ink-soft); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.is-hidden { display: none !important; }

/* ---------- Full timeline ---------- */

.timeline { position: relative; max-width: 860px; margin: 0 auto; }
.timeline::before { content: ""; position: absolute; left: 140px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-era {
  position: relative; margin: 48px 0 24px 162px;
  font-family: var(--sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--era);
}
.tl-era:first-child { margin-top: 0; }
.tl-item { display: grid; grid-template-columns: 120px 1fr; gap: 42px; position: relative; padding: 14px 0; }
.tl-item::before {
  content: ""; position: absolute; left: 134px; top: 22px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--era, var(--gold));
}
.tl-year { text-align: right; font-family: var(--serif); font-size: 1.2rem; white-space: nowrap; font-weight: 600; color: var(--ink); padding-top: 4px; }
.tl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.tl-card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.tl-card p { font-size: 0.98rem; color: var(--ink-soft); margin-bottom: 0; }
.tl-card .text-link { display: inline-block; margin-top: 10px; font-size: 0.85rem; }

/* ---------- About page ---------- */

.credits-table, .data-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.88rem; }
.credits-table th, .credits-table td, .data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.credits-table th, .data-table th { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.credits-table td:first-child, .data-table td:first-child { font-weight: 700; white-space: nowrap; }
.credits-table td { line-height: 1.5; }
.table-wrap { overflow-x: auto; }
.table-wrap.narrow { max-width: 860px; }

/* ---------- Leaders page ---------- */

.leader-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.leader-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.leader-card .media { aspect-ratio: 4 / 5; }
.leader-card .media img { object-position: center 20%; }
.leader-body { padding: 16px 18px 20px; }
.leader-role {
  display: block; font-family: var(--sans); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--era, var(--gold-deep)); margin-bottom: 6px;
}
.leader-body h3 { font-size: 1.2rem; margin-bottom: 4px; }
.leader-term { display: block; font-family: var(--sans); font-size: 0.84rem; font-weight: 500; color: var(--ink-soft); margin-bottom: 10px; }
.leader-body p { font-size: 0.95rem; line-height: 1.5; color: var(--ink-soft); margin: 0; }
.subhead { font-size: 1.45rem; margin: 56px 0 16px; }

a.leader-card { text-decoration: none; color: var(--ink); transition: transform 0.25s ease, box-shadow 0.25s ease; }
a.leader-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.leader-body { display: flex; flex-direction: column; flex: 1; }
.leader-body p { margin-bottom: 12px; }
.bio-link {
  margin-top: auto; font-family: var(--sans); font-size: 0.82rem; font-weight: 600;
  color: var(--era, var(--navy-2));
}
.bio-link::after { content: " \2192"; }

/* Initials badge, shown when a leader has no photo */
.monogram {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 2.6rem; letter-spacing: 0.03em;
  color: #fff;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.12), transparent 60%),
    linear-gradient(155deg, var(--era, var(--navy-2)) 0%, var(--navy) 100%);
}
.monogram::after {
  content: ""; position: absolute; left: 50%; top: calc(50% + 1.9rem);
  width: 28px; height: 2px; background: var(--gold); transform: translateX(-50%);
}

a.chip { text-decoration: none; display: inline-block; }

/* Administrator lists */
.admin-groups { columns: 2; column-gap: 24px; }
.admin-group {
  break-inside: avoid; margin: 0 0 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.page-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.admin-group-head { padding: 18px 22px 14px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.admin-group-head h3 { font-size: 1.2rem; margin: 0 0 3px; }
.admin-group-head p { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); margin: 0; }
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-list li + li { border-top: 1px solid var(--line); }
.admin-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 11px 22px; text-decoration: none; color: var(--ink); transition: background 0.15s ease;
}
.admin-row:hover { background: var(--paper); color: var(--ink); }
.admin-row:hover .admin-name { text-decoration: underline; text-underline-offset: 3px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy); color: var(--gold);
  font-family: var(--serif); font-weight: 600; font-size: 0.92rem; letter-spacing: 0.03em;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: center 20%; box-shadow: 0 0 0 2px var(--gold); }
.admin-name { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.02rem; line-height: 1.3; }
.admin-title { display: block; font-family: var(--sans); font-size: 0.78rem; color: var(--muted); margin-top: 1px; }
.admin-term { font-family: var(--sans); font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap; text-align: right; }

/* Biography pop-up */
html:has(.bio-dialog[open]) { overflow: hidden; }
.bio-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  padding: 0; border: 0; border-radius: 10px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 24px 60px rgba(8, 26, 41, 0.35);
  overflow: hidden;
}
.bio-dialog::backdrop { background: rgba(8, 26, 41, 0.62); }
.bio-inner { position: relative; max-height: inherit; overflow-y: auto; }
.bio-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.bio-close:hover { background: var(--paper-2); }
.bio-head {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 22px; align-items: center;
  padding: 28px 64px 24px 28px; background: var(--paper-2); border-bottom: 1px solid var(--line);
}
.bio-photo { aspect-ratio: 4 / 5; border-radius: 6px; }
.bio-photo img { object-position: center 20%; }
.bio-photo .monogram { font-size: 2rem; }
.bio-photo .monogram::after { top: calc(50% + 1.5rem); width: 22px; }
.bio-name { font-size: 1.75rem; margin: 2px 0 6px; }
.bio-term, .bio-life { display: block; font-family: var(--sans); font-size: 0.88rem; color: var(--ink-soft); }
.bio-life { color: var(--muted); margin-top: 3px; }
.bio-text { padding: 24px 28px 6px; font-size: 1.06rem; line-height: 1.7; }
.bio-text p { margin: 0 0 1em; color: #25313b; }

/* All biographies listed on the page; replaced by the pop-up in browsers that support it */
.js-dialog .bios { display: none; }
.bio { max-width: 44rem; padding: 22px 0; border-top: 1px solid var(--line); }
.bio h3 { font-size: 1.3rem; margin-bottom: 4px; }
.bio-meta { font-family: var(--sans); font-size: 0.86rem; color: var(--muted); }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy); color: rgba(232, 238, 243, 0.8); padding: 64px 0 32px; margin-top: 84px; font-family: var(--sans); font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.site-footer .brand { color: #fff; margin-bottom: 16px; }
.site-footer .brand-sub { color: rgba(232, 238, 243, 0.6); }
.site-footer p { max-width: 34ch; line-height: 1.6; }
.site-footer h2 { font-family: var(--sans); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: rgba(232, 238, 243, 0.85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.12); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.82rem; color: rgba(232, 238, 243, 0.6); }

.back-top { display: inline-block; margin-top: 8px; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .site-nav a { padding: 8px 9px; font-size: 0.86rem; }
  .strip { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 28px; }
  .strip::before { display: none; }
}

@media (max-width: 1080px) {
  .leader-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1040px) {
  :root { --header-h: 62px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(13, 44, 68, 0.08);
    display: none;
  }
  .nav-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; padding: 10px 16px 18px; gap: 0; }
  .site-nav a { padding: 12px 8px; font-size: 1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav li:last-child a { border-bottom: 0; }
  .site-nav a[aria-current="page"]::after { left: 8px; right: auto; width: 28px; bottom: 6px; }
}

@media (max-width: 960px) {
  .intro-grid { grid-template-columns: 1fr; gap: 40px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; }
  .sidebar-inner { position: static; }
  .toc { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .home-callout { grid-template-columns: 1fr; }
  .figure-wide { margin-left: 0; margin-right: 0; }
  .admin-groups { columns: 1; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .container { padding: 0 16px; }
  .layout { padding: 40px 16px 16px; }
  .era-nav-wrap { padding-top: 40px; }
  .article-lead, .article-body { padding-left: 16px; padding-right: 16px; }
  .section { padding: 60px 0; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .hero-content { padding: 120px 0 48px; }
  .prose { font-size: 1.06rem; }
  .prose h2 { font-size: 1.6rem; }
  .figure-inset { float: none; width: 100%; margin: 2em 0; }
  .readmore { grid-template-columns: 96px 1fr; gap: 14px; }
  .era-nav { grid-template-columns: 1fr; }
  .era-nav .next:only-child { grid-column: 1; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid { grid-template-columns: 1fr; }
  .leader-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .leader-body { padding: 12px 14px 16px; }
  .leader-body h3 { font-size: 1.05rem; }
  .leader-body p { font-size: 0.88rem; }
  .monogram { font-size: 2rem; }
  .monogram::after { top: calc(50% + 1.5rem); }
  .admin-row { grid-template-columns: 36px minmax(0, 1fr); gap: 4px 12px; padding: 10px 16px; }
  .avatar { width: 36px; height: 36px; grid-row: span 2; }
  .admin-term { grid-column: 2; text-align: left; font-weight: 500; }
  .admin-group-head { padding: 16px 16px 12px; }
  .bio-head { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 20px 58px 18px 18px; }
  .bio-name { font-size: 1.35rem; }
  .bio-text { padding: 18px 18px 4px; font-size: 1rem; }
  .timeline::before { left: 7px; }
  .tl-era { margin-left: 30px; }
  .tl-item { grid-template-columns: 1fr; gap: 6px; padding-left: 30px; }
  .tl-item::before { left: 0; top: 20px; }
  .tl-year { text-align: left; }
  .footer-grid { grid-template-columns: 1fr; }
  .clan-list { columns: 1; }
}
