/* Living Epochs theme "Ink & Parchment" (2026-11-10).
   Loaded after site.css / chronology.css on every page; overrides colors, type and
   component polish only, so removing this file restores the previous look. */

html[data-theme] {
  --bg: #f4eee2;
  --surface: #fffbf3;
  --surface-alt: #ebe2d0;
  --ink: #1f1b16;
  --muted: #645a4d;
  --line: #d8cbb2;
  --dark: #17202e;
  --dark-soft: #222c3c;
  --light: #fbf7ee;
  --accent: #a8482a;
  --accent-2: #1f4f7a;
  --gold: #a7813a;
  --map-paper: #f3ead6;
  --shadow-soft: 0 1px 2px rgb(40 30 15 / 6%), 0 8px 24px rgb(40 30 15 / 8%);
  --shadow-lift: 0 2px 4px rgb(40 30 15 / 8%), 0 18px 40px rgb(40 30 15 / 14%);
  --radius: 14px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-ui: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme][data-theme="dark"] {
  --header-bg: #0a0e18;
  --bg: #0e1320;
  --surface: #151c2c;
  --surface-alt: #1c2537;
  --ink: #f1eadb;
  --muted: #b8b0a0;
  --line: #2e3a52;
  --dark: #0a0e18;
  --dark-soft: #131a29;
  --light: #f6f0e2;
  --accent: #e3925f;
  --accent-2: #8bb8e6;
  --gold: #d6b26a;
  --map-paper: #1a2233;
  --shadow-soft: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 28%);
  --shadow-lift: 0 2px 6px rgb(0 0 0 / 35%), 0 20px 44px rgb(0 0 0 / 40%);
}

html[data-theme] body {
  background:
    radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  text-rendering: optimizeLegibility;
}

html[data-theme] h1,
html[data-theme] h2,
html[data-theme] h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

/* ---------- header and review ribbon ---------- */
html[data-theme] .site-header {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
}

html[data-theme] .site-header .brand-mark {
  background: linear-gradient(135deg, var(--gold), color-mix(in srgb, var(--gold) 55%, var(--accent)));
  color: #1b1408;
  border-radius: 10px;
  font-family: var(--font-display);
}

html[data-theme] .primary-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--gold);
}

html[data-theme] .verification-ribbon {
  font-size: 12px;
  line-height: 1.35;
  padding-block: 6px;
  background: color-mix(in srgb, var(--dark) 88%, var(--gold));
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 25%, transparent);
  color: var(--light);
}

html[data-theme] .verification-ribbon a {
  color: var(--light);
}

html[data-theme] .verification-ribbon > span:not(.verification-ribbon-status) {
  opacity: 0.78;
}

/* ---------- hero ---------- */
html[data-theme] .chronology-hero {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 40%, transparent), transparent),
    color-mix(in srgb, var(--surface-alt) 70%, var(--bg));
  border-bottom: 1px solid var(--line);
}

html[data-theme] .chronology-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
}

html[data-theme] .chronology-hero .kicker {
  color: var(--accent);
  letter-spacing: 0.12em;
}

/* Banner heroes on the hub and region pages (images on the Bunny CDN). */
html[data-theme] .chronology-hero[data-hero-banner] {
  --hero-tint: rgb(10 14 24 / 82%);
  color: #f6f0e2;
  background-color: #141b2a;
  background-image:
    linear-gradient(90deg, var(--hero-tint) 0%, rgb(10 14 24 / 62%) 45%, rgb(10 14 24 / 20%) 100%),
    var(--hero-image);
  background-size: cover;
  background-position: center right;
  min-height: clamp(360px, 46vw, 520px);
}

html[data-theme] .chronology-hero[data-hero-banner] h1,
html[data-theme] .chronology-hero[data-hero-banner] p,
html[data-theme] .chronology-hero[data-hero-banner] .chronology-stats span {
  color: #f6f0e2;
  text-shadow: 0 1px 12px rgb(0 0 0 / 45%);
}

html[data-theme] .chronology-hero[data-hero-banner] .kicker {
  color: #e9c787 !important;
}

html[data-theme] .chronology-hero[data-hero-banner] .chronology-stats span {
  background: rgb(10 14 24 / 45%);
  border-color: rgb(233 199 135 / 35%);
  backdrop-filter: blur(6px);
}

html[data-theme] .chronology-hero[data-hero-banner] .chronology-actions a {
  color: #f6f0e2;
  border-color: rgb(246 240 226 / 45%);
  background: rgb(10 14 24 / 35%);
}

html[data-theme] .chronology-hero[data-hero-banner] .verification-panel {
  background: rgb(14 19 32 / 78%);
  color: #f1eadb;
  border-color: rgb(233 199 135 / 30%);
  backdrop-filter: blur(8px);
}

html[data-theme] .chronology-hero[data-hero-banner] .chronology-stats {
  background: transparent;
  border-color: transparent;
}

html[data-theme] .chronology-hero[data-hero-banner] .chronology-stats strong {
  color: #f6f0e2;
}

html[data-theme] .chronology-hero[data-hero-banner] .verification-checks span {
  background: rgb(246 240 226 / 8%);
  border-color: rgb(233 199 135 / 30%);
}

html[data-theme] .chronology-hero[data-hero-banner] .verification-panel * {
  color: inherit;
  text-shadow: none;
}

