/* ============================================================================
   WorldClim Indonesia — WCU Visual Clone Layer
   Palet & tipografi dikloning 1:1 dari Dashboard WCU (/wcu/):
     Navy #013880 · Deep Navy #012558 · Gold #ffbd07 · Gold Ink #8a5e00
     Display: Montserrat 800 · Body: Inter · Mono: JetBrains Mono
   Header & footer mengikuti struktur .header / .site-footer milik WCU.
   Dimuat SETELAH <style id="wc-atlas-system"> agar menimpa token lama.
   ============================================================================ */

:root,
body.light {
  /* Institutional palette (identik WCU) */
  --accent: #013880;
  --accent-deep: #012558;
  --accent-hover: #0a4b9c;
  --accent-soft: #eaf2fb;
  --accent2: #ffbd07;
  --gold-ink: #8a5e00;
  --gold-soft: #fff8e1;
  --gold-border: #efc854;

  /* Token WorldClim dipetakan ke palet WCU */
  --canvas: #edf2f7;
  --paper: #ffffff;
  --subtle: #f4f7fb;
  --subtle-2: #eaf2fb;
  --line: #c5d3e3;
  --line-strong: #a6bad1;

  --ink: #091322;
  --ink-2: #1f2e42;
  --ink-3: #33455e;

  --brand: #013880;
  --brand-deep: #012558;
  --brand-soft: #eaf2fb;
  --brand-line: #8fb4de;

  /* Kode semantik variabel — biru ITS / emas ITS (tanpa hijau & merah) */
  --bioc-ink: #013880;
  --bioc-bg: #e8f1fc;
  --bioc-bd: #8fb4de;

  --prec-ink: #0b5aa8;
  --prec-bg: #eaf2fb;
  --prec-bd: #7aa9db;

  --tmin-ink: #0d2f6b;
  --tmin-bg: #eef4fb;
  --tmin-bd: #a8c1e0;

  --tmax-ink: #8a5e00;
  --tmax-bg: #fff8e1;
  --tmax-bd: #efc854;

  /* Tipografi (identik WCU) */
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Montserrat', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --font-sans: var(--font);
  --font-head: var(--font-display);
  --font-mono: var(--mono);

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--canvas);
  background-image: radial-gradient(ellipse 90% 420px at 50% 0%, rgba(1, 56, 128, 0.055), transparent 70%);
  color: var(--ink);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); }
code, pre, kbd, samp { font-family: var(--mono); }

/* Navbar lama tidak dipakai lagi — matikan garis gradien lama */
.topbar, .arch-footer { display: none; }

/* Amankan jangkar terhadap header sticky */
[id] { scroll-margin-top: 92px; }

/* ============================================================================
   HEADER — klon .header WCU (gradient navy + bloom emas)
   ============================================================================ */
.header {
  background: linear-gradient(125deg, #01204c 0%, #013880 55%, #0b4f9e 100%);
  position: sticky;
  top: 0;
  z-index: 70;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(1, 32, 76, 0.18);
}

.header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 82% -20%, rgba(255, 189, 7, 0.14), transparent 46%);
  pointer-events: none;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.h-left { display: flex; align-items: center; gap: 14px; min-width: 0; }

.h-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none !important;
  color: inherit;
  min-width: 0;
}

.h-brand img {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
}

.header h1 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: #ffffff;
}

.h-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.94);
}

.h-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.h-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.h-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.86);
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.h-nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.h-nav a.active {
  background: rgba(255, 255, 255, 0.17);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  box-shadow: inset 0 -2px 0 var(--accent2);
}

.h-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92) !important;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}

.h-pill:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.32); color: #ffffff !important; }

/* ============================================================================
   FOOTER — klon .site-footer WCU (gradient navy + garis emas 4px)
   ============================================================================ */
.site-footer {
  width: 100%;
  margin-top: auto;
  background: linear-gradient(125deg, #01204c 0%, #013880 58%, #0b4f9e 100%);
  border-top: 4px solid var(--accent2);
  color: rgba(255, 255, 255, 0.9);
}

.site-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  line-height: 1.6;
}

.site-footer-inner p { margin: 0; color: rgba(255, 255, 255, 0.9); }

.site-footer-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.site-footer-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none !important;
  font-weight: 500;
  transition: color 0.16s;
}

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

/* ============================================================================
   Penyesuaian permukaan (kartu, tabel, kontrol) agar selaras dengan WCU
   ============================================================================ */
.ds-intro h1, .doc-hero h1 { color: var(--ink); }
.data-table th, .gcm-table th { color: var(--ink-2); }
.card, .ds-ledger, .facet-rail, .toc-card, .ds-cell, .ws-tools, .data-table, .gcm-card {
  border-color: var(--line);
}

/* ============================================================================
   Responsif — nilai padding/ukuran mengikuti breakpoint WCU
   ============================================================================ */
