/* ==========================================================================
   1. Self-Hosted Fonts (public/fonts/*.woff2)
   ========================================================================== */
@font-face {
  font-family: 'Libre Baskerville';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/LibreBaskerville_400Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Libre Baskerville';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/LibreBaskerville_700Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/BarlowCondensed_700Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Inter_400Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/Inter_600SemiBold.woff2') format('woff2');
}

/* ==========================================================================
   2. Design Tokens (src/constants/theme.js)
   ========================================================================== */
:root {
  --ink: #15120F;
  --lacquer: #0E1014;
  --ivory: #F7F0E3;
  --paper: #FFFBF2;
  --marble: #ECE4D6;
  --brass: #B8872F;
  --brass-dark: #76551D;
  --champagne: #E6C982;
  --oxblood: #7A1E20;
  --primary-dark: #4E1214;
  --emerald: #0F5C4A;
  --cobalt: #214E7B;
  --muted: #665E52;
  --hairline: #D8C7A6;
  --text-secondary: #4D463D;
  --border: #8F7440;
  --border-light: #987C44;

  --font-display: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-label: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-none: 0px;
  --radius-card: 2px;
  --sidebar-width: 300px;
  --max-page: 1040px;
  --max-article: 840px;

  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-12: 12px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-2xl: 48px;
}

/* ==========================================================================
   3. Base, Accessibility Utilities & Focus
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--ivory);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

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

a {
  color: var(--oxblood);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-dark);
}

:where(a, button, select, input, [tabindex]):focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 2px;
}

.sidebar :where(a, button):focus-visible,
.headliner-frame :where(a, button):focus-visible {
  outline-color: var(--champagne);
}

@media (forced-colors: active) {
  :where(a, button, select, input, [tabindex]):focus-visible {
    outline: 3px solid Highlight;
  }
  .nav-item[aria-current="page"] {
    border: 2px solid Highlight;
  }
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link {
  position: fixed;
  top: -120px;
  left: var(--sp-12);
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--lacquer);
  color: var(--champagne);
  border: 2px solid var(--champagne);
  font-family: var(--font-label);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--sp-12);
}

/* ==========================================================================
   4. Mobile Top Bar & Lacquer Sidebar / Drawer
   ========================================================================== */
.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  min-height: 56px;
  padding: 6px var(--sp-md);
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  background: var(--marble);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  font-family: var(--font-label);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.menu-btn:hover {
  border-color: var(--oxblood);
  background: var(--ivory);
}

.mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.mobile-brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.15;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--ink);
  color: var(--champagne);
  border: 1px solid var(--brass);
  border-radius: var(--radius-none);
}

.brand-mark--sm {
  width: 32px;
  height: 32px;
}

/* Sidebar as Native Popover Drawer on < 900px */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(var(--sidebar-width), 85dvw);
  max-width: 100dvw;
  height: 100dvh;
  margin: 0;
  padding: var(--sp-lg) var(--sp-md);
  background: var(--lacquer);
  color: var(--ivory);
  border: 0;
  border-inline-end: 1px solid var(--border);
  overflow-y: auto;
  flex-direction: column;
}

.sidebar:is(:popover-open, .\:popover-open, .is-open) {
  display: flex;
}

.sidebar::backdrop {
  background: rgba(14, 16, 20, 0.62);
}

@media (prefers-reduced-motion: no-preference) {
  .sidebar[popover] {
    transition:
      translate 0.22s cubic-bezier(0.22, 1, 0.36, 1),
      overlay 0.22s allow-discrete,
      display 0.22s allow-discrete;
    translate: -100% 0;
  }
  .sidebar[popover]:is(:popover-open, .\:popover-open) {
    translate: 0 0;
  }
  @starting-style {
    .sidebar[popover]:is(:popover-open, .\:popover-open) {
      translate: -100% 0;
    }
  }
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-sm);
}

.sidebar-brand {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-12);
  padding: 8px;
  flex: 1;
  color: var(--ivory);
  text-decoration: none;
  border: 1px solid transparent;
}

.sidebar-brand:hover {
  background: var(--ink);
  border-color: var(--brass-dark);
  color: var(--ivory);
}

.sidebar-brand-copy {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.25;
  color: var(--ivory);
}

.sidebar-brand-tagline {
  margin-top: 4px;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--champagne);
}

.drawer-close {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: var(--ink);
  color: var(--champagne);
  border: 1px solid var(--brass-dark);
  border-radius: var(--radius-none);
  cursor: pointer;
}

