/* Cerita Malaysia — warm-paper reading theme, phone first.
   The body type is deliberately large and serif: most readers arrive on a
   phone and are being asked to read long-form history, not skim a feed. */

:root {
  --header-h: 60px; /* updated by JS to match actual sticky header height */
  --paper:      #faf6ef;
  --paper-2:    #f2ebdf;
  --ink:        #21201c;
  --ink-soft:   #57534a;
  --ink-faint:  #8b8479;
  --line:       #e0d7c6;
  --gold:       #a8762c;
  --gold-soft:  #c9a34f;
  --deep:       #1f3a34;
  --red:        #a33224;
  --radius:     10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
           "Songti SC", "Noto Serif SC", "Noto Serif CJK SC", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:     #14140f;
    --paper-2:   #1c1b16;
    --ink:       #ece6da;
    --ink-soft:  #b2ab9c;
    --ink-faint: #857e70;
    --line:      #33312a;
    --gold:      #d3a552;
    --gold-soft: #a8823c;
    --deep:      #8fbdb0;
    --red:       #e0705d;
  }
}

* {
  box-sizing: border-box;
  /* Warm gold tap flash instead of default blue on iOS — matches site palette. */
  -webkit-tap-highlight-color: color-mix(in srgb, #a8762c 22%, transparent);
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap        { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 680px;  margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px;
}

/* ---------------------------------------------------------------- header */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  will-change: backdrop-filter;
}
@media (prefers-reduced-motion: reduce) {
  .site-head { backdrop-filter: none; background: var(--paper); }
}

.head-inner {
  display: flex; align-items: center; gap: 16px;
  height: 58px;
}

.brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-mark { color: var(--gold); font-size: 1.1em; }
.brand-name { font-size: 1.02rem; }

.nav {
  display: flex; gap: 18px; margin-left: auto;
  font-size: 0.92rem;
}
.nav a {
  text-decoration: none; color: var(--ink-soft);
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--gold); }

.lang { display: flex; gap: 2px; margin-left: 8px; }
.lang-btn {
  display: inline-block; padding: 4px 9px;
  font-size: 0.8rem; font-weight: 500;
  text-decoration: none; color: var(--ink-faint);
  border: 1px solid transparent; border-radius: 6px;
}
.lang-btn:hover { color: var(--ink); background: var(--paper-2); }
.lang-btn.on {
  color: var(--gold); border-color: var(--line); background: var(--paper-2);
}

@media (max-width: 640px) {
  .head-inner { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 14px; font-size: 0.86rem; }
  .lang { margin-left: auto; }
}

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

.hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1200px 320px at 50% -120px,
      color-mix(in srgb, var(--gold) 12%, transparent), transparent);
}
.hero-kicker {
  margin: 0 0 14px; color: var(--gold);
  font-size: 0.9rem; letter-spacing: 0.04em; text-transform: none;
}
.hero-title {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.08; letter-spacing: -0.02em; font-weight: 600;
}
.hero-lede {
  margin: 0 0 28px; max-width: 46ch;
  color: var(--ink-soft); font-size: 1.02rem;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 11px 20px; border-radius: var(--radius);
  text-decoration: none; font-size: 0.95rem; font-weight: 500;
  border: 1px solid transparent; transition: transform .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--deep); color: var(--paper); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #14140f; } }
.btn-ghost { border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); border-color: var(--gold-soft); }

/* ------------------------------------------------------- turning points */

.turning-index {
  padding: 24px 0;
  background: var(--deep);
  color: var(--paper);
}
.turning-index-inner {
  display: grid;
  grid-template-columns: minmax(130px, 0.25fr) 1fr;
  gap: 22px;
  align-items: center;
}
.turning-index h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: 0;
}
.turning-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 8px;
}
.turning-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border: 2px solid transparent;
  border-radius: 5px;
  color: #17211d;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.turning-link:hover { transform: translateY(-2px); border-color: #fffdf5; }
.turning-link--milestone { background: #ffd83d; }
.turning-link--rupture { background: #f06a57; color: #28110e; }
.turning-link-date {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
}
.turning-link-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}
@media (max-width: 640px) {
  .turning-index-inner { grid-template-columns: 1fr; gap: 12px; }
  .turning-links { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .turning-links { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ eras */

.era {
  padding: 52px 0; border-bottom: 1px solid var(--line);
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}
.era:last-of-type { border-bottom: 0; }

.era-head { max-width: 640px; margin-bottom: 28px; }
.era-years {
  font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.12em;
  color: var(--gold); margin-bottom: 8px;
}
.era-title {
  margin: 0 0 10px; font-family: var(--serif);
  font-size: clamp(1.5rem, 3.6vw, 2.05rem); font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.2;
}
.era-blurb { margin: 0; color: var(--ink-soft); font-size: 1rem; }
.era-empty {
  color: var(--ink-faint); font-size: 0.92rem; font-style: italic;
  padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius);
}

.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}

.read-controls {
  display: flex;
  justify-content: flex-end;
  margin: 28px 0 -18px;
}
.read-controls-route {
  justify-content: flex-start;
  margin: 0 0 18px;
}
.read-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  color: var(--ink-soft);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.84rem;
  cursor: pointer;
  user-select: none;
}
.read-toggle:hover { border-color: var(--gold-soft); color: var(--ink); }
.read-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--deep);
}

.card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px; text-decoration: none;
  background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--gold-soft); transform: translateY(-2px); }
.card.done:not(.card-turning) {
  border-color: color-mix(in srgb, var(--deep) 48%, var(--line));
  background: color-mix(in srgb, var(--deep) 5%, var(--paper-2));
}
.card.done:not(.card-turning):hover { border-color: var(--deep); }
.card-top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.74rem; letter-spacing: 0.06em; color: var(--ink-faint);
}
.card-top .genre { color: var(--gold); }
.card-title {
  margin: 0; font-family: var(--serif); font-size: 1.16rem;
  line-height: 1.28; font-weight: 600;
}
.card-sub { margin: 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.45; }
.card-foot {
  margin-top: auto; padding-top: 8px;
  display: flex; gap: 12px; font-size: 0.76rem; color: var(--ink-faint);
}