[data-hero-banner="chronologies"] { --hero-image: url("https://livingepochs-world-cdn.b-cdn.net/history/releases/20261110/assets/generated/theme-v1/banner-chronologies.webp"); }
[data-hero-banner="africa"] { --hero-image: url("https://livingepochs-world-cdn.b-cdn.net/history/releases/20261110/assets/generated/theme-v1/banner-africa.webp"); }
[data-hero-banner="americas"] { --hero-image: url("https://livingepochs-world-cdn.b-cdn.net/history/releases/20261110/assets/generated/theme-v1/banner-americas.webp"); }
[data-hero-banner="east-southeast-asia"] { --hero-image: url("https://livingepochs-world-cdn.b-cdn.net/history/releases/20261110/assets/generated/theme-v1/banner-east-southeast-asia.webp"); }
[data-hero-banner="europe"] { --hero-image: url("https://livingepochs-world-cdn.b-cdn.net/history/releases/20261110/assets/generated/theme-v1/banner-europe.webp"); }
[data-hero-banner="global-themes"] { --hero-image: url("https://livingepochs-world-cdn.b-cdn.net/history/releases/20261110/assets/generated/theme-v1/banner-global-themes.webp"); }
[data-hero-banner="oceania-arctic"] { --hero-image: url("https://livingepochs-world-cdn.b-cdn.net/history/releases/20261110/assets/generated/theme-v1/banner-oceania-arctic.webp"); }
[data-hero-banner="south-central-asia"] { --hero-image: url("https://livingepochs-world-cdn.b-cdn.net/history/releases/20261110/assets/generated/theme-v1/banner-south-central-asia.webp"); }
[data-hero-banner="west-asia-north-africa"] { --hero-image: url("https://livingepochs-world-cdn.b-cdn.net/history/releases/20261110/assets/generated/theme-v1/banner-west-asia-north-africa.webp"); }

/* ---------- bands, cards, record pages ---------- */
html[data-theme] .chronology-band.is-alt {
  background: color-mix(in srgb, var(--surface-alt) 55%, var(--bg));
}

html[data-theme] .chronology-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

html[data-theme] .chronology-card:hover,
html[data-theme] .chronology-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
}

html[data-theme] .chronology-card-media {
  border-radius: 0;
  background: color-mix(in srgb, var(--surface-alt) 80%, var(--gold));
}

html[data-theme] .chronology-card-media img {
  transition: transform 0.5s ease;
}

html[data-theme] .chronology-card:hover .chronology-card-media img {
  transform: scale(1.04);
}

html[data-theme] .chronology-card-copy > small:first-child {
  color: var(--accent);
  letter-spacing: 0.06em;
}

html[data-theme] .record-visual img {
  border-radius: 0 0 var(--radius) var(--radius);
}

html[data-theme] .record-facts {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

html[data-theme] .record-prose article h2 {
  color: var(--ink);
  border-left: 3px solid var(--gold);
  padding-left: 12px;
}

html[data-theme] .evidence-register article {
  border-radius: 12px;
}

html[data-theme] .chronology-actions a,
html[data-theme] .chronology-actions button {
  border-radius: 999px;
}

html[data-theme] .site-footer {
  background: var(--dark);
  color: #e9e1cf;
  border-top: 2px solid color-mix(in srgb, var(--gold) 50%, transparent);
}

html[data-theme] .site-footer a {
  color: #f1eadb;
}

/* ---------- related records + explore (added 2026-11-10) ---------- */
.related-records {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.related-records a {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.related-records a:hover,
.related-records a:focus-visible {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.related-records small {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.related-records strong {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.25;
}

.explore-section {
  padding: 56px var(--gutter, 48px);
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.explore-inner {
  width: min(100%, 1320px);
  margin-inline: auto;
}

.explore-inner > h2 {
  font-size: clamp(28px, 3.4vw, 42px);
  margin: 0 0 8px;
}

.explore-inner > p {
  color: var(--muted);
  max-width: 70ch;
  margin: 0 0 22px;
}

.explore-regions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.explore-regions a {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 150px;
  padding: 16px;
  overflow: hidden;
  color: #f6f0e2;
  text-decoration: none;
  border-radius: var(--radius);
  background: #1a2233 var(--hero-image) center / cover;
  box-shadow: var(--shadow-soft);
}

.explore-regions a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgb(10 14 24 / 85%));
}

.explore-regions a span {
  position: relative;
  display: grid;
  gap: 2px;
}

.explore-regions strong {
  font-family: var(--font-display);
  font-size: 20px;
}

.explore-regions small {
  opacity: 0.85;
}

.explore-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 26px;
  padding: 0;
  list-style: none;
}

.explore-topics a {
  display: inline-block;
  padding: 7px 13px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
}

.explore-topics a:hover {
  border-color: var(--gold);
}

/* ---------- ad slot (inactive until AdSense is switched on) ---------- */
.le-ad-slot {
  display: none;
}

html[data-ads="on"] .le-ad-slot {
  display: block;
  margin: 28px auto;
  max-width: 336px;
  min-height: 280px;
  text-align: center;
}

html[data-ads="on"] .le-ad-slot::before {
  content: "Advertisement";
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 1279px) {
  html[data-ads="on"] .le-ad-slot.is-rail {
    display: none;
  }
}

@media (min-width: 1280px) {
  html[data-ads="on"] .record-layout .le-ad-slot.is-inline {
    display: none;
  }

  html[data-ads="on"] .record-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px) 300px;
  }

  html[data-ads="on"] .le-ad-slot.is-rail {
    position: sticky;
    top: calc(var(--header-height, 70px) + 16px);
    margin: 0;
    width: 300px;
    min-height: 600px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme] .chronology-card,
  html[data-theme] .chronology-card-media img,
  .related-records a {
    transition: none;
  }
}
