/* 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 {
  --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 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; }

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);
}

.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); }

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

.era { padding: 52px 0; border-bottom: 1px solid var(--line); }
.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));
}

.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-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);
}

.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; }

.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;
}
.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 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; }

/* ----------------------------------------------------------- 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); }

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

.sources { padding: 34px 20px 10px; margin-top: 24px; border-top: 1px solid var(--line); }
.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: 76px;
}
.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; }

/* 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; }

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

.art-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 30px 20px 60px;
}
.pn {
  display: flex; flex-direction: column; gap: 5px;
  padding: 16px 18px; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-2);
}
.pn:hover { border-color: var(--gold-soft); }
.pn-empty { border: 0; background: none; }
.pn-label { font-size: 0.76rem; color: var(--gold); letter-spacing: 0.04em; }
.pn-title { font-family: var(--serif); font-size: 1rem; line-height: 1.3; }
.pn-next { text-align: right; }
@media (max-width: 560px) { .art-nav { grid-template-columns: 1fr; } }

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

.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); }

.path { list-style: none; margin: 0 0 60px; padding: 0; }
.path-item { border-bottom: 1px solid 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); }

/* ---------------------------------------------------------------- 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; }