@media (max-width: 1080px) {
  .header-inner { padding: 12px 18px; }
  .header h1 { font-size: 1.32rem; }
}

@media (max-width: 760px) {
  .header-inner { padding: 10px 14px; gap: 10px; }
  .header h1 { font-size: 1.15rem; }
  .h-brand img { height: 34px; }
  .h-brand { gap: 10px; }
  .h-sub { font-size: 0.63rem; letter-spacing: 0.06em; }
  .h-right { width: 100%; }
  .h-nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; padding-bottom: 2px; }
  .h-nav::-webkit-scrollbar { display: none; }
  .h-nav a { min-height: 34px; padding: 0 11px; font-size: 0.78rem; }
  .h-pill { display: none; }
  .site-footer-inner { padding: 18px 16px; justify-content: center; text-align: center; flex-direction: column; }
  .site-footer-links { justify-content: center; gap: 12px; }
  [id] { scroll-margin-top: 120px; }
}

/* Status dot halaman: emas ITS (bukan hijau) */
.ds-dot {
  background: var(--accent2) !important;
  box-shadow: 0 0 0 3px rgba(255, 189, 7, 0.28);
}

/* Status kurasi & tag domain (halaman metodologi) → biru/emas ITS */
:root {
  --used-ink: #013880;
  --used-bg: #e8f1fc;
  --used-bd: #8fb4de;

  --skip-ink: #8a5e00;
  --skip-bg: #fff8e1;
  --skip-bd: #efc854;

  --therm-ink: #8a5e00;
  --therm-bg: #fff8e1;

  --hydro-ink: #0b5aa8;
  --hydro-bg: #eaf2fb;
}

/* URL panjang di blok sitasi jangan meluber di ponsel */
.cite-list a, .doc-body a, .panel-body a, .kv-table a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Samakan perilaku scrollbar dengan /wcu/ agar lebar header konsisten antarhalaman */
body { overflow-x: hidden; }

/* Halaman tanpa reset sendiri (mis. /worldclim/kredit/) — hilangkan margin bawaan */
body { margin: 0; }

/* ============================================================================
   KETEGASAN TEKS & PERMUKAAN (permintaan Prof: lebih tegas/tajam)
   Acuan warna teks = beranda geo.its.ac.id: #162030 utama, #475569 sekunder.
   Permukaan dibuat lebih putih + hairline lebih tegas agar teks terbaca tajam.
   ============================================================================ */
:root, body.light {
  /* Teks */
  --ink: #162030;      /* judul & angka utama */
  --ink-2: #263241;    /* isi paragraf, sel tabel, label kecil */
  --ink-3: #475569;    /* meta tersier (tanggal, satuan, keterangan) */

  /* Permukaan lebih putih (kontras naik tanpa mengubah aksen ITS) */
  --canvas: #f7f9fc;
  --paper: #ffffff;
  --subtle: #eef2f8;
  --subtle-2: #e5ecf4;

  /* Garis & pemisah lebih tegas */
  --line: #c2cfdf;
  --line-strong: #98abc2;
}

body {
  background-color: var(--canvas);
  background-image: radial-gradient(ellipse 90% 420px at 50% 0%, rgba(1, 56, 128, 0.04), transparent 70%);
  color: var(--ink-2);
}

/* Judul & angka: hitam-navy pekat */
h1, h2, h3, h4, h5, h6,
.ds-intro h1, .doc-hero h1, .panel-head h2, h1.page-title,
.ds-cell b, .kpi b, .kv-table td:last-child, .doc-body strong, .panel-body strong {
  color: var(--ink);
}

/* Isi teks: satu tingkat lebih tajam dari label sekunder */
.ds-intro p, .doc-body p, .panel-body p, .lede, .caveat-list,
.data-table td, .kv-table td, .cite-list li, .st-reason {
  color: var(--ink-2);
}

/* Label kecil/mono: jangan pudar (#33455e lama → #263241) */
.lbl, .ds-bbox, .ssp-desc, .ds-spec, .wc-status, .cite-box-head span,
.kv-table td:first-child, .brand-org, .breadcrumb, .ds-specs .ds-spec {
  color: var(--ink-2);
}

/* Meta benar-benar tersier */
.foot small, .ds-stamp, .cite-list a {
  color: var(--ink-3);
}

