/* KS Testi Video – Frontend */
.kstv-carousel {
    /* Default: Green theme */
    --kstv-accent: #2f9e6b;
    --kstv-accent-soft: #b7e4c7;
    --kstv-surface: #f1faf4;
    --kstv-ink: inherit;
    --kstv-muted: #5d6b64;
    --kstv-quote-bg: #eef7f1;
    --kstv-quote-border: #cfe8d8;
    --kstv-panel-bg: #ffffff;
    font-family: inherit;
    color: inherit;
    padding: 48px 20px;
    background: transparent;
    border-radius: 0;
}
/* Defensive reset: hindari style .entry-content code (atau code global tema) bocor ke dalam carousel */
.kstv-carousel code {
    all: unset;
    font: inherit;
    color: inherit;
    background: transparent;
    padding: 0;
    border: 0;
    border-radius: 0;
    white-space: normal;
}
.kstv-carousel,
.kstv-carousel h2,
.kstv-carousel h3,
.kstv-carousel h4,
.kstv-carousel p,
.kstv-carousel span,
.kstv-carousel button,
.kstv-carousel a { font-family: inherit; }
/* Theme: Gold */
.kstv-theme--gold {
    --kstv-accent: #e5b547;
    --kstv-accent-soft: #f5e0a3;
    --kstv-surface: #fbf7ef;
    --kstv-ink: #1a1a2e;
    --kstv-muted: #6b6b7b;
    --kstv-quote-bg: #f7f4ec;
    --kstv-quote-border: #e2d9bd;
    --kstv-panel-bg: #ffffff;
}
/* Theme: Blue */
.kstv-theme--blue {
    --kstv-accent: #2563eb;
    --kstv-accent-soft: #bfdbfe;
    --kstv-surface: #eff6ff;
    --kstv-ink: #0f172a;
    --kstv-muted: #64748b;
    --kstv-quote-bg: #eaf2ff;
    --kstv-quote-border: #cfe0fb;
    --kstv-panel-bg: #ffffff;
}
/* Theme: Purple */
.kstv-theme--purple {
    --kstv-accent: #7c3aed;
    --kstv-accent-soft: #ddd6fe;
    --kstv-surface: #f5f3ff;
    --kstv-ink: #1e1b3a;
    --kstv-muted: #6b6788;
    --kstv-quote-bg: #efeaff;
    --kstv-quote-border: #d8ccff;
    --kstv-panel-bg: #ffffff;
}
/* Theme: Dark */
.kstv-theme--dark {
    --kstv-accent: #f59e0b;
    --kstv-accent-soft: #fcd34d;
    --kstv-surface: #0f172a;
    --kstv-ink: #f8fafc;
    --kstv-muted: #94a3b8;
    --kstv-quote-bg: #1e293b;
    --kstv-quote-border: #334155;
    --kstv-panel-bg: #111c33;
}

.kstv-carousel * { box-sizing: border-box; }
.kstv-carousel__title {
    text-align:center; font-size: clamp(28px, 4vw, 44px); font-weight: 800;
    margin: 0 0 40px; color: var(--kstv-ink); line-height: 1.15;
}
.kstv-carousel__empty { text-align:center; color: var(--kstv-muted); }

.kstv-carousel__grid {
    display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 40px;
    max-width: 1200px; margin: 0 auto; align-items: stretch;
}

/* Media */
.kstv-carousel__media { position: relative; display: flex; flex-direction: column; }
.kstv-media-frame {
    position: relative; width: 100%; aspect-ratio: 9/16;
    border-radius: 24px; overflow: hidden;
    background: #000; box-shadow: 0 30px 60px -20px rgba(0,0,0,.35);
}
.kstv-media-slide {
    position: absolute; inset: 0; opacity: 0; transition: opacity .4s ease; pointer-events: none;
}
.kstv-media-slide.is-active { opacity: 1; pointer-events: auto; }
.kstv-media-slide iframe { width: 100%; height: 100%; border: 0; display: block; }
.kstv-media-slide .kstv-embed-holder { width: 100%; height: 100%; }
.kstv-media-placeholder { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,0,0,.06), rgba(0,0,0,.12)); }

.kstv-dots { display:flex; gap: 8px; justify-content:center; margin-top: 18px; flex-wrap: wrap; }
.kstv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--kstv-accent-soft); opacity:.55; border: 0; cursor: pointer; padding:0; transition: all .2s ease; }
.kstv-dot.is-active { background: var(--kstv-accent); opacity:1; width: 22px; border-radius: 999px; }

