/* Panduan Jalinara — gaya situs. Warna & font mengikuti dashboard Jalinara. */

@font-face { font-family: "Inter"; src: url(fonts/inter-var.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url(fonts/jakarta-var.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --ink: #12263f;
  --ink-2: #44546a;
  --ink-3: #66748a;
  --line: #e3e8ef;
  --line-2: #cfd6e0;
  --accent: #2a5db0;
  --accent-ink: #1f4c96;
  --accent-soft: #e8f0fc;
  --shadow: 0 1px 2px rgba(18, 38, 63, .06), 0 10px 28px -14px rgba(18, 38, 63, .22);

  --tips-bg: #eaf1fc;   --tips-line: #2a5db0;   --tips-ink: #1f4c96;
  --warn-bg: #fff4dc;   --warn-line: #c98a12;   --warn-ink: #7a4f06;
  --ok-bg:   #e9f6ee;   --ok-line:   #2e8b5a;   --ok-ink:   #146039;
  --plan-bg: #f1edfb;   --plan-line: #6d51c9;   --plan-ink: #4d36a0;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --sidebar-w: 288px;
  --col: 760px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1722;
  --bg-soft: #0a1220;
  --ink: #e7ebf0;
  --ink-2: #b4bfcc;
  --ink-3: #8f9bab;
  --line: #1f2b3b;
  --line-2: #2c3b50;
  --accent: #7aa5ec;
  --accent-ink: #9dbdf2;
  --accent-soft: rgba(122, 165, 236, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .6);

  --tips-bg: rgba(122, 165, 236, .12);  --tips-line: #7aa5ec;  --tips-ink: #a9c6f4;
  --warn-bg: rgba(245, 177, 61, .12);   --warn-line: #e0a23a;  --warn-ink: #f0c479;
  --ok-bg:   rgba(79, 178, 126, .12);   --ok-line:   #4fb27e;  --ok-ink:   #86d4ab;
  --plan-bg: rgba(139, 123, 232, .15);  --plan-line: #9a8cf0;  --plan-ink: #bdb3f6;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1722; --bg-soft: #0a1220; --ink: #e7ebf0; --ink-2: #b4bfcc; --ink-3: #8f9bab;
    --line: #1f2b3b; --line-2: #2c3b50; --accent: #7aa5ec; --accent-ink: #9dbdf2;
    --accent-soft: rgba(122, 165, 236, .14);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .6);
    --tips-bg: rgba(122, 165, 236, .12);  --tips-line: #7aa5ec;  --tips-ink: #a9c6f4;
    --warn-bg: rgba(245, 177, 61, .12);   --warn-line: #e0a23a;  --warn-ink: #f0c479;
    --ok-bg:   rgba(79, 178, 126, .12);   --ok-line:   #4fb27e;  --ok-ink:   #86d4ab;
    --plan-bg: rgba(139, 123, 232, .15);  --plan-line: #9a8cf0;  --plan-ink: #bdb3f6;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.7 var(--font-body); -webkit-font-smoothing: antialiased;
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
button { font: inherit; color: inherit; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--bg-soft); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 4px 8px 14px; }
.brand:hover { color: var(--ink); }
.brand svg { flex: none; }
.brand b { font: 700 17px/1.1 var(--font-display); letter-spacing: -.01em; display: block; }
.brand span { font-size: 12px; color: var(--ink-3); display: block; margin-top: 2px; }

.search-btn {
  display: flex; align-items: center; gap: 9px; width: 100%; margin: 0 0 14px;
  padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--bg); color: var(--ink-3); cursor: pointer; font-size: 14px; text-align: left;
}
.search-btn:hover { border-color: var(--accent); }
.search-btn kbd { margin-left: auto; font: 500 11px var(--font-body); color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }

.nav { flex: 1; }
.nav a, .nav summary {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-size: 14.5px; line-height: 1.4;
}
.nav a:hover, .nav summary:hover { background: var(--accent-soft); color: var(--ink); }
.nav .home { font-weight: 500; margin-bottom: 8px; }
.nav details { margin-top: 2px; }
.nav summary { cursor: pointer; list-style: none; font-weight: 600; color: var(--ink); }
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after {
  content: ""; width: 7px; height: 7px; margin-left: auto; margin-right: 4px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(-45deg); transition: transform .15s;
}
.nav details[open] > summary::after { transform: rotate(45deg); }
.nav ul { list-style: none; margin: 2px 0 6px 15px; padding: 0 0 0 8px; border-left: 1px solid var(--line-2); }
.nav ul a { font-size: 14px; padding: 6px 10px; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

.side-foot { display: flex; align-items: center; gap: 8px; padding-top: 14px; margin-top: 10px; border-top: 1px solid var(--line); }
.open-app {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px;
  background: var(--accent); color: #fff; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 14px;
}
.open-app:hover { background: var(--accent-ink); color: #fff; }
:root[data-theme="dark"] .open-app { color: #0a1220; }
:root[data-theme="dark"] .open-app:hover { color: #0a1220; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .open-app, :root:not([data-theme="light"]) .open-app:hover { color: #0a1220; } }
.icon-btn {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; color: var(--ink-2);
}
.icon-btn:hover { border-color: var(--accent); color: var(--ink); }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}

/* ---------- Top bar (mobile) ---------- */
.topbar { display: none; }

/* ---------- Artikel ---------- */
.main { min-width: 0; padding: 56px 40px 72px; }
.article { max-width: var(--col); margin: 0 auto; }
.eyebrow { font: 600 13px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.article h1 { font: 800 clamp(28px, 4vw, 38px)/1.15 var(--font-display); letter-spacing: -.02em; word-spacing: .06em; margin: 0 0 14px; }
.lede { font-size: 18px; line-height: 1.6; color: var(--ink-2); margin: 0 0 20px; }
.actions { display: flex; gap: 8px; margin: 0 0 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--ink-2); cursor: pointer;
}
.pill:hover { border-color: var(--accent); color: var(--ink); }

.article h2 { font: 700 23px/1.3 var(--font-display); letter-spacing: -.01em; word-spacing: .06em; margin: 48px 0 12px; }
.article h3 { font: 700 18px/1.4 var(--font-display); word-spacing: .05em; margin: 32px 0 8px; }
.article p { margin: 0 0 16px; }
.article strong { font-weight: 650; color: var(--ink); }
.article code { font: 500 .88em ui-monospace, "IBM Plex Mono", Consolas, monospace; background: var(--accent-soft); color: var(--accent-ink); padding: 1px 6px; border-radius: 5px; }
.article code.nw { white-space: nowrap; }
.article pre { margin: 14px 0 20px; padding: 14px 16px; overflow-x: auto; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; }
.article pre code { background: none; color: var(--ink); padding: 0; border-radius: 0; font-size: .86em; line-height: 1.6; white-space: pre; }
.article ul { padding-left: 22px; margin: 0 0 18px; }
.article li { margin: 5px 0; }
.article hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }

/* Langkah bernomor */
.article ol { list-style: none; counter-reset: step; padding: 0; margin: 26px 0 8px; }
.article ol > li { counter-increment: step; position: relative; padding-left: 52px; margin: 0 0 30px; }
.article ol > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; font: 700 15px/34px var(--font-display); text-align: center;
}
:root[data-theme="dark"] .article ol > li::before { color: #0a1220; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .article ol > li::before { color: #0a1220; } }
.article ol > li::after { content: ""; position: absolute; left: 16px; top: 42px; bottom: -22px; width: 2px; background: var(--line); }
.article ol > li:last-child::after { display: none; }
.article ol > li > p:first-child { margin-top: 5px; font-size: 17px; }
/* daftar bersarang = daftar biasa, bukan langkah */
.article li ol { list-style: decimal; counter-reset: none; padding-left: 20px; margin: 4px 0 14px; }
.article li ol > li { counter-increment: none; padding-left: 4px; margin: 4px 0; }
.article li ol > li::before, .article li ol > li::after { content: none; }
.article li ol > li > p:first-child { margin-top: 0; font-size: inherit; }

/* Gambar */
.article figure { margin: 14px 0 6px; }
.article figure img {
  display: block; width: 100%; height: auto; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--bg-soft); box-shadow: var(--shadow); cursor: zoom-in;
}
.article figure.tall img { max-width: 400px; }
.article figure.zoomable { position: relative; }
.article figure .zoom-hint {
  position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 5px; pointer-events: none;
  font-size: 12px; font-weight: 600; color: #fff; background: rgba(18, 38, 63, .78); padding: 4px 9px; border-radius: 999px;
  opacity: 0; transition: opacity .15s;
}
.article figure:hover .zoom-hint, .article figure:focus-within .zoom-hint { opacity: 1; }

/* Kotak info */
.callout { margin: 16px 0; padding: 13px 16px 13px 14px; border-radius: 12px; border-left: 4px solid var(--tips-line); background: var(--tips-bg); }
.callout-title { display: flex; align-items: center; gap: 7px; font: 700 13.5px/1.3 var(--font-display); color: var(--tips-ink); margin-bottom: 3px; }
.callout-title svg { flex: none; }
.callout-body { font-size: 15px; line-height: 1.6; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-body p { margin: 0 0 8px; }
.callout-penting { background: var(--warn-bg); border-color: var(--warn-line); }
.callout-penting .callout-title { color: var(--warn-ink); }
.callout-hasil { background: var(--ok-bg); border-color: var(--ok-line); }
.callout-hasil .callout-title { color: var(--ok-ink); }
.callout-paket { background: var(--plan-bg); border-color: var(--plan-line); }
.callout-paket .callout-title { color: var(--plan-ink); }

/* Tabel */
.table-wrap { overflow-x: auto; margin: 16px 0 22px; border: 1px solid var(--line); border-radius: 12px; }
.article table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.55; }
.article th { text-align: left; font: 700 12.5px var(--font-display); letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); background: var(--bg-soft); }
.article th, .article td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.article tr:last-child td { border-bottom: 0; }