/* Kepala tabel & chip: teks lebih gelap, garis sel lebih tegas */
.data-table thead th, .gcm-table thead th, .wc-tbl thead th {
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}
.data-table td, .data-table th, .kv-table td, .doc-head, .panel-head {
  border-color: var(--line);
}
.data-table tbody tr:hover { background: #f2f7fd; }

/* Badge/kode: pastikan tetap kontras di permukaan putih */
code {
  background: var(--subtle);
  color: var(--ink);
  border-color: var(--line);
}

/* Naikkan satu tingkat label kecil di kartu ledger (spesifisitas ≥ rule lama) */
.ds-cell .lbl, .ds-cell .sub, .ds-intro .ds-bbox, .ds-specs .ds-spec,
.ds-stamp span, .ws-bar .wc-status { color: var(--ink-2); }
.data-table thead th, .data-table tbody td { border-color: var(--line); }

/* Badge & label kecil: pekatkan tinta agar ≥7:1 tanpa mengubah latar */
.st-pill.skip, .dom-tag.t, .st-pill.used, .dom-tag.h { font-weight: 700; }
.st-pill.skip, .dom-tag.t { color: #6d4a00; border-color: #d9b63f; }
.st-pill.used { color: #012f6b; }
.dom-tag.h { color: #0a4a8a; }
.toc-head, .toc-links a, .st-reason { color: var(--ink-2); }

/* Hak cipta footer: putih bersih (bukan abu/transparan) */
.site-footer-inner p { color: #ffffff; opacity: 1; font-weight: 500; letter-spacing: 0.002em; }

/* ============================================================================
   AKSEN EMAS ITS — pola sama dengan /wcu/ (.sc border-left emas, .news-dot,
   .h-pill-dot, garis emas footer). Sebelumnya halaman hanya biru + putih.
   ============================================================================ */
.datasheet, .workspace, .facet-rail, .doc-card, .panel, .toc-card {
  border-left: 3px solid var(--accent2);
}

/* Kepala seksi: garis emas tipis di kiri judul */
.sec-head h2, .panel-head h2, .doc-head h2 {
  padding-left: 10px;
  border-left: 3px solid var(--accent2);
  line-height: 1.25;
}

/* Badge identitas data: emas, bukan biru pudar */
.ds-badge {
  background: var(--gold-soft);
  color: #6d4a00;
  border-color: var(--gold-border);
}

/* Pita atas angka ringkas + penanda butir terpilih */
.ds-ledger { border-top: 3px solid var(--accent2); }
.view-btn.active { box-shadow: inset 0 -2px 0 var(--accent2); }
.wc-apply-btn { border-bottom: 2px solid var(--accent2); }

/* Penanda kecil (dot/kicker) tetap emas */
.ds-stamp span::first-line { color: inherit; }
.sep-gold { color: var(--gold-ink); }

/* Halaman metodologi: aksen emas pada tiap blok dokumen + nomor seksi */
.doc-sec { border-left: 3px solid var(--accent2); }
.doc-sec .sec-idx, .doc-sec .sec-bar .idx { color: var(--gold-ink); }
.toc-links a.active { border-left: 3px solid var(--accent2); }

/* Emas terlihat dari layar pertama: garis bawah header + bloom lebih kuat */
.header {
  border-bottom: 3px solid var(--accent2);
}
.header::after {
  background: radial-gradient(circle at 82% -20%, rgba(255, 189, 7, 0.22), transparent 48%);
}

/* ============================================================================
   TEKS HITAM PEKAT (permintaan Prof) — judul/angka #000, isi nyaris hitam,
   hierarki tetap ada tapi tidak ada lagi kesan navy-pudar.
   ============================================================================ */
:root, body.light {
  --ink: #000000;      /* judul, angka KPI, angka tabel */
  --ink-2: #0b1220;    /* isi paragraf, sel tabel, label kecil */
  --ink-3: #2b3746;    /* meta tersier — tetap gelap, bukan abu pudar */
}

body { color: var(--ink-2); }

h1, h2, h3, h4, h5, h6,
.ds-intro h1, .doc-hero h1, .panel-head h2, h1.page-title, .sec-head h2, .doc-head h2,
.ds-cell b, .kpi b, .kv-table td:last-child, .doc-body strong, .panel-body strong,
.data-table thead th, .data-table tbody td, .gcm-table tbody td, .wc-tbl tbody td,
.nav-item .v, .metric .v {
  color: #000000;
}

.ds-intro p, .doc-body p, .panel-body p, .lede, .caveat-list, .cite-list li,
.st-reason, .ds-cell .lbl, .ds-cell .sub, .ds-bbox, .ds-spec, .wc-status, .toc-head, .toc-links a {
  color: var(--ink-2);
}

/* Logo beranda geo.its.ac.id: mark persegi 192x192 — samakan ukuran dengan navbar beranda (40 px) */
.h-brand img { height: 40px; filter: none; }
@media (max-width: 760px) { .h-brand img { height: 32px; } }

/* ===== LOGO PONSEL SERAGAM (34px, sesuai beranda) ===== */
@media (max-width: 760px) {
  .logo, .nav-logo, header img { width: 34px !important; height: 34px !important; background: transparent !important; padding: 0 !important; border-radius: 0 !important; box-shadow: none !important; object-fit: contain !important; }
}