.drawer-close:hover {
  border-color: var(--champagne);
}

.sidebar-rule {
  height: 1px;
  border: 0;
  margin: var(--sp-md) 0;
  background: var(--brass-dark);
}

.sidebar-section-label {
  margin: 0 var(--sp-12) var(--sp-sm);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--champagne);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-utility {
  margin-top: auto;
  padding-top: var(--sp-md);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-inline-start: 3px solid transparent;
  color: var(--marble);
  text-decoration: none;
}

.nav-item:hover {
  background: var(--ink);
  border-color: var(--brass-dark);
  color: var(--ivory);
}

.nav-item[aria-current="page"] {
  background: var(--ink);
  border-color: var(--brass-dark);
  border-inline-start-color: var(--brass);
  color: var(--ivory);
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  color: var(--marble);
}

.nav-item[aria-current="page"] .nav-icon {
  background: var(--primary-dark);
  color: var(--champagne);
}

.nav-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nav-title {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-desc {
  margin-top: 2px;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--border-light);
}

.nav-item[aria-current="page"] .nav-desc {
  color: var(--champagne);
}

.edition-strip {
  display: none;
}

@media (min-width: 900px) {
  .mobile-topbar,
  .drawer-close {
    display: none;
  }

  .sidebar {
    display: flex;
    translate: 0 0;
    z-index: 20;
  }

  .page-frame {
    margin-inline-start: var(--sidebar-width);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  .edition-strip {
    display: block;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
  }

  .edition-strip-inner {
    max-width: var(--max-page);
    margin: 0 auto;
    padding: 12px var(--sp-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-md);
  }

  .edition-strip-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .edition-kicker {
    font-family: var(--font-label);
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    color: var(--oxblood);
  }

  .edition-title {
    font-family: var(--font-label);
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: 0.08em;
    color: var(--ink);
  }

  .edition-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 4px 10px;
    font-family: var(--font-label);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--oxblood);
    border: 1px solid var(--hairline);
    background: var(--ivory);
  }

  .edition-link:hover {
    border-color: var(--oxblood);
  }
}

/* ==========================================================================
   5. Main Layout, Breadcrumb, Hero & Answer Callout
   ========================================================================== */
.wrap {
  width: 100%;
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--sp-lg) var(--sp-md) var(--sp-2xl);
  flex: 1;
}

@media (min-width: 900px) {
  .wrap {
    padding: var(--sp-xl) var(--sp-xl) var(--sp-2xl);
  }
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 var(--sp-md);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--text-secondary);
}

.page-hero {
  margin-bottom: var(--sp-lg);
}

.eyebrow,
.section-kicker {
  margin: 0 0 var(--sp-sm);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oxblood);
}

h1 {
  margin: 0 0 var(--sp-md);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.625rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.25;
  color: var(--ink);
}

.answer {
  max-width: var(--max-article);
  margin: 0;
  padding: var(--sp-md) 20px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-inline-start: 4px solid var(--brass);
  border-radius: var(--radius-card);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
}

/* ==========================================================================
   6. Date Controls: Prev/Next + Date Jump Control
   ========================================================================== */
.date-controls {
  display: grid;
  gap: var(--sp-md);
  padding: var(--sp-md) 0;
  margin-bottom: var(--sp-lg);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 780px) {
  .date-controls {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

.datenav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

.btn-outline,
.btn-edition,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-card);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.btn-outline {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--marble);
  border-color: var(--oxblood);
  color: var(--ink);
}

.btn-edition {
  background: var(--marble);
  color: var(--brass-dark);
  border: 1px solid var(--brass);
}

.btn-edition:hover {
  background: var(--champagne);
  color: var(--ink);
}

.btn-primary {
  background: var(--oxblood);
  color: var(--paper);
  border: 1px solid var(--oxblood);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--paper);
}

.date-jump {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--brass);
  border-radius: var(--radius-card);
}

.date-jump-label {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass-dark);
}

.date-jump-fields {
  display: flex;
  gap: 8px;
  align-items: center;
}

.date-jump select {
  min-height: 44px;
  min-width: 0;
  padding: 0 10px;
  background: var(--ivory);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
}

#jump-month {
  flex: 2;
}

#jump-day {
  flex: 1;
}

.btn-jump {
  min-width: 56px;
  padding-inline: 16px;
}