.card-turning {
  border-width: 2px;
  color: #17211d;
  box-shadow: 0 5px 0 var(--turning-edge);
  transform: translateY(-2px);
}
.card-turning:hover {
  border-color: var(--turning-edge);
  box-shadow: 0 7px 0 var(--turning-edge);
  transform: translateY(-4px);
}
.card-turning--milestone {
  --turning-edge: #176c5a;
  background: #ffd83d;
  border-color: var(--turning-edge);
}
.card-turning--rupture {
  --turning-edge: #7b201c;
  background: #f06a57;
  border-color: var(--turning-edge);
  color: #28110e;
}
.card-turning .card-top,
.card-turning .card-foot,
.card-turning .card-top .genre,
.card-turning .card-sub {
  color: currentColor;
}
.card-turning.done {
  border-color: color-mix(in srgb, var(--deep) 72%, #fffdf5);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--deep) 72%, #fffdf5);
}
.is-hidden-read { display: none !important; }
.turning-date {
  align-self: flex-start;
  padding: 4px 8px;
  background: #fffdf5;
  border: 1px solid currentColor;
  border-radius: 3px;
  color: #171713;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1;
  letter-spacing: 0;
}

.alsosee { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 14px; }
.alsosee a { font-size: 0.85rem; color: var(--ink-soft); text-decoration: none; }
.alsosee a:hover { color: var(--gold); }

/* --------------------------------------------------------------- article */

.page-head { padding: 52px 0 8px; }
.page-head h1 {
  margin: 0 0 12px; font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.15; letter-spacing: -0.02em;
}
.lede { color: var(--ink-soft); margin: 0 0 20px; }

/* /terkini — the standing caveat that case status moves under the reader's
   feet. Deliberately quiet: it is a caveat, not a headline. */
.terkini-note {
  margin: 0 0 20px; padding-left: 12px;
  border-left: 2px solid var(--gold);
  color: var(--ink-soft); font-size: 0.9rem;
}

.art-head { padding: 48px 0 4px; }
.art-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 0.82rem; color: var(--ink-faint); margin-bottom: 16px;
}
.art-era { color: var(--gold); text-decoration: none; }
.art-era:hover { text-decoration: underline; }
.art-sep { opacity: .5; }
.art-title {
  margin: 0 0 14px; font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 6vw, 3rem); line-height: 1.12; letter-spacing: -0.022em;
}
.art-sub {
  margin: 0 0 20px; color: var(--ink-soft);
  font-family: var(--serif); font-size: 1.16rem; line-height: 1.5; font-style: italic;
}
.art-facts {
  display: flex; gap: 16px; font-size: 0.8rem; color: var(--ink-faint);
  padding-bottom: 22px; border-bottom: 1px solid var(--line);
}
.draft-flag {
  margin: 16px 0 0; padding: 8px 12px; border-radius: 6px;
  background: color-mix(in srgb, var(--red) 12%, transparent);
  color: var(--red); font-size: 0.84rem;
}

/* ----------------------------------------------------------------- prose */

.prose {
  font-family: var(--serif);
  font-size: 1.14rem;
  line-height: 1.78;
  padding: 30px 20px 10px;
  overflow-wrap: anywhere;
}
.prose p { margin: 0 0 1.15em; }
.prose h2 {
  margin: 2.1em 0 .6em; font-size: 1.5rem; font-weight: 600;
  line-height: 1.25; letter-spacing: -0.012em;
}
.prose h3 { margin: 1.8em 0 .5em; font-size: 1.22rem; font-weight: 600; }
.prose h4 { margin: 1.6em 0 .4em; font-size: 1.06rem; font-weight: 600; color: var(--ink-soft); }
.prose a { color: var(--gold); text-underline-offset: 3px; }
.prose a.next-hook {
  display: block;
  color: var(--deep);
  text-decoration-color: var(--gold-soft);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.prose a.next-hook:hover {
  color: var(--gold);
  text-decoration-color: currentColor;
}
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.35em; }
.prose li { margin-bottom: .4em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .88em; background: var(--paper-2); padding: 1px 5px; border-radius: 4px;
}

.prose blockquote {
  margin: 1.6em 0; padding: 2px 0 2px 20px;
  border-left: 3px solid var(--gold-soft);
  color: var(--ink-soft); font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 1.6em 0; }
.prose table {
  width: 100%; border-collapse: collapse;
  font-family: var(--sans); font-size: 0.92rem;
}
.prose th, .prose td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.prose th { font-weight: 600; color: var(--ink-soft); background: var(--paper-2); }

/* ------------------------------------------------- citation superscripts */

/* The reference number sits at the tail of the claim it backs, and links
   straight down to the full source entry. */
sup.cite {
  font-family: var(--sans);
  font-size: 0.62em;
  font-weight: 600;
  line-height: 0;
  margin-left: 2px;
  white-space: nowrap;
  vertical-align: super;
}
sup.cite a {
  color: var(--gold);
  text-decoration: none;
  padding: 0 1px;
}
sup.cite a:hover { text-decoration: underline; }
sup.cite .cite-sep { color: var(--ink-faint); }

/* ---------------------------------------------------- penilaian (verdict) */

.penilaian {
  margin: 2.2em 0;
  padding: 20px 22px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--deep);
  border-radius: var(--radius);
}
.penilaian-tag {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--deep); margin-bottom: 10px;
}
.penilaian p { margin: 0; font-size: 1.04rem; line-height: 1.7; }

/* ------------------------------------------- ringkas (plain-language map) */

.ringkas {
  margin: 2.2em 0;
  padding: 20px 22px;
  background: color-mix(in srgb, var(--gold) 7%, var(--paper));
  border: 1px solid var(--gold-soft);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
}
.ringkas-tag {
  font-family: var(--sans); font-size: 0.76rem; font-weight: 700;
  color: var(--deep); margin-bottom: 12px;
}
.ringkas p { margin: 0; font-size: 1rem; line-height: 1.72; }
.ringkas p + p {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
}

/* ----------------------------------------------------------- quran block */

.quran {
  margin: 2.4em 0; padding: 24px 24px 18px;
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--gold) 6%, transparent);
}
.quran-text {
  margin: 0 0 14px; padding: 0; border: 0;
  font-style: normal; color: var(--ink);
}
.quran-text p {
  margin: 0; font-size: 1.14rem; line-height: 1.85;
}
.quran figcaption { font-family: var(--sans); }
.quran-ref {
  font-size: 0.86rem; font-weight: 600; color: var(--gold);
  padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
}
.quran-tr { font-weight: 400; color: var(--ink-faint); }
.quran-konteks {
  margin-top: 8px; font-size: 0.88rem; line-height: 1.6; color: var(--ink-soft);
}
.quran-konteks .k-label { font-weight: 600; color: var(--ink); }