/* Kartu rujukan (halaman depan) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 18px 0 8px; }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards a {
  display: block; padding: 16px 18px; border: 1px solid var(--line-2); border-radius: 14px; text-decoration: none;
  background: var(--bg); color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.cards a:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); color: var(--ink); }
.cards a b { display: block; font: 700 16px/1.3 var(--font-display); margin-bottom: 4px; }
.cards a span { font-size: 14px; color: var(--ink-3); line-height: 1.5; }

/* Navigasi bawah */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 56px 0 0; }
.pager a { display: block; padding: 14px 18px; border: 1px solid var(--line-2); border-radius: 12px; text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.pager b { font: 650 15px/1.3 var(--font-display); }
.pager .next { grid-column: 2; text-align: right; }
.help-foot { margin: 40px 0 0; padding: 16px 18px; border-radius: 12px; background: var(--bg-soft); color: var(--ink-2); font-size: 14.5px; }
.help-foot p { margin: 0; }

/* Pencarian & lightbox */
dialog { border: 0; padding: 0; background: transparent; color: inherit; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(10, 18, 32, .6); backdrop-filter: blur(2px); }
.search-dlg { width: min(620px, calc(100vw - 24px)); margin: 12vh auto auto; }
.search-box { background: var(--bg); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5); overflow: hidden; }
.search-box input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink);
  font: 16px var(--font-body); padding: 16px 18px; outline: none;
}
.search-box input::placeholder { color: var(--ink-3); }
.results { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.results a[aria-selected="true"], .results a:hover { background: var(--accent-soft); }
.results b { display: block; font: 650 15px/1.3 var(--font-display); }
.results small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 1px; }
.results .empty { padding: 20px 14px; color: var(--ink-3); font-size: 14.5px; text-align: center; }
.search-foot { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); display: flex; gap: 14px; }
.lightbox { width: 100vw; height: 100vh; display: none; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 96vw; max-height: 94vh; border-radius: 10px; background: #fff; cursor: zoom-out; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }

/* ---------- Layar kecil ---------- */
@media (max-width: 900px) {
  .lightbox[open] { display: block; overflow: auto; background: rgba(10, 18, 32, .92); }
  .lightbox img { max-width: none; max-height: none; width: max(100vw, 980px); border-radius: 0; margin: 0; }
  body { grid-template-columns: minmax(0, 1fr); }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; height: 56px; padding: 0 16px;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  }
  .topbar .brand { padding: 0; flex: 1; }
  .topbar .brand span { display: none; }
  .sidebar {
    position: fixed; z-index: 40; left: 0; top: 0; width: min(320px, 86vw); transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 30; background: rgba(10, 18, 32, .5); }
  .sidebar .brand { display: none; }
  .main { padding: 28px 16px 56px; }
  .lede { font-size: 17px; }
  .article ol > li { padding-left: 46px; }
  .article figure.tall img { max-width: 100%; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}
@media (max-width: 600px) { .cards.two { grid-template-columns: 1fr; } }

@media print {
  .sidebar, .topbar, .actions, .pager, .help-foot, .zoom-hint { display: none !important; }
  body { display: block; }
  .main { padding: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