/* ==========================================================================
   7. People Register: Headliner (#1) + Compact Rows (#2-#40) + Badges
   ========================================================================== */
.section-block {
  margin-bottom: var(--sp-xl);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-12);
  padding-bottom: var(--sp-12);
  border-bottom: 2px solid var(--ink);
  margin-bottom: var(--sp-12);
}

.count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  background: var(--marble);
  border: 1px solid var(--border);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.methodology-note {
  max-width: var(--max-article);
  margin: 0 0 var(--sp-lg);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}

.people-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-12);
}

@media (min-width: 1200px) {
  .people-list {
    grid-template-columns: 360px 1fr;
    align-items: start;
    gap: 12px 20px;
  }

  .person-headliner {
    grid-column: 1;
    grid-row: 1 / span 4;
  }

  .person-row:nth-child(-n+5) {
    grid-column: 2;
  }

  /* Ranks #6..#40 flow as a balanced 2-column grid beneath the spotlight */
  .person-row:nth-child(n+6) {
    grid-column: auto;
  }

  .people-list:has(.person-row:nth-child(6)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .people-list:has(.person-row:nth-child(6)) .person-headliner {
    grid-column: 1;
    grid-row: 1 / span 4;
  }

  .people-list:has(.person-row:nth-child(6)) .person-row:nth-child(-n+5) {
    grid-column: 2;
  }
}

.slot-eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass-dark);
}

/* #1 Headliner Card */
.headliner-card {
  background: var(--paper);
  border: 2px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 26px rgba(21, 18, 15, 0.12);
  overflow: hidden;
}

.headliner-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  max-height: 340px;
  width: 100%;
  padding: var(--sp-12);
  background: var(--ink);
  border-bottom: 4px solid var(--brass);
}

.headliner-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.headliner-ph {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 4rem;
  color: var(--champagne);
  letter-spacing: 0.06em;
}

.headliner-frame .tier-badge {
  position: absolute;
  top: var(--sp-12);
  left: var(--sp-12);
}

.headliner-body {
  padding: 18px;
}

.headliner-rule {
  width: 72px;
  height: 3px;
  margin-bottom: var(--sp-12);
  background: var(--brass-dark);
}

.headliner-body h3 {
  font-size: clamp(1.5rem, 1.3rem + 0.6vw, 1.875rem);
  line-height: 1.15;
}

.headliner-body h3 a,
.row-top h3 a {
  color: var(--ink);
  text-decoration: none;
}

.headliner-body h3 a:hover,
.row-top h3 a:hover {
  color: var(--oxblood);
  text-decoration: underline;
}

.headliner-foot {
  margin-top: var(--sp-12);
  padding-top: var(--sp-12);
  border-top: 1px solid var(--hairline);
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
}

.profile-link:hover {
  text-decoration: underline;
}

/* Compact List Rows (#2-#40) */
.row-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.row-card:hover {
  border-color: var(--border);
  box-shadow: 0 4px 12px rgba(21, 18, 15, 0.08);
}

.row-media img,
.row-ph {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
}

.row-media img {
  object-fit: cover;
  object-position: center 20%;
  background: var(--marble);
}

.row-ph {
  display: grid;
  place-items: center;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--paper);
  background: var(--oxblood);
}

.row-ph--1 { background: var(--cobalt); }
.row-ph--2 { background: var(--emerald); }
.row-ph--3 { background: var(--brass-dark); }
.row-ph--4 { background: var(--primary-dark); }

.row-body {
  min-width: 0;
}

.row-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.rank-num {
  flex-shrink: 0;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--brass-dark);
}

