/* Petunjuk Penggunaan LMS OBE — gaya bersama. Sengaja mandiri (tanpa font/skrip eksternal)
   supaya buku petunjuk tetap terbaca walau server aplikasi atau internet bermasalah. */
:root {
  --ink: #0d4a1c;          /* hijau tua — judul, tautan utama */
  --ink-2: #1f6b34;        /* nuansa lebih terang — diturunkan otomatis saat admin mengganti warna */
  --ink-3: #2f8a49;
  --ink-dark: #0a3a16;     /* ujung gradien hero */
  --gold: #b8863b;         /* emas — aksen */
  --gold-soft: #f3e6c8;
  --paper: #f7f4ec;        /* latar krem */
  --card: #ffffff;
  --text: #1f2a24;
  --muted: #5b6a61;
  --line: #e2dccb;
  --tip: #e7f3ea;   --tip-line: #7fb48f;
  --warn: #fdf0e0;  --warn-line: #e0a458;
  --info: #e8eff8;  --info-line: #7a9cc6;
  --priv: #f7ebf3;  --priv-line: #b985a8;
  --radius: 10px;
  --sidebar: 270px;
  --head-h: 62px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 16px/1.72 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--ink-2); text-underline-offset: 2px; }
a:hover { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: .6em 1em; border-radius: 6px; z-index: 200; }
.skip:focus { left: 8px; }