/* ------------------------------------------------- kelas / vr (the frame) */

/* The classroom and the headset must never be mistaken for each other, or the
   whole device fails: one is where opinions are allowed, the other is where
   only sourced facts are. Light paper vs. dark glass carries that at a glance. */

.skrip { margin: 2.2em 0; border-radius: var(--radius); }
.skrip .ucap, .skrip .lakon { margin: 0 0 .75em; }
.skrip > :last-child { margin-bottom: 0; }
.skrip .nama {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.04em; display: block; margin-bottom: 2px;
}
.skrip .kata { display: block; }

/* the classroom, 2057 */
.kelas {
  padding: 20px 22px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-soft);
}
.kelas .nama  { color: var(--gold); }
.kelas .kata  { font-size: 1.02rem; line-height: 1.75; }
.kelas .lakon { color: var(--ink-soft); font-size: 0.96rem; line-height: 1.7; }

/* inside the headset */
.vr {
  padding: 18px 22px 22px;
  background: #12202b;
  border: 1px solid #24384a;
  color: #dbe6ef;
}
@media (prefers-color-scheme: dark) {
  .vr { border-color: #3a5a76; }
}
.vr .lakon { color: #9fb3c4; font-size: 0.98rem; line-height: 1.7; }
.vr .kata  { font-size: 1.02rem; line-height: 1.75; }
.vr .nama  { color: #7fb0d6; }
.vr a      { color: #8ecbff; }
.vr sup.cite a { color: #8ecbff; }
.vr sup.cite .cite-sep { color: #6d8496; }

.vr-bar {
  font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: #6d8496;
  padding-bottom: 12px; margin-bottom: 16px;
  border-bottom: 1px solid #24384a;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.vr-label  { color: #7fb0d6; font-weight: 600; }
.vr-tahun  { color: #dbe6ef; }
.vr-tempat { color: #9fb3c4; }

/* the classroom assistant: a machine that runs the room. Reads as machine, but
   plainly not the fact layer — it has no authority over what is true. */
.mesin .nama { color: var(--gold); letter-spacing: .08em; }
.mesin .kata {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem; color: var(--ink-soft);
}
.vr .mesin .nama { color: #c9a34f; }
.vr .mesin .kata { color: #b9cad8; }

/* the system narrator: it states only what a source backs, and reads like a
   machine so it can never be mistaken for a person with a view */
.vr .sejarah .nama { color: #6d8496; }
.vr .sejarah .kata {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92rem; line-height: 1.7; color: #d0dde8;
}

/* a reconstructed line is an inference. The tag is deliberately loud — it is
   the whole defence against "this site invents historical quotations". */
.avatar .nama { font-style: italic; }
.rekon-tag {
  display: inline-block; margin-bottom: 4px;
  font-family: var(--sans); font-size: 0.64rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #2a1a05; background: #e08c22;
  padding: 2px 7px; border-radius: 3px;
}
.rekon .kata { border-left: 2px solid #e08c22; padding-left: 10px; }
/* merged speaker blocks: same speaker talks multiple consecutive lines.
   The name label appears once; each line is its own paragraph beneath it.
   Single-line speakers still use the original <p class="ucap"> path unchanged. */
.ucap-blok { display: block; }
.ucap-blok .ucap-linii { margin-top: 0; }
.ucap-blok .ucap-baris { margin: 0 0 0.45em; }
.ucap-blok .ucap-baris:last-child { margin-bottom: 0; }
.ucap-blok .ucap-baris .kata { display: block; }
/* rekonstruksi per-line inside a merged block: border on the kata span, not the outer p */
.ucap-blok .ucap-baris.rekon .kata { border-left: 2px solid #e08c22; padding-left: 10px; }

/* ------------------------------------------------------------- gambar */

/* The credit sits under the picture, not in a footnote. A reader has to be able
   to see who made an image and under what licence without leaving the page. */

.gambar { margin: 2.2em 0; }
.gambar img {
  display: block; width: 100%; height: auto;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--paper-2);
}
.gambar figcaption { margin-top: 10px; font-family: var(--sans); }
.gambar-kapsyen {
  font-size: 0.88rem; line-height: 1.6; color: var(--ink-soft);
}
.gambar-kredit {
  margin-top: 5px; font-size: 0.74rem; color: var(--ink-faint);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline;
}
.gambar-kredit a { color: var(--ink-faint); text-underline-offset: 2px; }
.gambar-kredit a:hover { color: var(--gold); }
.gambar-lesen {
  border: 1px solid var(--line); border-radius: 3px;
  padding: 0 5px; letter-spacing: .02em;
}

/* --------------------------------------------------------------- video */

.video { margin: 2.2em 0; }
.video-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--paper-2);
}
.video-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.video figcaption { margin-top: 10px; font-family: var(--sans); }
.video-kapsyen {
  font-size: 0.88rem; line-height: 1.6; color: var(--ink-soft);
}
.video-kredit {
  margin-top: 5px; font-size: 0.74rem; color: var(--ink-faint);
}
.video-kredit a { color: var(--ink-faint); text-underline-offset: 2px; }
.video-kredit a:hover { color: var(--gold); }

/* ---------------------------------------- machine-translation banner */

.mt-banner {
  margin: 0 0 1.6em; padding: 12px 16px;
  background: color-mix(in srgb, #e08c22 12%, transparent);
  border: 1px solid color-mix(in srgb, #e08c22 45%, transparent);
  border-radius: var(--radius);
  font-family: var(--sans); font-size: 0.84rem; line-height: 1.6;
  color: var(--ink-soft);
}
.mt-banner strong { color: var(--ink); font-weight: 600; }
.mt-banner a { color: var(--gold); }

/* --------------------------------------------------------------- sources */

.sources { padding: 28px 20px 10px; margin-top: 24px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------ folded panels */

/* Both the evidence and the AI disclosure sit behind a tap. Most readers never
   open either; the reader who came to check us has to be able to, in one move. */

.disclose {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.disclose[open] { background: transparent; }

.disclose-head {
  list-style: none; cursor: pointer;
  padding: 14px 16px;
  font-family: var(--sans); font-size: 0.92rem; font-weight: 600;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.disclose-head::-webkit-details-marker { display: none; }
.disclose-head::before {
  content: "▸"; color: var(--gold); font-size: 0.8rem;
  transition: transform .15s ease; display: inline-block;
}
.disclose[open] > .disclose-head::before { transform: rotate(90deg); }
.disclose-head:hover { color: var(--gold); }
.disclose-head:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.disclose-count {
  font-size: 0.74rem; font-weight: 700; letter-spacing: .04em;
  color: var(--paper); background: var(--gold);
  padding: 1px 8px; border-radius: 20px;
}
.disclose-note {
  flex: 1 1 100%;
  font-weight: 400; font-size: 0.8rem; color: var(--ink-faint);
  padding-left: 22px;
}
.disclose > :not(.disclose-head) { padding-left: 16px; padding-right: 16px; }
.disclose > :last-child { padding-bottom: 16px; }

.disclose-ai .ai-notice { margin: 0; border: 0; background: none; padding-top: 0; }

.src-head {
  margin: 0 0 6px; font-family: var(--serif); font-size: 1.3rem; font-weight: 600;
}
.src-note { margin: 0 0 18px; font-size: 0.84rem; color: var(--ink-faint); }
.src-list { margin: 0; padding-left: 1.5em; }
.src {
  margin-bottom: 18px; font-size: 0.9rem; line-height: 1.55; color: var(--ink-soft);
  scroll-margin-top: calc(var(--header-h) + 18px);
}
.src:target {
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  border-radius: 5px; padding: 8px 10px; margin-left: -10px;
}
.src-main { display: block; }

/* A citation the reader cannot follow is only decoration, so the whole
   reference is a link — to the document itself where one exists, otherwise to
   a search for the work. */
a.src-ref { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
a.src-ref:hover { color: var(--ink); border-bottom-color: var(--gold); }

.src-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 6px; font-size: 0.78rem;
}
.src-go {
  color: var(--gold); text-decoration: none; font-weight: 500; white-space: nowrap;
}
.src-go:hover { text-decoration: underline; }
.src-hint { color: var(--ink-faint); font-style: italic; }
.src-acc { color: var(--ink-faint); }
.src-flag {
  color: var(--ink-faint); text-decoration: none; margin-left: auto;
  border-bottom: 1px dotted var(--ink-faint); white-space: nowrap;
}
.src-flag:hover { color: var(--red); border-bottom-color: var(--red); }

/* --------------------------------------------- AI disclosure / check-us box */

/* Stating the failure mode plainly is what makes the clickable sources mean
   something — the reader is being asked to audit, not to trust. */
.ai-notice {
  margin: 28px 0 8px; padding: 20px 22px;
  border: 1px solid var(--gold-soft); border-radius: var(--radius);
  background: color-mix(in srgb, var(--gold) 7%, transparent);
}
.ai-notice h3 {
  margin: 0 0 10px; font-family: var(--sans);
  font-size: 0.98rem; font-weight: 600; color: var(--ink); line-height: 1.4;
}
.ai-notice p {
  margin: 0 0 16px; font-family: var(--sans);
  font-size: 0.88rem; line-height: 1.65; color: var(--ink-soft);
}
.ai-notice .btn { font-size: 0.86rem; padding: 9px 16px; }
.ai-notice-lg { margin: 8px 0 32px; }
.ai-notice-lg p { margin-bottom: 0; font-size: 0.92rem; }

.nav-verify { color: var(--gold) !important; }

/* ------------------------------------------------------ correction form */

.banner {
  padding: 14px 18px; border-radius: var(--radius); margin: 0 0 24px;
  font-size: 0.92rem; line-height: 1.55;
}
.banner-ok {
  background: color-mix(in srgb, var(--deep) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--deep) 40%, transparent); color: var(--ink);
}
.banner-err {
  background: color-mix(in srgb, var(--red) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); color: var(--ink);
}

.report {
  margin: 8px 0 64px; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2);
}
.report-head {
  margin: 0 0 6px; font-family: var(--serif); font-size: 1.3rem; font-weight: 600;
}
.report-ctx {
  margin: 0 0 18px; font-size: 0.86rem; color: var(--ink-soft);
  padding: 8px 12px; border-radius: 6px;
  background: color-mix(in srgb, var(--gold) 10%, transparent);
}
.report label { display: block; margin-bottom: 16px; }
.report .lbl {
  display: block; margin-bottom: 6px;
  font-size: 0.84rem; font-weight: 500; color: var(--ink-soft);
}
.report input[type=email], .report textarea, .report select {
  width: 100%; padding: 10px 12px;
  font-family: inherit; font-size: 0.94rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 7px;
}
.report textarea { resize: vertical; line-height: 1.6; }
.report input:focus, .report textarea:focus, .report select:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}
.report button { cursor: pointer; font-family: inherit; }

.admin-entry {
  margin: 40px 0 0;
  text-align: right;
  font-size: 0.72rem;
}
.admin-entry a {
  color: var(--ink-faint);
  text-decoration: none;
}
.admin-entry a:hover { color: var(--ink-soft); }
.admin-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.admin-meta a { color: var(--ink-soft); text-decoration: none; }
.admin-meta a:hover { color: var(--gold); }
.report-list { display: grid; gap: 14px; margin: 0 0 64px; }
.report-row {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.report-row-top,
.report-target {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.report-row-top {
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--ink-faint);
  font-size: 0.78rem;
}
.report-kind {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
}
.report-target {
  margin-bottom: 10px;
  font-size: 0.9rem;
}
.report-target a {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.05rem;
  text-decoration: none;
}
.report-target a:hover { color: var(--gold); }
.report-target b {
  font-size: 0.72rem;
  color: var(--ink-faint);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.report-message {
  margin: 0;
  white-space: pre-wrap;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.65;
}
.report-contact {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}
.report-contact a { color: var(--gold); }
.admin-empty {
  margin: 24px 0 64px;
  color: var(--ink-soft);
}

/* Honeypot — off-screen rather than display:none, which some bots detect. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.src-tier {
  display: inline-block; font-family: var(--sans); font-size: 0.66rem;
  font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px; margin-right: 8px;
  vertical-align: 1px; white-space: nowrap;
}
.tier-primary    { background: color-mix(in srgb, var(--deep) 18%, transparent); color: var(--deep); }
.tier-scholarly  { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--gold); }
.tier-journalism { background: var(--paper-2); color: var(--ink-soft); }
.tier-secondary  { background: var(--paper-2); color: var(--ink-faint); }
.src-link { color: var(--gold); text-decoration: none; margin-left: 4px; }
.src-acc { color: var(--ink-faint); font-size: 0.82em; }

/* ----------------------------------------------------------- related read */

.related-reading {
  margin-top: 34px;
  padding: 30px 20px 12px;
  border-top: 1px solid var(--line);
}
.related-reading-head { margin-bottom: 16px; }
.related-kicker {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}
.related-reading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.related-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--deep);
  border-radius: 6px;
  transition: transform 140ms ease, border-color 140ms ease;
}
.related-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.related-era { color: var(--deep); font-size: 0.76rem; font-weight: 750; }
.related-card strong {
  font-family: var(--serif); font-size: 1rem; line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.related-subtitle { color: var(--ink-soft); font-size: 0.84rem; line-height: 1.45; }

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

.art-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 18px; padding: 30px 20px 60px;
  border-top: 1px solid var(--line);
}
.pn {
  display: flex; flex-direction: column; gap: 5px;
  min-height: 104px; justify-content: center;
  padding: 17px 18px; text-decoration: none;
  border: 2px solid var(--deep); border-radius: var(--radius);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.pn:hover { transform: translateY(-2px); }
.pn-prev { background: var(--paper-2); }
.pn-prev:hover { box-shadow: 0 4px 0 var(--deep); }
.pn-next {
  --pn-edge: #176c5a;
  background: #ffd83d;
  border-color: var(--pn-edge);
  box-shadow: 0 4px 0 var(--pn-edge);
  color: #17211d;
  text-align: right;
}
.pn-next:hover { box-shadow: 0 6px 0 var(--pn-edge); }
.pn-empty { border: 0; background: none; }
.pn-label { font-size: 0.82rem; color: var(--deep); font-weight: 750; letter-spacing: 0; }
.pn-next .pn-label { color: currentColor; }
.pn-title { font-family: var(--serif); font-size: 1.04rem; line-height: 1.35; font-weight: 600; }
@media (max-width: 560px) {
  .related-grid { grid-template-columns: 1fr; }
  .art-nav { grid-template-columns: 1fr; }
  .pn-next { grid-row: 1; }
  .pn-prev { grid-row: 2; }
  .pn-empty { display: none; }
}

/* ------------------------------------------------------- reading path */

.route-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}
.route-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.2;
}
.route-chip:hover { border-color: var(--gold-soft); }
.route-chip.on {
  border-color: var(--deep);
  box-shadow: inset 3px 0 0 var(--deep);
}
.route-chip b {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 0.78rem;
  font-weight: 700;
}

.progress { margin: 8px 0 28px; }
.progress-bar {
  height: 6px; background: var(--paper-2); border-radius: 99px; overflow: hidden;
  border: 1px solid var(--line);
}
.progress-bar span {
  display: block; height: 100%; width: 0;
  background: var(--gold); transition: width .35s ease;
}
.progress-text {
  display: flex; justify-content: space-between; align-items: center;
  margin: 8px 0 0; font-size: 0.84rem; color: var(--ink-soft);
}
.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink-faint); font-size: 0.82rem; text-decoration: underline;
  font-family: inherit;
}
.linkish:hover { color: var(--gold); }

.route-section {
  margin: 0 0 44px;
  padding-top: 14px;
  scroll-margin-top: calc(var(--header-h) + 8px);
}
.route-section-head {
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.route-section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.2;
}
.route-section-head p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}
.route-section-head .route-count {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.path { list-style: none; margin: 0 0 20px; padding: 0; }
.path-item { border-bottom: 1px solid var(--line); }
.path-item.done {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--deep) 58%, var(--line));
}
.path-item a {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 6px; text-decoration: none;
}
.path-item a:hover { background: var(--paper-2); }
.path-n {
  flex: 0 0 auto; width: 30px; text-align: right;
  font-family: var(--sans); font-size: 0.86rem; color: var(--ink-faint);
  padding-top: 3px;
}
.path-body { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; }
.path-title { font-family: var(--serif); font-size: 1.08rem; line-height: 1.35; }
.path-sub { font-size: 0.88rem; color: var(--ink-soft); }
.path-meta { font-size: 0.76rem; color: var(--ink-faint); margin-top: 2px; }
.path-tick {
  flex: 0 0 auto; color: var(--gold); opacity: 0; font-size: 0.95rem; padding-top: 3px;
}
.path-item.done .path-tick { opacity: 1; }
.path-item.done .path-title { color: var(--ink-soft); }
.related-card.done {
  border-color: color-mix(in srgb, var(--deep) 55%, var(--line));
  background: color-mix(in srgb, var(--deep) 5%, var(--paper-2));
}

@media (max-width: 560px) {
  .route-picker { grid-template-columns: 1fr; }
  .route-chip { min-height: 48px; }
  .route-section-head h2 { font-size: 1.28rem; }
}

/* ---------------------------------------------------------------- footer */

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding: 40px 0 56px;
  margin-top: 40px;
}
.foot-note {
  margin: 0 0 20px; max-width: 68ch;
  font-size: 0.85rem; line-height: 1.65; color: var(--ink-soft);
}
.foot-nav { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 16px; }
.foot-nav a { font-size: 0.86rem; color: var(--ink-soft); text-decoration: none; }
.foot-nav a:hover { color: var(--gold); }
.foot-meta { margin: 0; font-size: 0.78rem; color: var(--ink-faint); }

.corr-none { color: var(--ink-faint); font-style: italic; }

/* ------------------------------------------------------- table of contents */

/* Auto-generated from h2 headings when there are 3 or more.
   Sits between the article header and the body text; subtle, not decorative.
   Wrapped in <details> so readers on mobile can collapse it to recover
   screen space — it is open by default but one tap closes it. */
.toc {
  margin: 20px auto 0;
  width: min(680px, calc(100% - 40px));
  padding: 16px 20px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
/* The <details> inside .toc — reset browser default styles */
.toc-inner {
  margin: 0; border: 0; background: none;
}
.toc-title {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 10px;
  text-transform: uppercase;
  /* As a <summary> element inside .toc-inner <details> */
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.toc-title::-webkit-details-marker { display: none; }
.toc-title::before {
  content: "▸";
  color: var(--gold);
  font-size: 0.85em;
  transition: transform 0.15s ease;
  display: inline-block;
  flex-shrink: 0;
}
.toc-inner[open] > .toc-title::before { transform: rotate(90deg); }
.toc-title:hover { color: var(--gold); }
.toc-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}
.toc-list li {
  margin-bottom: 4px;
  font-family: var(--sans);
  font-size: 0.93rem;
  line-height: 1.45;
}
.toc-list a {
  color: var(--ink-soft);
  text-decoration: none;
  display: block;
  padding: 4px 0;
}
.toc-list a:hover { color: var(--gold); text-decoration: underline; }

@media (max-width: 640px) {
  .toc {
    width: 100%;
    padding: 12px 14px;
  }
  .toc-list li { font-size: 0.9rem; }
}

/* ------------------------------------------------------ section anchor links */

/* Scroll margin is set dynamically by JS via --header-h.
   Fallback 68px covers the desktop 58px header + breathing room. */
.prose h2, .prose h3, .prose h4 {
  scroll-margin-top: calc(var(--header-h) + 8px);
}

/* The # link is invisible until the heading is hovered or focused.
   No new colour — uses --gold-soft already in the palette. */
.h-anchor {
  display: inline-block;
  margin-left: 0.35em;
  color: var(--gold-soft);
  text-decoration: none;
  font-weight: 400;
  font-size: 0.8em;
  opacity: 0;
  transition: opacity 0.15s ease;
  vertical-align: middle;
}
.prose h2:hover .h-anchor,
.prose h3:hover .h-anchor,
.prose h4:hover .h-anchor,
.h-anchor:focus {
  opacity: 1;
}
/* On touch devices, hover never fires — show the anchor faintly so
   readers can still share a direct section link. */
@media (pointer: coarse) {
  .h-anchor { opacity: 0.3; }
}

/* ------------------------------------------------- reading progress bar */

.read-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 200;
  pointer-events: none;
  background: transparent;
}
.read-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width 80ms linear;
}

/* --------------------------------------------------- back to top button */

.back-top {
  position: fixed;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  right: calc(18px + env(safe-area-inset-right, 0px));
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--deep);
  color: var(--paper);
  border: 0;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 40;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ink) 22%, transparent);
}
.back-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-top:hover {
  background: color-mix(in srgb, var(--deep) 80%, var(--paper));
}
@media (prefers-color-scheme: dark) {
  .back-top { color: #14140f; }
}

/* -------------------------------- mobile touch target improvements */

/* Expand citation superscript tap area without changing visual size.
   A 0.62em anchor inside a <sup> is ~10px — far below the 44px target.
   12px top/bottom expands the vertical hit area to ~34px, much closer
   to the 44px standard. inline-flex + align-items centers the number. */
@media (pointer: coarse) {
  sup.cite {
    display: inline-flex;
    align-items: center;
  }
  sup.cite a {
    padding: 12px 6px;
    margin: -12px -6px;
  }

  /* TOC links: full-width touch row, 44px height target.
     Line height 0.9rem × 1.45 ≈ 21px; padding 12px top+bottom → 45px total. */
  .toc-list a {
    display: block;
    padding: 12px 8px;
  }
  /* Remove per-item margin so adjacent items' touch areas don't gap */
  .toc-list li {
    margin-bottom: 0;
  }

  /* Source report link is tiny and at margin-left:auto */
  .src-flag {
    padding: 6px 8px;
    margin: -6px -8px;
  }
}

/* Nav and lang button touch targets on mobile — 12px top+bottom × 2 + ~20px
   line-height ≈ 44px, matching Apple HIG and Google Material touch target spec. */
@media (max-width: 640px) {
  .nav a {
    padding: 12px 6px;
  }
  .lang-btn {
    padding: 12px 10px;
  }
  /* art-facts: date / reading-time / source-count — wrap on narrow screens */
  .art-facts {
    flex-wrap: wrap;
  }
  /* Blockquote: reduce left indent slightly on narrow screens */
  .prose blockquote {
    padding-left: 14px;
  }
  /* Reduce article header top padding — 48px is too spacious on mobile */
  .art-head {
    padding-top: 28px;
  }
  .page-head {
    padding-top: 32px;
  }
  /* Source report flag: on narrow screens move to its own line so it's
     reachable without stretching to the right edge. */
  .src-flag {
    display: block;
    margin-left: 0;
    margin-top: 8px;
  }
}

@media (pointer: coarse) {
  /* "Reset progress" and similar text-button actions — expand touch area. */
  .linkish {
    padding: 10px 4px;
    margin: -10px -4px;
  }
}

/* ------------------------------------------------------- breadcrumb nav */

/* Unstyled <ol> inside breadcrumb renders as bullet list — override to
   a single horizontal row that wraps gracefully on mobile. */
.breadcrumb {
  padding-top: 22px;
  padding-bottom: 0;
}
.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-faint);
}
.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 4px;
}
.breadcrumb li + li::before {
  content: "›";
  color: var(--ink-faint);
  font-size: 0.9em;
}
.breadcrumb a {
  color: var(--ink-faint);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--gold);
}
.breadcrumb [aria-current="page"] {
  color: var(--ink-soft);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 40ch;
}

