/* ==========================================================================
   Artikel "blok buku" — tata letak bergaya buku teks (Lentera Belajar).
   Dipakai bersama site.css; hanya dimuat di artikel berformat blok.
   Warna: biru = konsep/definisi, teal = penyelesaian & ringkasan,
   amber = tips/ingat, merah = hati-hati.
   ========================================================================== */

.book {
    --bk-blue: #1d4ed8; --bk-blue-soft: #eef2ff; --bk-blue-line: #c7d2fe;
    --bk-teal: #0f766e; --bk-teal-soft: #f0fdfa; --bk-teal-line: #99f6e4;
    --bk-amber: #b45309; --bk-amber-soft: #fffbeb; --bk-amber-line: #fcd34d;
    --bk-red: #b91c1c; --bk-red-soft: #fef2f2; --bk-red-line: #fca5a5;
    --bk-navy: #272778;
    counter-reset: none;
}
.book > * + * { margin-top: 1.4em; }

/* Label kecil di atas kotak ------------------------------------------------- */
.book .bk-label {
    display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .65rem;
    font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--bk-blue);
}
.book .bk-label-icon { font-size: 1rem; line-height: 1; }
.book .bk-body > :first-child { margin-top: 0; }
.book .bk-body > :last-child { margin-bottom: 0; }
.book .bk-body p + p, .book .bk-body p + ul, .book .bk-body p + ol, .book .bk-body ul + p, .book .bk-body ol + p { margin-top: .7em; }
.book .bk-small { font-size: .95rem; color: #334155; }

/* Kotak umum ---------------------------------------------------------------- */
.book .bk-box {
    position: relative; margin: 1.8em 0; padding: 1.15rem 1.25rem 1.2rem;
    border-radius: 14px; background: #fff; border: 1px solid var(--outline);
}

/* Subjudul bernomor --------------------------------------------------------- */
.book h2.bk-section {
    display: flex; align-items: baseline; gap: .75rem; text-decoration: none;
    margin: 2.4em 0 .8em; padding-bottom: .55rem; border-bottom: 2px solid var(--bk-navy);
    color: var(--bk-navy);
}
.book .bk-num {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    min-width: 2.2rem; height: 2.2rem; padding: 0 .45rem; border-radius: 8px;
    background: var(--bk-navy); color: #fff; font-size: 1.05rem; font-weight: 800;
    transform: translateY(-.1em);
}
.book h3.bk-sub { color: var(--bk-navy); margin: 1.8em 0 .5em; }
.book .bk-subnum { color: var(--bk-blue); font-weight: 800; margin-right: .25rem; }

/* Tujuan pembelajaran ------------------------------------------------------- */
.book .bk-goals { background: var(--bk-blue-soft); border-color: var(--bk-blue-line); border-left: 6px solid var(--bk-blue); }
.book .bk-goals-lead { margin: 0 0 .4rem; font-weight: 600; color: #1e293b; }
.book .bk-goals ol { margin: 0; padding-left: 1.3rem; }
.book .bk-goals li + li { margin-top: .3em; }

/* Definisi ------------------------------------------------------------------- */
.book .bk-def { border: 2px solid var(--bk-blue); background: #fff; box-shadow: 6px 6px 0 var(--bk-blue-soft); }
.book .bk-def .bk-label { position: absolute; top: -.75rem; left: 1rem; margin: 0; padding: .2rem .6rem; border-radius: 6px; background: var(--bk-blue); color: #fff; }
.book .bk-term { margin: .35rem 0 .35rem; font-size: 1.2rem; font-weight: 800; color: var(--bk-navy); }

/* Rumus kunci ---------------------------------------------------------------- */
.book .bk-formula { background: linear-gradient(180deg, var(--bk-blue-soft), #fff); border-color: var(--bk-blue-line); text-align: center; }
.book .bk-formula .bk-label { justify-content: center; }
.book .bk-formula-tex { font-size: 1.25rem; overflow-x: auto; padding: .25rem 0; }
.book .bk-formula .bk-body { text-align: left; margin-top: .6rem; }

/* Contoh soal ---------------------------------------------------------------- */
.book .bk-example { margin: 2em 0; border: 1px solid var(--outline-strong); border-radius: 14px; background: #fff; overflow: hidden; }
.book .bk-example-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .7rem 1.1rem; background: var(--bk-navy); color: #fff; }
.book .bk-example-tag { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 6px; background: #fbbf24; color: #3d2a00; }
.book .bk-example-head h3 { margin: 0; font-size: 1.05rem; color: #fff; scroll-margin-top: 1.5rem; }
.book .bk-example-problem { padding: 1rem 1.2rem; }
.book .bk-example-problem > :first-child { margin-top: 0; }
.book .bk-example-problem > :last-child { margin-bottom: 0; }
.book .bk-solution { margin: 0 1.2rem 1.1rem; padding: .2rem 0 .1rem 1.1rem; border-left: 4px solid var(--bk-teal); }
.book .bk-solution-label { margin: 0 0 .5rem; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--bk-teal); }
.book .bk-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.book .bk-steps > li { counter-increment: step; position: relative; padding-left: 2.2rem; }
.book .bk-steps > li + li { margin-top: .7em; }
.book .bk-steps > li::before {
    content: counter(step); position: absolute; left: 0; top: .2em;
    width: 1.55rem; height: 1.55rem; border-radius: 50%; display: grid; place-items: center;
    background: var(--bk-teal-soft); border: 1.5px solid var(--bk-teal); color: var(--bk-teal); font-size: .82rem; font-weight: 800;
}
.book .bk-steps p { margin: 0; }
.book .bk-answer { margin: .9rem 0 0; padding: .6rem .85rem; border-radius: 10px; background: var(--bk-teal-soft); border: 1px solid var(--bk-teal-line); color: #134e4a; font-weight: 600; }
.book .bk-answer-label { font-weight: 800; color: var(--bk-teal); }

/* Catatan: Ingat / Tips / Hati-hati ------------------------------------------ */
.book .bk-note { margin: 1.6em 0; padding: .95rem 1.1rem 1rem; border-radius: 12px; border: 1px solid; }
.book .bk-note-label { display: flex; align-items: center; gap: .55rem; margin: 0 0 .45rem; font-weight: 800; }
.book .bk-note-icon { flex-shrink: 0; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: .95rem; color: #fff; }
.book .bk-note--ingat { background: var(--bk-amber-soft); border-color: var(--bk-amber-line); }
.book .bk-note--ingat .bk-note-label { color: var(--bk-amber); }
.book .bk-note--ingat .bk-note-icon { background: #f59e0b; }
.book .bk-note--tips { background: var(--bk-teal-soft); border-color: var(--bk-teal-line); }
.book .bk-note--tips .bk-note-label { color: var(--bk-teal); }
.book .bk-note--tips .bk-note-icon { background: var(--bk-teal); }
.book .bk-note--awas { background: var(--bk-red-soft); border-color: var(--bk-red-line); }
.book .bk-note--awas .bk-note-label { color: var(--bk-red); }
.book .bk-note--awas .bk-note-icon { background: #dc2626; }

/* Gambar & video ------------------------------------------------------------- */
.book .bk-figure { margin: 1.8em 0; }
.book .bk-figure img { display: block; margin: 0 auto; border-radius: 12px; border: 1px solid var(--outline); background: #fff; }
.book .bk-figure figcaption { margin-top: .6rem; text-align: left; font-size: .92rem; color: #475569; border-left: 3px solid var(--bk-blue-line); padding-left: .7rem; }
.book .bk-fig-num { font-weight: 800; color: var(--bk-navy); margin-right: .35rem; }

/* Coba sendiri (soal interaktif) -------------------------------------------- */
.book .bk-try { margin: 2em 0; padding: 1.15rem 1.2rem 1.2rem; border-radius: 16px; border: 2px dashed var(--bk-blue-line); background: #fbfcff; }
.book .bk-try-head { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .75rem; margin-bottom: .85rem; }
.book .bk-try-tag { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: .25rem .6rem; border-radius: 99px; background: var(--bk-blue); color: #fff; }
.book .bk-try-hint { font-size: .9rem; color: var(--muted); }
.book .bk-try-question { font-weight: 500; margin-bottom: .9rem; }
.book .bk-options { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.book .bk-option {
    display: flex; align-items: flex-start; gap: .7rem; padding: .65rem .8rem; cursor: pointer;
    border: 1.5px solid var(--outline); border-radius: 12px; background: #fff; transition: border-color .15s, background .15s;
}
.book .bk-option:hover { border-color: var(--bk-blue-line); }
.book .bk-option input { position: absolute; opacity: 0; pointer-events: none; }
.book .bk-option-letter {
    flex-shrink: 0; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center;
    border: 1.5px solid var(--outline-strong); font-weight: 800; font-size: .88rem; color: #334155;
}
.book .bk-option-text { padding-top: .1rem; }
.book .bk-option.is-selected, .book .bk-option:has(input:checked) { border-color: var(--bk-blue); background: var(--bk-blue-soft); }
.book .bk-option.is-selected .bk-option-letter, .book .bk-option:has(input:checked) .bk-option-letter { background: var(--bk-blue); border-color: var(--bk-blue); color: #fff; }
.book .bk-option:has(input:focus-visible) { outline: 3px solid var(--bk-blue); outline-offset: 2px; }
.book .bk-option.is-correct { border-color: var(--bk-teal); background: var(--bk-teal-soft); }
.book .bk-option.is-correct .bk-option-letter { background: var(--bk-teal); border-color: var(--bk-teal); color: #fff; }
.book .bk-option.is-wrong { border-color: #dc2626; background: var(--bk-red-soft); }
.book .bk-option.is-wrong .bk-option-letter { background: #dc2626; border-color: #dc2626; color: #fff; }
.book [data-try].is-checked .bk-option { cursor: default; }
.book .bk-short input { width: 100%; max-width: 22rem; font: inherit; padding: .65rem .8rem; border: 1.5px solid var(--outline-strong); border-radius: 10px; background: #fff; }
.book .bk-short input:focus { outline: 3px solid var(--bk-blue-line); border-color: var(--bk-blue); }
.book .bk-short input.is-correct { border-color: var(--bk-teal); background: var(--bk-teal-soft); }
.book .bk-short input.is-wrong { border-color: #dc2626; background: var(--bk-red-soft); }
.book .bk-try-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; margin-top: 1rem; }
.book .bk-try-feedback { margin: 0; font-weight: 700; }
.book .bk-try-feedback.is-correct { color: var(--bk-teal); }
.book .bk-try-feedback.is-wrong { color: #b91c1c; }
.book .bk-try-explain { margin-top: 1rem; padding: .9rem 1rem; border-radius: 12px; background: #fff; border: 1px solid var(--bk-teal-line); }
.book .bk-try-explain .bk-answer { margin: 0 0 .6rem; }

/* Uji pemahaman -------------------------------------------------------------- */
.book .bk-check { border-top: 6px solid var(--bk-navy); }
.book .bk-check .bk-label { color: var(--bk-navy); }
.book .bk-check-list { margin: 0; padding-left: 1.4rem; }
.book .bk-check-list > li + li { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--outline-strong); }
.book .bk-reveal { margin-top: .5rem; }
.book .bk-reveal summary { cursor: pointer; display: inline-block; font-size: .92rem; font-weight: 700; color: var(--bk-blue); }
.book .bk-reveal[open] summary { margin-bottom: .45rem; }
.book .bk-reveal > .bk-body { padding: .6rem .8rem; border-radius: 10px; background: var(--bk-teal-soft); }

/* Ringkasan ------------------------------------------------------------------ */
.book .bk-summary { background: var(--bk-teal-soft); border-color: var(--bk-teal-line); }
.book .bk-summary .bk-label { color: var(--bk-teal); }
.book .bk-summary ul { margin: 0; padding-left: 1.2rem; }
.book .bk-summary li + li { margin-top: .35em; }
.book .bk-summary li::marker { color: var(--bk-teal); }

/* Layar kecil --------------------------------------------------------------- */
@media (max-width: 560px) {
    .book .bk-box, .book .bk-try { padding: 1rem; }
    .book .bk-example-problem { padding: .9rem 1rem; }
    .book .bk-solution { margin: 0 1rem 1rem; padding-left: .85rem; }
    .book .bk-def { box-shadow: 4px 4px 0 var(--bk-blue-soft); }
}

/* Cetak / simpan PDF --------------------------------------------------------- */
@media print {
    @page { margin: 16mm 14mm; }
    body { background: #fff; font-size: 11pt; }
    .site-header, .site-footer, header.site-header, footer, nav.crumbs, .read-progress, .toc, .article-end, .article-practice,
    .article-related, .bk-try-actions, .bk-video-wrap, .skip-link { display: none !important; }
    .article-layout { display: block !important; max-width: none !important; }
    .article-cover img { max-height: 8cm; }
    .prose { font-size: 11pt; line-height: 1.55; }
    .book .bk-box, .book .bk-example, .book .bk-note, .book .bk-try, .book .bk-figure { break-inside: avoid; box-shadow: none; }
    .book h2.bk-section { break-after: avoid; }
    .book .bk-try-explain[hidden] { display: block !important; }
    .book * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