/* ---------- kepala ---------- */
.head { position: sticky; top: 0; z-index: 100; background: var(--ink); color: #fff; height: var(--head-h); display: flex; align-items: center; gap: 1rem; padding: 0 1.2rem; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.brand { display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand .mark { width: 34px; height: 34px; border-radius: 8px; background: var(--gold); color: #fff; display: grid; place-items: center; font: 700 .85rem Georgia, serif; letter-spacing: .02em; }
.brand small { display: block; font-weight: 400; font-size: .7rem; opacity: .75; margin-top: -2px; }
.nav { display: flex; gap: .2rem; margin-left: .8rem; }
.nav a { color: rgba(255,255,255,.88); text-decoration: none; padding: .45em .85em; border-radius: 7px; font-size: .92rem; }
.nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.cari { position: relative; margin-left: auto; width: min(340px, 36vw); }
.cari input { width: 100%; padding: .55em .9em .55em 2.7em; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12); color: #fff; font-size: .92rem; }
.cari input::placeholder { color: rgba(255,255,255,.72); }
.cari input:focus { background: #fff; color: var(--text); outline: 3px solid var(--gold); }
.cari input:focus::placeholder { color: var(--muted); }
.cari .ico { position: absolute; left: .85em; top: 50%; transform: translateY(-50%); opacity: .8; pointer-events: none; }
.hasil { position: absolute; right: 0; top: calc(100% + 8px); width: min(520px, 92vw); max-height: 70vh; overflow: auto; background: #fff; color: var(--text); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.28); border: 1px solid var(--line); padding: .4rem; display: none; }
.hasil.buka { display: block; }
.hasil a { display: block; padding: .6em .8em; border-radius: 8px; text-decoration: none; color: var(--text); }
.hasil a:hover, .hasil a.aktif { background: var(--gold-soft); }
.hasil .h-judul { font-weight: 650; color: var(--ink); }
.hasil .h-meta { font-size: .72rem; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.hasil .h-cuplikan { font-size: .85rem; color: var(--muted); margin-top: .15em; }
.hasil mark { background: #ffe9a6; color: inherit; padding: 0 .1em; border-radius: 3px; }
.hasil .kosong { padding: .9em; color: var(--muted); font-size: .9rem; }
.menu-btn { display: none; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 8px; padding: .5em .75em; font-size: 1rem; cursor: pointer; }

/* ---------- tata letak ---------- */
.wrap { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: 2.2rem; max-width: 1180px; margin: 0 auto; padding: 1.8rem 1.4rem 4rem; }
.toc { position: sticky; top: calc(var(--head-h) + 18px); align-self: start; max-height: calc(100vh - var(--head-h) - 36px); overflow: auto; font-size: .9rem; padding-right: .4rem; }
.toc h2 { font: 700 .72rem system-ui; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin: 0 0 .6rem; }
.toc ol, .toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: .32em .7em; border-left: 3px solid transparent; color: var(--muted); text-decoration: none; border-radius: 0 6px 6px 0; line-height: 1.4; }
.toc a:hover { color: var(--ink); background: rgba(13,74,28,.06); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.toc a.on { color: var(--ink); border-left-color: var(--gold); background: rgba(184,134,59,.12); font-weight: 600; }
.toc .l3 a { padding-left: 1.6em; font-size: .85rem; }
main { min-width: 0; max-width: 800px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.5rem; }

/* ---------- tipografi isi ---------- */
main h1 { font: 700 2.1rem/1.2 Georgia, "Times New Roman", serif; color: var(--ink); margin: 0 0 .4rem; }
main .lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 1.4rem; }
main h2 { font: 700 1.55rem/1.3 Georgia, "Times New Roman", serif; color: var(--ink); margin: 3rem 0 .7rem; padding-top: 1.4rem; border-top: 3px double var(--line); }
main h2:first-of-type { margin-top: 1.5rem; }
main h3 { font: 700 1.18rem/1.35 system-ui, sans-serif; color: var(--ink-2); margin: 2rem 0 .5rem; }
main h4 { font-size: 1rem; margin: 1.3rem 0 .3rem; color: var(--text); }
main p { margin: .7rem 0; }
main ul, main ol { padding-left: 1.4rem; margin: .7rem 0; }
main li { margin: .3rem 0; }
.anchor { margin-left: .4rem; font-size: .8em; opacity: 0; text-decoration: none; color: var(--gold); }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
code, .kbd { font: .86em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #efeadc; padding: .12em .4em; border-radius: 5px; }
.kbd { border: 1px solid #d6cfba; border-bottom-width: 2px; background: #fff; }
.ui { display: inline-block; font-weight: 600; font-size: .9em; background: #fff; border: 1px solid var(--gold); color: var(--ink); padding: 0 .5em; border-radius: 6px; line-height: 1.55; white-space: nowrap; }
.menu { display: inline-block; font-weight: 600; font-size: .9em; background: var(--ink); color: #fff; padding: 0 .55em; border-radius: 6px; line-height: 1.55; white-space: nowrap; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .1em .6em; border-radius: 999px; background: var(--gold-soft); color: #7a5413; vertical-align: 2px; }

/* langkah bernomor */
ol.steps { counter-reset: s; list-style: none; padding-left: 0; }
ol.steps > li { counter-increment: s; position: relative; padding: .15rem 0 .15rem 2.6rem; margin: .75rem 0; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: .1rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: .9rem; display: grid; place-items: center; }

/* kotak catatan */
.callout { border: 1px solid; border-left-width: 5px; border-radius: 8px; padding: .8rem 1.1rem; margin: 1.1rem 0; }
.callout > :first-child { margin-top: 0; } .callout > :last-child { margin-bottom: 0; }
.callout .t { display: block; font-weight: 700; margin-bottom: .2rem; }
.callout.tip  { background: var(--tip);  border-color: var(--tip-line); }
.callout.warn { background: var(--warn); border-color: var(--warn-line); }
.callout.info { background: var(--info); border-color: var(--info-line); }
.callout.priv { background: var(--priv); border-color: var(--priv-line); }

/* tabel */
.tbl-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
table.tbl { border-collapse: collapse; width: 100%; font-size: .93rem; }
table.tbl th, table.tbl td { padding: .6rem .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.tbl th { background: #f0ebdb; color: var(--ink); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
table.tbl tr:last-child td { border-bottom: 0; }

/* kartu peran (beranda) */
.hero { background: linear-gradient(135deg, var(--ink) 0%, var(--ink-dark) 100%); color: #fff; border-radius: 16px; padding: 2.4rem 2rem; margin-bottom: 1.8rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(184,134,59,.45), transparent 70%); }
.hero h1 { color: #fff; font-size: 2.3rem; }
.hero p { color: rgba(255,255,255,.84); max-width: 560px; margin: .4rem 0 0; position: relative; z-index: 1; }
.peran { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.4rem 0; }
.peran a { display: block; background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--gold); border-radius: var(--radius); padding: 1.2rem 1.2rem 1rem; text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s; }
.peran a:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(13,74,28,.14); box-shadow: 0 10px 24px color-mix(in srgb, var(--ink) 14%, transparent); }
.peran .ik { font-size: 1.8rem; display: block; margin-bottom: .3rem; }
.peran strong { display: block; font: 700 1.2rem Georgia, serif; color: var(--ink); }
.peran span.d { display: block; font-size: .9rem; color: var(--muted); margin: .3rem 0 .6rem; }
.peran span.go { font-weight: 700; color: var(--gold); font-size: .9rem; }
.dua { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
figure.diagram { margin: 1.4rem 0; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
figure.diagram svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
/* diagram OBE mengikuti warna tema */
figure.diagram .sv-ink { fill: var(--ink); } figure.diagram .sv-ink2 { fill: var(--ink-2); } figure.diagram .sv-ink3 { fill: var(--ink-3); } figure.diagram .sv-txt { fill: var(--ink); }
figure.diagram figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: .5rem; }

details.faq { background: #fff; border: 1px solid var(--line); border-radius: 8px; margin: .6rem 0; }
details.faq summary { cursor: pointer; padding: .8rem 1rem; font-weight: 600; color: var(--ink); list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: "＋"; color: var(--gold); margin-right: .6rem; font-weight: 700; }
details.faq[open] summary::before { content: "－"; }
details.faq > div { padding: 0 1rem .9rem 2.3rem; }
details.faq > div > :first-child { margin-top: 0; }

.foot { border-top: 1px solid var(--line); margin-top: 3.5rem; padding-top: 1.2rem; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.pn { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }
.pn a { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .6rem 1rem; text-decoration: none; font-weight: 600; }
.ke-atas { position: fixed; right: 1.2rem; bottom: 1.2rem; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 1.2rem; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); display: none; z-index: 90; }
.ke-atas.tampil { display: block; }
.btn-cetak { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .45em .9em; cursor: pointer; font-size: .88rem; }

/* ---------- layar sempit ---------- */
@media (max-width: 1000px) {
  .wrap { grid-template-columns: 1fr; gap: 1rem; padding-top: 1.2rem; }
  .toc { position: static; max-height: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
  .toc.tertutup ol, .toc.tertutup ul { display: none; }
  .toc h2 { cursor: pointer; margin: 0; }
  .toc h2::after { content: " ▾"; }
  .peran { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: var(--head-h); left: 0; right: 0; background: var(--ink); flex-direction: column; padding: .5rem 1rem 1rem; margin: 0; }
  .nav.buka { display: flex; }
  .cari { width: auto; flex: 1; min-width: 0; margin-left: .3rem; }
  .brand small { display: none; }
  .brand > span:last-child { display: none; }   /* tinggal logo — ruang dipakai kotak pencarian */
  .cari { margin-left: .2rem; }
  main h1 { font-size: 1.75rem; }
  .hero { padding: 1.6rem 1.2rem; } .hero h1 { font-size: 1.8rem; }
  .dua { grid-template-columns: 1fr; }
}

/* ---------- cetak / simpan PDF ---------- */
@media print {
  body { background: #fff; font-size: 11pt; }
  .head, .toc, .ke-atas, .pn, .btn-cetak, .skip { display: none !important; }
  .wrap { display: block; padding: 0; max-width: none; }
  main { max-width: none; }
  main h2 { page-break-before: auto; break-after: avoid; }
  main h3, main h4 { break-after: avoid; }
  .callout, .tbl-wrap, figure.diagram, ol.steps > li, details.faq { break-inside: avoid; }
  details.faq > div { display: block; }
  a { color: inherit; text-decoration: none; }
  .callout, .ui, .menu { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