.person-life {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.person-bio {
  margin: 6px 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* Badges: Tier + Milestone Age */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tier-badge,
.badge-milestone,
.badge-living {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-none);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tier-badge--legend {
  background: var(--champagne);
  color: var(--ink);
  border: 1px solid var(--border);
}

.tier-badge--icon {
  background: rgba(122, 30, 32, 0.09);
  color: var(--oxblood);
  border: 1px solid rgba(122, 30, 32, 0.35);
}

.tier-badge--star {
  background: rgba(15, 92, 74, 0.09);
  color: var(--emerald);
  border: 1px solid rgba(15, 92, 74, 0.35);
}

.badge-milestone {
  background: var(--champagne);
  color: var(--ink);
  border: 1px solid var(--brass-dark);
}

.badge-living {
  background: rgba(15, 92, 74, 0.09);
  color: var(--emerald);
  border: 1px solid rgba(15, 92, 74, 0.32);
}

/* ==========================================================================
   8. Editorial Panels: On This Day, FAQ, Hub Grid & Profile Extensions
   ========================================================================== */
.panel {
  padding: clamp(20px, 3vw, 32px);
  margin-bottom: var(--sp-lg);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.events-panel,
.faq-panel {
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}

/* Newspaper Masthead for On This Day */
.masthead {
  text-align: center;
  padding: 12px 0;
  margin-bottom: var(--sp-md);
  border-top: 2px solid var(--lacquer);
  border-bottom: 2px solid var(--lacquer);
}

.masthead-kicker {
  margin: 0 0 4px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--oxblood);
}

.masthead-title {
  font-family: var(--font-label);
  font-size: 1.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.masthead-date {
  margin: 4px 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

.events-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.events-list li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--sp-md);
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
}

.events-list li:first-child {
  border-top: 0;
}

.events-list time {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.35;
  color: var(--oxblood);
}

.event-copy {
  line-height: 1.55;
  color: var(--ink);
}

.event-source {
  display: inline-block;
  margin-inline-start: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cobalt);
}

/* FAQ */
.faq-panel h2 {
  margin-bottom: var(--sp-md);
}

.faq-item {
  max-width: var(--max-article);
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
}

.faq-item p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.faq-cta-row {
  margin: var(--sp-md) 0 0;
}

.editorial-footnote {
  max-width: var(--max-article);
  margin: var(--sp-lg) 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Hub Page (/birthdays): 12-Month Calendar */
.months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-md);
}

.month-card {
  padding: 18px;
  border-top: 3px solid var(--brass-dark);
}

.month-card h2 {
  font-size: 1.25rem;
  margin-bottom: var(--sp-12);
}

.days-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.days-grid a {
  display: grid;
  place-items: center;
  min-height: 36px;
  background: var(--ivory);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.days-grid a:hover {
  background: var(--champagne);
  border-color: var(--oxblood);
  color: var(--ink);
}

/* Profile Page (/people/<id>/<slug>) Extensions */
.profile-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-lg);
}

@media (min-width: 680px) {
  .profile-hero {
    grid-template-columns: 196px 1fr;
    align-items: center;
  }
}

.profile-portrait-box {
  width: 180px;
  height: 180px;
  padding: 6px;
  background: var(--ink);
  border: 2px solid var(--brass);
  border-radius: var(--radius-card);
}

.profile-portrait-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.profile-portrait-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 3.5rem;
  color: var(--champagne);
}

.dek {
  margin: 0 0 var(--sp-md);
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-12);
  margin: var(--sp-lg) 0;
}

@media (min-width: 720px) {
  .quick-facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.fact {
  padding: var(--sp-md);
  background: var(--paper);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brass-dark);
  border-radius: var(--radius-card);
}

.fact dt {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact dd {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--ink);
}

.bio-copy {
  max-width: 68ch;
  margin: 0 0 var(--sp-md);
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--ink);
  text-wrap: pretty;
}

.highlights-list,
.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.highlights-list li {
  position: relative;
  padding: 12px 0 12px 22px;
  border-top: 1px solid var(--hairline);
}

.highlights-list li:first-child,
.timeline-list li:first-child {
  border-top: 0;
}

.highlights-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  width: 10px;
  height: 3px;
  background: var(--brass-dark);
}

.timeline-list li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: var(--sp-12);
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
}

.timeline-list time {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 1rem;
  color: var(--oxblood);
}

.context-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-md);
  margin-top: var(--sp-md);
}

@media (min-width: 720px) {
  .context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .context-card--wide {
    grid-column: 1 / -1;
  }
}

.context-card {
  padding: var(--sp-md);
  background: var(--ivory);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
}

.context-card h3 {
  margin-bottom: var(--sp-12);
  font-family: var(--font-label);
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oxblood);
}

.context-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.context-card li {
  padding: 8px 0;
  border-top: 1px solid var(--hairline);
}

.context-card li:first-child {
  border-top: 0;
}

