/*
 * course.css: halaman kelas (jual, belajar, daftar kelas member). Dimuat SESUDAH page-themes.css.
 * Warna HANYA dari token tema. Kartu memakai .pv-product-card dan tombol .pv-product-card__btn supaya aturan bentuk
 * tiap gaya tema ikut tanpa disalin. Blok Kelas di profil/builder TIDAK memakai berkas ini (lihat page-themes.css).
 * Di dalam kartu pakai var(--pv-text), bukan --pv-muted/--pv-accent: biolinkin & retrowin punya skema warna lokal per kartu.
 */
body.kl-page { margin: 0; min-height: 100%; background: var(--pv-bg, #f3f7ff); -webkit-font-smoothing: antialiased;
    font-family: var(--pv-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif); }
.kl-page *, .kl-page *::before, .kl-page *::after { box-sizing: border-box; }
.kl-page .pg { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
.kl-page [hidden] { display: none !important; }

.kl-learn { width: 100%; max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; padding: 0 16px 96px; color: var(--pv-text); }
/* Ritme lega: 8 / 16 / 24px. Daftar bab tanpa garis, hanya jarak. */
.kl-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 60px; color: var(--pv-text); font-size: .85rem; text-decoration: none; }
.kl-title { margin: 8px 0 12px; font-size: 1.2rem; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; color: var(--pv-text); }
.kl-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.kl-summary .kl-bar { flex: 1; height: 6px; }
.kl-summary__text { flex: none; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--pv-text); }
.kl-congrats { margin: -10px 0 18px; font-size: .85rem; font-weight: 800; color: var(--pv-text); }

.kl-bar { width: 100%; height: 8px; overflow: hidden; border-radius: min(var(--btn-radius, 99px), 99px); background: color-mix(in srgb, var(--pv-text) 18%, transparent); }
.kl-bar i { display: block; height: 100%; border-radius: inherit; background: var(--pv-btn); transition: width .3s;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pv-text) 55%, transparent); }   /* tetap terlihat bila warna tombol = latar */
.kl-bar i[style="width:0%"], .kl-bar i[style="width: 0%;"] { box-shadow: none; }

.kl-stage { min-width: 0; }
/* Syarat YouTube: viewport player minimal 200 x 200 px */
.kl-player { width: 100%; }
.kl-player .pv-embed[data-ratio="16/9"] { min-width: 0; min-height: 200px; }
.kl-sk-player { aspect-ratio: 16 / 9; min-height: 200px; width: 100%; }
.kl-sk-player--doc { aspect-ratio: auto; height: 480px; }
/* Baris materi aktif: [ceklis] judul + status  [<] [>] */
.kl-now { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.kl-mark { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-left: -8px; padding: 0; background: none; border: 0; color: inherit; cursor: pointer; }
.kl-mark:disabled { cursor: default; opacity: 1; }
.kl-mark .kl-check { width: 28px; height: 28px; }
.kl-mark .kl-check svg { width: 18px; height: 18px; }
.kl-mark:not(:disabled):hover .kl-check { box-shadow: 0 0 0 4px color-mix(in srgb, var(--pv-text) 16%, transparent); }
.kl-now__text { flex: 1; min-width: 0; }
.kl-lesson__title { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; color: var(--pv-text); }
.kl-now__state { margin: 2px 0 0; font-size: .76rem; line-height: 1.4; color: var(--pv-text); }
.kl-nav { flex: none; display: flex; gap: 8px; }
.pv-product-card__btn.kl-nav__btn { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; overflow: visible; }
.kl-nav__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.kl-lesson__body { margin-top: 20px; }
.kl-text, .kl-desc { font-size: .9rem; line-height: 1.65; overflow-wrap: anywhere; color: var(--pv-text); }
.kl-text :first-child { margin-top: 0; }
.kl-text img { max-width: 100%; height: auto; }
.kl-text a, .kl-desc a { color: inherit; text-decoration: underline; }
.kl-text table, .kl-desc table { display: block; max-width: 100%; overflow-x: auto; }
.kl-note { margin: 10px 0 0; padding: 10px 12px; font-size: .82rem; line-height: 1.5; color: var(--pv-text);
    border: 1px solid color-mix(in srgb, var(--pv-text) 40%, transparent); border-radius: min(var(--btn-radius, 10px), 14px); }
.kl-empty { padding: 48px 0; text-align: center; font-size: .9rem; color: var(--pv-text); }

/* Panel = kartu produk, tetapi diam */
.pv-product-card.kl-panel { display: block; text-align: left; }
.pv-product-card.kl-panel:hover { transform: none; }
.kl-learn .kl-curriculum { gap: 12px; margin: 32px 0 8px; }
.pv-product-card.kl-chapter { flex: none; }
.kl-chapter__head { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 16px; cursor: pointer; list-style: none; user-select: none; }
.kl-chapter__head::-webkit-details-marker { display: none; }
.kl-chapter__head .kl-section { flex: 1; min-width: 0; padding: 0; font-size: .88rem; }
.kl-chapter__count { flex: none; font-size: .76rem; font-variant-numeric: tabular-nums; color: var(--pv-text); }
.kl-chapter__chev { transition: transform .2s; }
.kl-chapter[open] > summary .kl-chapter__chev { transform: rotate(180deg); }
.kl-learn .kl-list { padding-bottom: 8px; }
.kl-learn .kl-row { min-height: 52px; gap: 12px; padding: 10px 16px; }
.kl-learn .kl-list .kl-check { width: 22px; height: 22px; }
.kl-curriculum { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 16px 0 8px; }
.kl-section { margin: 0; padding: 12px 14px 6px; font-size: .82rem; font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; color: var(--pv-text); }
.kl-list { list-style: none; margin: 0; padding: 0 0 4px; }
.kl-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; font-size: .86rem; line-height: 1.35; color: var(--pv-text); text-decoration: none; }
.kl-row__title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.kl-row--link:hover { background: color-mix(in srgb, var(--pv-text) 6%, transparent); }
.kl-row[aria-current] { font-weight: 800; background: color-mix(in srgb, var(--pv-btn) 10%, transparent); box-shadow: inset 4px 0 0 var(--pv-btn); }
.kl-row:focus-visible, .kl-back:focus-visible, .kl-go:focus-visible, .kl-chapter__head:focus-visible, .kl-nav__btn:focus-visible, .kl-mark:focus-visible { outline: 2px solid var(--pv-text); outline-offset: -4px; }
.kl-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kl-tag { flex: none; padding: 2px 8px; font-size: .7rem; font-weight: 800; border: 1px solid currentColor; border-radius: min(var(--btn-radius, 99px), 99px); }
.kl-preview summary { cursor: pointer; list-style: none; }
.kl-preview summary::-webkit-details-marker { display: none; }
.kl-preview__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 4px 10px 12px; }

