/* Ebook tutorial AcademiaTools — tampilan web + cetak PDF (A4) */
:root {
  --biru: #1e40af; --biru2: #4f46e5; --teks: #1e293b; --redup: #64748b;
  --garis: #e2e8f0; --latar: #f8fafc; --emas: #f59e0b;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 70px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--teks); background: var(--latar); line-height: 1.7; font-size: 17px; }
a { color: var(--biru2); }
img { max-width: 100%; height: auto; }
code { background: #eef2ff; padding: 1px 6px; border-radius: 4px; font-size: .92em; }

.atas { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 22px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--garis); backdrop-filter: blur(6px); }
.merek { font-weight: 700; color: var(--biru); text-decoration: none; font-size: 18px; }
.merek small { color: var(--redup); font-weight: 400; }
.atas nav a { margin-left: 14px; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--teks); }
.atas nav a.beli { background: var(--emas); color: #1e293b; padding: 7px 14px; border-radius: 8px; }

.sampul { background: linear-gradient(135deg, #1e3a8a, #4f46e5); color: #fff; text-align: center;
  padding: 60px 20px 40px; }
.sampul .label { letter-spacing: 2px; font-size: 13px; color: #fde68a; font-weight: 700; margin: 0 0 10px; }
.sampul h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.15; margin: 0 0 16px; }
.sampul h1 span { color: #fde68a; }
.sampul .sub { max-width: 760px; margin: 0 auto 22px; font-size: 19px; color: #e0e7ff; }
.sampul-gambar { display: block; max-width: min(900px, 100%); margin: 30px auto 16px; border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35); border: 4px solid rgba(255,255,255,.85); }
.sampul .alamat { font-size: 14px; color: #c7d2fe; }

.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 18px 0; }
.tombol { display: inline-block; padding: 12px 24px; border-radius: 10px; font-weight: 700; text-decoration: none;
  background: #fff; color: var(--biru); border: 2px solid #c7d2fe; }
.tombol.utama { background: var(--emas); color: #1e293b; border-color: var(--emas); }

.isi { max-width: 1180px; margin: 0 auto; padding: 30px 20px; display: grid; grid-template-columns: 250px 1fr; gap: 34px; }
.daftar-isi { position: sticky; top: 76px; align-self: start; background: #fff; border: 1px solid var(--garis);
  border-radius: 12px; padding: 16px 18px; font-size: 15px; }
.daftar-isi h2 { font-size: 16px; margin: 0 0 8px; }
.daftar-isi ol { list-style: none; padding: 0; margin: 0; }
.daftar-isi li a { display: flex; gap: 10px; padding: 6px 0; text-decoration: none; color: var(--teks); border-bottom: 1px dashed var(--garis); }
.daftar-isi li a span { color: var(--biru2); font-weight: 700; min-width: 16px; }
article { min-width: 0; }

.bab { background: #fff; border: 1px solid var(--garis); border-radius: 14px; padding: 30px 36px; margin-bottom: 28px; }
.bab h2 { font-size: 28px; margin: 0 0 14px; color: var(--biru); display: flex; align-items: center; gap: 12px; }
.bab h2 .no { background: var(--biru2); color: #fff; border-radius: 10px; width: 42px; height: 42px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 22px; flex: none; }
.bab h3 { font-size: 21px; margin: 28px 0 8px; }

figure { margin: 18px 0 24px; }
figure img { border: 1px solid var(--garis); border-radius: 10px; box-shadow: 0 6px 18px rgba(15,23,42,.08); display: block; }
figcaption { font-size: 14px; color: var(--redup); margin-top: 8px; text-align: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid2 figure { margin: 10px 0; }

ol.langkah { counter-reset: l; list-style: none; padding: 0; }
ol.langkah li { counter-increment: l; position: relative; padding: 4px 0 10px 46px; }
ol.langkah li::before { content: counter(l); position: absolute; left: 0; top: 3px; width: 32px; height: 32px;
  border-radius: 50%; background: #e0e7ff; color: var(--biru2); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tab-list li { margin-bottom: 6px; }

.kotak { border-radius: 10px; padding: 14px 18px; margin: 18px 0; border-left: 5px solid; }
.kotak p { margin: 6px 0 0; }
.kotak.info { background: #eff6ff; border-color: #3b82f6; }
.kotak.tips { background: #f0fdf4; border-color: #22c55e; }
.kotak.penting { background: #fffbeb; border-color: var(--emas); }

.tabel { width: 100%; border-collapse: collapse; font-size: 15px; margin: 14px 0; }
.tabel th, .tabel td { border: 1px solid var(--garis); padding: 9px 11px; text-align: left; vertical-align: top; }
.tabel th { background: #eef2ff; }
.merah { color: #dc2626; }
.faq h3 { font-size: 18px; margin-top: 20px; }
.penutup { text-align: center; background: linear-gradient(135deg, #eef2ff, #fff7ed); }
.penutup h2 { justify-content: center; }
.penutup .tombol { border-color: #c7d2fe; }
.kecil { font-size: 14px; color: var(--redup); }
.bawah { text-align: center; padding: 26px; color: var(--redup); font-size: 14px; }

@media (max-width: 860px) {
  .isi { grid-template-columns: 1fr; }
  .daftar-isi { position: static; }
  .bab { padding: 22px 18px; }
  .grid2 { grid-template-columns: 1fr; }
  .atas nav a:not(.beli) { display: none; }
  body { font-size: 16px; }
}

/* ---------- Cetak / PDF ---------- */
@page { size: A4; margin: 16mm 15mm 18mm; }
@media print {
  body { background: #fff; font-size: 11pt; line-height: 1.55; }
  .atas, .bawah { display: none; }
  .sampul { min-height: 263mm; padding: 26mm 10mm 10mm; break-after: page;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sampul-gambar { max-width: 150mm; }
  .isi { display: block; padding: 0; max-width: none; }
  .daftar-isi { position: static; border: none; padding: 0; font-size: 13pt; break-after: page; }
  .daftar-isi h2 { font-size: 22pt; color: var(--biru); margin-bottom: 14px; }
  .daftar-isi li a { padding: 10px 0; }
  .bab { border: none; border-radius: 0; padding: 0; margin: 0; break-before: page; }
  .bab h2 { font-size: 20pt; }
  .bab h3 { font-size: 13.5pt; break-after: avoid; }
  figure { break-inside: avoid; }
  figure img { max-height: 120mm; width: auto; margin: 0 auto; box-shadow: none; }
  .grid2 figure img { max-height: 95mm; }
  .kotak, .tabel tr, ol.langkah li { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: var(--biru2); text-decoration: none; }
}