/* ===== KOMEN (reader comments) ===== */

.komen-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.komen-heading {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.4rem;
  color: var(--ink);
}
.komen-details > summary.komen-heading {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
}
.komen-details > summary.komen-heading::after {
  content: "›";
  font-size: 1.1rem;
  color: var(--ink-soft);
  transition: transform 180ms ease;
  display: inline-block;
}
.komen-details[open] > summary.komen-heading::after {
  transform: rotate(90deg);
}
.komen-details > summary.komen-heading::-webkit-details-marker { display: none; }
.komen-details[open] > summary.komen-heading { margin-bottom: 1.4rem; }

/* Individual comment card */
.komen-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.komen-item:last-child {
  border-bottom: none;
}
.komen-item-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.komen-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}
.komen-item-date {
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-family: var(--sans);
}
.komen-item-body {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.komen-empty {
  font-size: 0.9rem;
  color: var(--ink-faint);
  margin-bottom: 1.4rem;
}

/* Comment submission form */
.komen-form {
  margin-top: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.komen-lbl {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.komen-input {
  font-size: 0.95rem;
  font-family: inherit;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.komen-input:focus {
  outline: none;
  border-color: var(--gold);
}
.komen-textarea {
  resize: vertical;
  min-height: 5rem;
}

/* Civility notice — sits directly above the submit button */
.komen-notice {
  font-size: 0.82rem;
  color: var(--ink-faint);
  line-height: 1.5;
  margin: 0;
  border-left: 2px solid var(--border);
  padding-left: 0.8rem;
}

/* Inline status message after submit */
.komen-msg {
  font-size: 0.88rem;
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  margin: 0;
}
.komen-msg.ok   { background: color-mix(in srgb, var(--green, #2d8a4e) 12%, transparent); color: var(--ink); }
.komen-msg.err  { background: color-mix(in srgb, #c0392b 12%, transparent); color: var(--ink); }
.komen-msg.rate { background: color-mix(in srgb, var(--gold) 15%, transparent); color: var(--ink); }

/* Delete button — only shown to the original poster (localStorage match) */
.komen-del {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--ink-faint);
  padding: 0 0.2rem;
  opacity: 0.4;
  transition: opacity 0.15s, color 0.15s;
}
.komen-del:hover { opacity: 1; color: #c0392b; }
.komen-del:disabled { opacity: 0.2; cursor: default; }

@media (max-width: 640px) {
  .komen-section {
    margin-top: 2rem;
  }
}

/* ===== end KOMEN ===== */

/* ===== TURNING POINTS JUMP ===== */

/* scroll-margin-top so sticky header (--header-h) does not cover the heading
   when arriving via the #titik-perubahan anchor. */
#titik-perubahan {
  scroll-margin-top: calc(var(--header-h) + 12px);
}

/* Bottom turning-points section — heading */
.turning-index > .wrap > h2 {
  margin: 0 0 24px;
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--paper);
}

/* Card grid — fluid columns, minimum 200px wide */
.turning-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

/* Individual turning card */
.turning-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  text-decoration: none;
  color: #17211d;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.turning-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 253, 245, 0.55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

.turning-card--milestone { background: #ffd83d; }
.turning-card--rupture   { background: #f06a57; color: #28110e; }

.turning-card-date {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
  opacity: 0.75;
}

.turning-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .turning-cards {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 380px) {
  .turning-cards {
    grid-template-columns: 1fr;
  }
}

/* ===== end TURNING POINTS JUMP ===== */

/* ===== PAGE-FLIP SOUND ===== */

/* The sound toggle mirrors the .back-top button: fixed position, floating,
   unobtrusive. It sits just above .back-top on the right-hand side. */
.sound-toggle {
  position: fixed;
  right: 1.1rem;
  bottom: 4.6rem;   /* stacked just above .back-top (≈ 3.4 rem button + 0.5 rem gap + own height) */
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: none;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: opacity .2s, transform .15s;
  opacity: 0.55;
  z-index: 90;
}
.sound-toggle:hover,
.sound-toggle:focus-visible {
  opacity: 1;
  transform: scale(1.08);
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
/* When sound is on, use a slightly warmer icon colour so the state is clear. */
.sound-toggle.sound-on {
  color: var(--gold);
  opacity: 0.8;
}

/* ===== LAZY ERA LOADING =====

   The home page renders only the first 3 eras in HTML for faster initial
   parse/paint. Remaining eras are fetched from /api/eras.json and inserted
   by JS when the reader taps "Show all eras". */

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 28px 0 48px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

.load-more-wrap .btn {
  min-width: 200px;
}

/* ===== end LAZY ERA LOADING ===== */

/* ===== end PAGE-FLIP SOUND ===== */

/* ===== MALAYSIAN VISUAL IDENTITY ===== */

/* Footer flag */
.footer-flag {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.4rem;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* Batik-inspired header divider — a thin tri-colour stripe below the sticky header.
   Uses ::after so it doesn't conflict with the existing border-bottom: 1px solid var(--line). */
.site-head {
  position: relative;
}
.site-head::after {
  content: '';
  display: block;
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    #CE1126 0px,  #CE1126 8px,
    #FFD100 8px,  #FFD100 16px,
    #003478 16px, #003478 24px,
    #fff    24px, #fff    32px
  );
  z-index: 51; /* above sticky header z-index:50 */
  pointer-events: none;
}

/* Bunga raya (hibiscus) accent — decorative marker before article chapter numbers */
.seq::before {
  content: '\2756'; /* ❖ BLACK DIAMOND MINUS WHITE X */
  color: var(--gold);
  margin-right: 0.25em;
  font-size: 0.7em;
  vertical-align: middle;
}

/* ===== end MALAYSIAN VISUAL IDENTITY ===== */

/* ===== SITE SEARCH ===== */
.site-search {
  display: flex; align-items: center; gap: 4px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 20px; padding: 3px 8px 3px 12px;
  margin-left: auto;
}
.site-search-input {
  border: none; background: transparent; outline: none;
  font-size: 0.85rem; color: var(--ink); width: 140px;
  font-family: inherit;
}
.site-search-input::placeholder { color: var(--ink-faint); }
.site-search-btn {
  border: none; background: none; cursor: pointer;
  color: var(--ink-faint); font-size: 1rem; padding: 0 2px;
  line-height: 1;
}
.site-search-btn:hover { color: var(--ink); }

/* Search results page */
.search-results { padding: 24px 0; }
.search-results-title { font-family: var(--serif); margin-bottom: 16px; }
.search-count { font-size: 0.9rem; color: var(--ink-faint); margin-bottom: 20px; }
.search-result { padding: 14px 0; border-bottom: 1px solid var(--line); }
.search-result:last-child { border-bottom: none; }
.search-result-title { font-weight: 600; font-size: 1.05rem; margin: 0 0 2px; }
.search-result-title a { text-decoration: none; }
.search-result-title a:hover { color: var(--gold); }
.search-result-sub { font-size: 0.92rem; color: var(--ink-soft); margin: 2px 0; }
.search-result-meta { font-size: 0.82rem; color: var(--ink-faint); margin: 0 0 4px; }
.search-result-desc { color: var(--ink-soft); font-size: 0.93rem; margin: 4px 0 0; }
.search-empty { color: var(--ink-faint); font-style: italic; padding: 32px 0; }

/* Search page form */
.search-page-form { margin: 16px 0 0; }
.search-page-row {
  display: flex; gap: 8px; align-items: center;
  max-width: 480px;
}
.search-page-input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}
.search-page-input:focus { border-color: var(--gold); }
.search-page-btn { border-radius: 20px; padding: 8px 18px; }

/* In-article text search */
.article-search-wrap {
  margin: 0 0 12px;
}
.article-search-input {
  display: block;
  width: 100%;
  max-width: 340px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
}
.article-search-input:focus { border-color: var(--gold-soft); }
.article-search-input::placeholder { color: var(--ink-faint); }
mark.art-srch { background: #FFD100; color: #000; border-radius: 2px; padding: 0 1px; }

/* Scope toggle button — sits inside the nav search form on article pages */
.site-search-scope-btn {
  border: none; background: none; cursor: pointer;
  color: var(--ink-faint); padding: 2px 3px; line-height: 1;
  border-radius: 4px; display: flex; align-items: center;
  transition: color 0.15s, background 0.15s;
}
.site-search-scope-btn:hover { color: var(--ink); background: var(--paper-2); }
.site-search-scope-btn.on {
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
}
.site-search-scope-btn svg { display: block; }

/* In-article search mode indicator pill — appears below the nav */
.art-search-banner {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 6px 14px;
  background: color-mix(in srgb, var(--gold) 14%, var(--paper-2));
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
  font-size: 0.8rem; color: var(--ink-soft);
}
.art-search-banner[hidden] { display: none; }
.art-search-banner-text { flex: 1; text-align: center; }
.art-search-banner-close {
  border: none; background: none; cursor: pointer;
  color: var(--ink-faint); font-size: 1rem; line-height: 1;
  padding: 0 2px; flex-shrink: 0;
}
.art-search-banner-close:hover { color: var(--ink); }

@media (max-width: 640px) {
  .site-search { display: none; }
}

/* ===== ENTITY / TOPIC PAGES ===== */

/* -- Article page: about-tag pills -- */
.art-about {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 22px;
}
.about-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-soft);
  transition: border-color 130ms ease, color 130ms ease, transform 130ms ease;
}
.about-tag:hover { color: var(--ink); transform: translateY(-1px); }
.about-tag--person      { border-left: 3px solid var(--deep);    color: var(--deep); }
.about-tag--place       { border-left: 3px solid #856d38;         color: #856d38; }
.about-tag--legaldocument { border-left: 3px solid #5c4a6b;      color: #5c4a6b; }
.about-tag--thing       { border-left: 3px solid var(--ink-faint); }

/* -- /topik/ index page -- */
.topic-index { padding: 8px 0 60px; }

.topic-group { margin-bottom: 48px; }

.topic-group-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
}
.topic-group-count {
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink-faint);
}

.topic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  text-decoration: none;
  color: var(--ink);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.09);
  border-color: var(--gold-soft);
}
.topic-card--person      { border-left: 3px solid var(--deep); }
.topic-card--place       { border-left: 3px solid #856d38; }
.topic-card--legaldocument { border-left: 3px solid #5c4a6b; }
.topic-card--thing       { border-left: 3px solid var(--ink-faint); }

.topic-name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}
.topic-count {
  font-size: 0.73rem;
  color: var(--ink-faint);
}

/* -- /topik/<name> detail page -- */
.page-topic {}

.topic-meta { margin-bottom: 8px; }

.topic-type {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.topic-type--person {
  background: color-mix(in srgb, var(--deep) 10%, var(--paper));
  color: var(--deep);
  border-color: color-mix(in srgb, var(--deep) 35%, var(--line));
}
.topic-type--place {
  background: color-mix(in srgb, #856d38 10%, var(--paper));
  color: #856d38;
  border-color: color-mix(in srgb, #856d38 35%, var(--line));
}
.topic-type--legaldocument {
  background: color-mix(in srgb, #5c4a6b 10%, var(--paper));
  color: #5c4a6b;
  border-color: color-mix(in srgb, #5c4a6b 35%, var(--line));
}

.topic-name-h1 {
  margin: 8px 0 6px;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}
.topic-wiki-link {
  font-size: 0.84rem;
  color: var(--ink-faint);
  text-decoration: none;
}
.topic-wiki-link:hover { color: var(--gold); }

.topic-articles-heading {
  margin: 32px 0 18px;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.topic-article-list { padding-bottom: 60px; }

/* -- Home page teaser strip -- */
.topik-teaser {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 24px 20px;
  margin: 4px 0;
}
.topik-teaser-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topik-teaser-kicker {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}
.topik-teaser-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
}
@media (max-width: 560px) {
  .topik-teaser-inner { flex-direction: column; align-items: flex-start; }
}

/* Search result snippet (full-text match context) */
.search-result-snippet {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin: 5px 0 0;
  line-height: 1.6;
  font-style: italic;
}

/* ===== end ENTITY / TOPIC PAGES ===== */
/* ===== end SITE SEARCH ===== */

/* ===== SCROLL-NAV (over-scroll → next/prev chapter) ===== */

/* Edge hint: a thin banner that charges up while the reader over-scrolls. */
.scrollnav-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.scrollnav-hint.at-top {
  bottom: auto;
  top: 0;
  border-top: none;
  border-bottom: 1px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  transform: translateY(-8px);
}
.scrollnav-hint.visible {
  opacity: 1;
  transform: translateY(0);
}
.scrollnav-hint-title {
  color: var(--ink);
  font-family: var(--serif);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scrollnav-hint-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0%;
  background: var(--gold);
}
.scrollnav-hint.at-top .scrollnav-hint-fill {
  bottom: auto;
  top: 0;
}

/* One-time permission card, centred above the bottom edge. */
.scrollnav-ask {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 70;
  width: min(92vw, 420px);
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  font-family: var(--sans);
}
.scrollnav-ask-text {
  margin: 0 0 12px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
}
.scrollnav-ask-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.scrollnav-ask-no {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

/* ===== end SCROLL-NAV ===== */
