/* Buku Panduan (/tutorial). Token warna dasar dari styles.css (:root); tema gelap lewat [data-theme="dark"].
   Mobile first, gutter 16px, tanpa scroll ke samping. */

/* ---- token tema ---- */
:root {
  --tut-page: #F2F6F1;
  --tut-card: #FFFFFF;
  --tut-link: var(--primary);
  --tut-chip-ink: var(--primary-dark);
  --tut-mark: #FFF3B8;
  --tut-nav: rgba(255, 255, 255, 0.82);
  --tut-menu: linear-gradient(160deg, #ffffff 0%, #F2F6F1 100%);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121A10;
  --bg-soft: #0E150D;
  --ink: #E9F1E7;
  --ink-soft: #AABEA6;
  --ink-faint: #7F947B;
  --accent-soft: #1F2F1C;
  --card-border: rgba(134, 183, 122, 0.24);
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.35);
  --tut-page: #0E150D;
  --tut-card: #182415;
  --tut-link: #86B77A;
  --tut-chip-ink: #B3D8A9;
  --tut-mark: #5B4D10;
  --tut-nav: rgba(18, 26, 16, 0.85);
  --tut-menu: linear-gradient(160deg, #121A10 0%, #0E150D 100%);
}

body.page-tutorial { background: var(--tut-page); color: var(--ink); }
.page-tutorial .navbar.is-scrolled { background: var(--tut-nav); }
.page-tutorial .mobile-menu { background: var(--tut-menu); }
.page-tutorial .eyebrow { color: var(--tut-chip-ink); }
.page-tutorial .btn--ghost { color: var(--ink); }
.page-tutorial .footer__links a:hover { color: var(--tut-link); }

/* logo: dua gambar, satu yang tampil */
.brand__logo--dark { display: none; }
:root[data-theme="dark"] .brand__logo--light { display: none; }
:root[data-theme="dark"] .brand__logo--dark { display: block; }

/* tombol tema (matahari/bulan) */
.theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 50%; border: 1px solid var(--card-border); background: var(--tut-card); color: var(--ink);
}
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ---- tata letak (satu kolom, anti overflow) ---- */
.tut { padding-top: 5rem; padding-bottom: 2.5rem; }
.tut-wrap { width: 100%; max-width: 640px; margin-inline: auto; padding-inline: 16px; }
.tut-wrap * { min-width: 0; }
.tut h1, .tut h2, .tut h3, .tut p, .tut li { overflow-wrap: anywhere; }

.tut-hero { padding-block: 0.5rem 0.5rem; }
.tut-hero h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.015em; }
.tut-hero p { margin-top: 0.4rem; color: var(--ink-soft); font-size: 1rem; line-height: 1.55; }
.tut-search { position: relative; margin-top: 1rem; width: 100%; }
.tut-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }
.tut-search input {
  display: block; width: 100%; max-width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  background: var(--tut-card); border: 1px solid var(--card-border); border-radius: var(--radius-sm);
  appearance: none; -webkit-appearance: none;
}
.tut-search input::placeholder { color: var(--ink-faint); }
.tut-search input:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.tut-status { margin-top: 0.4rem; font-size: 0.88rem; color: var(--ink-soft); min-height: 1.2em; }

.tut-toc { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 0.4rem; padding-bottom: 1rem; border-bottom: 1px solid var(--card-border); }
.tut-toc a { color: var(--tut-link); font-size: 0.92rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.tut-start, .tut-group { margin-top: 1.75rem; scroll-margin-top: 4.5rem; }
.tut-group { display: flex; flex-direction: column; }
.tut-start > h2, .tut-group > h2 { font-size: 1.3rem; font-weight: 800; line-height: 1.25; }
.tut-lead { margin-top: 0.2rem; color: var(--ink-soft); font-size: 0.95rem; }

.tut-steps { list-style: none; counter-reset: s; margin: 1rem 0 0; padding: 0; display: grid; gap: 1.25rem; }
.tut-steps > li { position: relative; padding-left: 2.4rem; counter-increment: s; }
.tut-steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 0.85rem;
}
.tut-steps h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.35; padding-top: 0.15rem; }
.tut-steps p { margin-top: 0.3rem; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6; }
.tut-steps b { color: var(--ink); font-weight: 700; }
.tut-steps a, .tut-card a { color: var(--tut-link); text-decoration: underline; text-underline-offset: 2px; }

.tut-card { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--card-border); scroll-margin-top: 4.5rem; }
.tut-group > h2 + .tut-card { border-top: 0; padding-top: 0; margin-top: 0.6rem; }
.tut-card h3 { font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.tut-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--accent-soft); color: var(--tut-chip-ink); border: 1px solid var(--card-border); vertical-align: middle; margin-left: 0.4rem; }
.tut-intro { margin-top: 0.3rem; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.55; }
.tut-card ol { margin: 0.7rem 0 0; padding-left: 1.3rem; display: grid; gap: 0.4rem; }
.tut-card li { color: var(--ink); font-size: 0.95rem; line-height: 1.6; padding-left: 0.1rem; }
.tut-card li::marker { color: var(--tut-link); font-weight: 700; }
.tut-note { margin-top: 0.7rem; font-size: 0.9rem; color: var(--ink-soft); border-left: 3px solid var(--primary-light); padding-left: 0.7rem; line-height: 1.5; }

/* screenshot */
.tut-shot { position: relative; margin: 0.9rem 0 0; max-width: 300px; }
.tut-shot img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--card-border); background: var(--tut-card); }
.tut-shot--todo { display: grid; place-items: center; aspect-ratio: 9 / 16; max-height: 220px; border: 1px dashed var(--card-border); border-radius: 14px; color: var(--ink-faint); font-size: 0.82rem; text-align: center; padding: 1rem; }

.tut-empty { display: none; margin-top: 1.2rem; padding: 1rem; border: 1px dashed var(--card-border); border-radius: var(--radius-sm); color: var(--ink-soft); }
.tut-empty.is-on { display: block; }
[hidden] { display: none !important; }
mark.tut-hit { background: var(--tut-mark); color: inherit; border-radius: 3px; padding-inline: 1px; }

.tut-cta { margin-top: 2.25rem; padding: 1.25rem 1rem; text-align: center; background: var(--accent-soft); border: 1px solid var(--card-border); border-radius: var(--radius-sm); }
.tut-cta h2 { font-size: 1.15rem; font-weight: 800; }
.tut-cta p { margin: 0.3rem 0 0.9rem; color: var(--ink-soft); font-size: 0.95rem; }
.tut-cta .btn { white-space: normal; }