.context-card li span {
  display: block;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.compare-wrap {
  overflow-x: auto;
}

.compare {
  width: 100%;
  border-collapse: collapse;
}

.compare caption {
  text-align: left;
  margin-bottom: var(--sp-sm);
  font-size: 0.875rem;
  color: var(--muted);
}

.compare th,
.compare td {
  padding: 11px 10px;
  text-align: left;
  border-bottom: 1px solid var(--hairline);
}

.compare thead th {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
}

/* ==========================================================================
   9. Footer
   ========================================================================== */
.site-footer {
  background: var(--paper);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--sp-lg) var(--sp-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
}

@media (min-width: 900px) {
  .footer-inner {
    padding: var(--sp-lg) var(--sp-xl);
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--ink);
}

.footer-meta {
  font-size: 0.8125rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px var(--sp-md);
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--oxblood);
}

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

/* ==========================================================================
   Navigation without the Popover API: works with no JS (:target) and is
   enhanced by /ssr/site.js (class toggle, focus management, Escape, inert).
   ========================================================================== */
.sidebar { display: none; z-index: 60; }
.sidebar:target, .sidebar.is-open { display: flex; box-shadow: 12px 0 32px rgba(14, 16, 20, 0.35); }
.nav-scrim { display: none; }
.sidebar:target ~ .nav-scrim, .sidebar.is-open ~ .nav-scrim {
  display: block; position: fixed; inset: 0; z-index: 55; background: rgba(14, 16, 20, 0.58);
}
body.nav-open { overflow: hidden; }
@media (min-width: 900px) {
  .sidebar, .sidebar:target, .sidebar.is-open { display: flex; box-shadow: none; }
  .sidebar ~ .nav-scrim, .sidebar:target ~ .nav-scrim, .sidebar.is-open ~ .nav-scrim { display: none; }
  body.nav-open { overflow: auto; }
}
a.menu-btn, a.drawer-close { text-decoration: none; }

/* Review fixes: keep the headline portrait compact and rows even. */
.headliner-frame { aspect-ratio: auto; height: 320px; max-height: none; }
.headliner-frame img { width: auto; height: auto; max-width: 100%; max-height: 296px; object-fit: contain; }
@media (max-width: 899px) { .headliner-frame { height: 280px; } .headliner-frame img { max-height: 256px; } }
@media (min-width: 1200px) { .people-list { align-items: stretch; } .person-headliner { align-self: start; } }
.person-row { display: flex; }
.person-row > .row-card { flex: 1; }
.row-media img { object-fit: cover; object-position: center 22%; background: var(--marble); }

/* In-page shortcuts (GPT review) */
.page-shortcuts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 var(--sp-lg); padding: 10px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.page-shortcuts a { display: inline-flex; align-items: center; min-height: 32px; font-family: var(--font-label); font-weight: 700; font-size: 0.875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--oxblood); text-decoration: none; }
.page-shortcuts a:hover { text-decoration: underline; text-underline-offset: 4px; }
.edition-kicker, .edition-title { text-transform: uppercase; }
:target { scroll-margin-top: 72px; }
@media (max-width: 899px) {
  .datenav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .datenav .btn-outline { justify-content: center; }
  .datenav .btn-outline[rel="next"] { grid-column: 2; grid-row: 1; }
  .datenav .btn-edition { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .date-controls { flex-direction: column; align-items: stretch; }
  .date-jump { width: 100%; }
}
.event-source { display: inline-flex; align-items: center; min-height: 24px; min-width: 44px; padding: 0 4px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* Not-an-endorsement note for people notable for crimes, terror or dictatorship */
.context-note { margin: 8px 0 0; padding: 6px 10px; font-size: 0.8125rem; line-height: 1.45; color: var(--text-secondary); background: var(--marble); border-left: 3px solid var(--muted); }
.context-note--profile { margin: 0 0 var(--sp-lg); padding: 12px 16px; font-size: 0.9375rem; max-width: var(--max-article); }
.context-note a { color: var(--oxblood); }

/* Photo credits */
.photo-credit { margin: 6px 0 0; font-size: 0.75rem; line-height: 1.4; color: var(--muted); max-width: 220px; }
.photo-credit a, .photo-credits a { color: var(--text-secondary); }
.photo-credits { margin: var(--sp-lg) 0 0; padding: 12px 16px; background: var(--paper); border: 1px solid var(--hairline); font-size: 0.8125rem; color: var(--text-secondary); }
.photo-credits summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; font-family: var(--font-label); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); }
.photo-credits ul { list-style: none; margin: 8px 0 0; padding: 0; columns: 2 320px; column-gap: 24px; }
.photo-credits li { break-inside: avoid; padding: 4px 0; }
.photo-credits .credit-name { font-weight: 600; color: var(--ink); margin-right: 4px; }
.profile-figure { margin: 0; }