/* Checklist */
.kl-check { flex: none; display: grid; place-items: center; width: 24px; height: 24px; color: transparent;
    border: 2px solid var(--pv-text); border-radius: min(calc(var(--btn-radius, 999px) - 4px), 99px); }   /* rumus sama dengan tombol kartu */
.kl-check svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.is-done > .kl-check, .is-done > .kl-mark > .kl-check { background: var(--pv-btn); color: var(--pv-btn-text); border-color: var(--pv-btn); }
.kl-mark .kl-check { box-shadow: var(--btn-shadow-sm, none); }

/* CEKLIS & BILAH ikut bentuk tombol tiap gaya (pasangan daftar AKSI di page-themes.css, panduan 8.C4) */
:is([data-style="brutal"],[data-style="glitch"],[data-style="pixel"],[data-style="cyber"],[data-style="retrowin"],[data-style="swiss"],[data-style="kraft"]) :is(.kl-check, .kl-bar, .kl-tag, .kl-note) { border-radius: 0; }
:is([data-style="brutal"],[data-style="glitch"],[data-style="pixel"]) .kl-check { border-width: 3px; }
:is([data-style="brutal"],[data-style="glitch"],[data-style="pixel"]) .kl-bar { height: 10px; box-shadow: inset 0 0 0 2px var(--pv-line, var(--pv-text)); }
[data-style="cyber"] .kl-check { clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); }
[data-style="retrowin"] :is(.kl-check, .kl-bar) { box-shadow: inset 1px 1px #0a0a0a, inset -1px -1px #fff; }
[data-style="neon"] .kl-bar i { box-shadow: 0 0 8px var(--pv-btn); }

/* Tema custom mode tombol garis: isi = latar, garis & tanda = tinta tombol (panduan 8.C5 no. 3) */
.pg[style*="--pv-btn-outline"] .is-done > .kl-check, .pg[style*="--pv-btn-outline"] .is-done > .kl-mark > .kl-check { background: var(--pv-bg); color: var(--pv-btn-ink); border-color: var(--pv-btn-ink); }
.pg[style*="--pv-btn-outline"] .kl-bar i { background: var(--pv-btn-ink); }
.pv-product-card__btn.kl-go { display: flex; align-items: center; justify-content: center; min-height: 44px; font-family: inherit; cursor: pointer; }

/* Daftar kelas member */
.kl-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 8px 20px; text-align: left; }
.kl-card__thumb img { width: 100%; height: 140px; object-fit: cover; }
.kl-card .pv-product-card__body { gap: 8px; padding: 12px 14px 4px; }
.kl-card .pv-product-card__actions { padding: 10px 14px 14px; }
.kl-card__title { font-size: .95rem; }
.kl-card__meta { margin: 0; font-size: .78rem; color: var(--pv-text); }

/* Halaman jual */
body.kl-sales { font-family: var(--pv-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif); }
.kl-sales .pg { font-family: inherit; }
.kl-cover img { max-height: 360px; object-fit: cover; }
.pd-body h2.pd-desc-label { margin-top: 18px; }
.pd-body .kl-curriculum { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) { .kl-bar i, .kl-chapter__chev { transition: none; } }