/* Panel */
.kstv-carousel__panel {
    position: relative; background: var(--kstv-panel-bg); border-radius: 22px;
    padding: 6px 0 0; box-shadow: 0 20px 45px -25px rgba(0,0,0,.2);
    overflow: hidden;
    display: flex; flex-direction: column; height: 100%; min-height: 0;
}
.kstv-panel__accent {
    height: 4px; width: 92%; margin: 0 auto; flex-shrink: 0;
    background: linear-gradient(90deg, var(--kstv-accent), var(--kstv-accent-soft));
    border-radius: 999px;
}
.kstv-panel__inner { padding: 32px 36px 36px; display:flex; flex-direction:column; flex: 1; min-height: 0; }
.kstv-panel__heading { margin: 0 0 12px; font-size: 26px; font-weight: 800; }
.kstv-panel__intro { margin: 0 0 24px; color: var(--kstv-muted); line-height: 1.65; font-size: 15px; }

/* Controls */
.kstv-controls { display:flex; align-items:center; gap: 14px; margin-bottom: 22px; flex-shrink: 0; }
.kstv-nav {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--kstv-surface); color: var(--kstv-ink); border: 0;
    display:inline-flex; align-items:center; justify-content:center; cursor:pointer;
    transition: background .2s ease, transform .2s ease;
}
.kstv-nav:hover { background: var(--kstv-accent-soft); }
.kstv-nav:active { transform: scale(.95); }
.kstv-counter {
    background: var(--kstv-surface); color: var(--kstv-accent);
    font-weight: 700; padding: 8px 16px; border-radius: 999px; font-size: 14px;
}
.kstv-progress { flex: 1; height: 3px; background: var(--kstv-accent-soft); opacity:.5; border-radius: 999px; overflow: hidden; }
.kstv-progress__bar { height: 100%; width: 10%; background: var(--kstv-accent); border-radius: 999px; transition: width .35s ease; }

/* Quotes */
.kstv-quotes { position: relative; flex: 1; min-height: 0; display: flex; }
.kstv-quote {
    background: var(--kstv-quote-bg); border-radius: 16px; padding: 22px 24px 20px;
    display: none;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}
.kstv-quote.is-active { display: flex; animation: kstvFade .35s ease; }
@keyframes kstvFade { from { opacity: 0; transform: translateY(6px);} to {opacity:1; transform: translateY(0);} }
.kstv-quote__mark { color: var(--kstv-accent); margin-bottom: 8px; flex-shrink: 0; }

.kstv-quote__body { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: 16px; }
.kstv-quote__text {
    margin: 0; line-height: 1.7; color: var(--kstv-ink); font-size: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kstv-quote.is-expanded .kstv-quote__text {
    -webkit-line-clamp: unset;
    display: block;
    overflow: auto;
    max-height: 100%;
}
.kstv-quote__more {
    align-self: flex-start;
    margin-top: 8px;
    background: transparent; border: 0; padding: 4px 0;
    color: var(--kstv-accent); font-weight: 700; font-size: 13px;
    cursor: pointer;
}
.kstv-quote__more:hover { text-decoration: underline; }
.kstv-quote__more.is-hidden { display: none; }

.kstv-quote__foot {
    display:flex; align-items:center; gap: 14px;
    padding-top: 16px; border-top: 1px dashed var(--kstv-quote-border);
    flex-shrink: 0;
}
.kstv-quote__avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--kstv-accent), var(--kstv-accent-soft));
    color: #fff; font-weight: 800;
    display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
}
.kstv-quote__meta { flex: 1; min-width: 0; }
.kstv-quote__author { font-weight: 700; font-size: 14px; }
.kstv-quote__loc { color: var(--kstv-muted); font-size: 12px; margin-top: 2px; }
.kstv-quote__stars { color: var(--kstv-accent-soft); letter-spacing: 2px; font-size: 15px; opacity: .6; }
.kstv-quote__stars .kstv-star.is-on { color: var(--kstv-accent); opacity: 1; }

@media (max-width: 860px) {
    .kstv-carousel__grid { grid-template-columns: 1fr; gap: 28px; align-items: start; }
    .kstv-carousel__media { max-width: 360px; margin: 0 auto; width: 100%; }
    .kstv-panel__inner { padding: 24px 22px 28px; }
    .kstv-quote__text { -webkit-line-clamp: 4; }
}
