/* ==========================================================================
   DÉFINITION DES THÈMES (SÉPIA PAR DÉFAUT, CLAIR, SOMBRE) VIA DATA-THEME
   ========================================================================== */
body[data-theme="sepia"] {
    --bg-page: #f4ecd8;
    --bg-surface: #faf5e8;
    --bg-toolbar: rgba(250, 245, 232, 0.94);
    --bg-word-hover: #efe4ca;
    --bg-word-active: #e6d3a7;
    --border-word-active: #b45309;
    --bg-french-box: #f0e6ce;
    --border-subtle: #dfd3b9;
    --text-primary: #3d3226;
    --text-korean: #291e14;
    --text-phonetic: #786652;
    --text-gloss: #544332;
    --text-french: #3d3226;
    --accent-color: #b45309;
    --accent-hover: #92400e;
    --accent-text: #ffffff;
    --badge-bg: #efe2c4;
    --badge-text: #92400e;
}

body[data-theme="light"] {
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-toolbar: rgba(255, 255, 255, 0.94);
    --bg-word-hover: #f1f5f9;
    --bg-word-active: #dbeafe;
    --border-word-active: #3b82f6;
    --bg-french-box: #f1f5f9;
    --border-subtle: #e2e8f0;
    --text-primary: #0f172a;
    --text-korean: #1e293b;
    --text-phonetic: #64748b;
    --text-gloss: #334155;
    --text-french: #1e293b;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-text: #ffffff;
    --badge-bg: #eff6ff;
    --badge-text: #1d4ed8;
}

body[data-theme="dark"] {
    --bg-page: #0f172a;
    --bg-surface: #1e293b;
    --bg-toolbar: rgba(30, 41, 59, 0.94);
    --bg-word-hover: #334155;
    --bg-word-active: #1e3a8a;
    --border-word-active: #60a5fa;
    --bg-french-box: #0f172a;
    --border-subtle: #334155;
    --text-primary: #f8fafc;
    --text-korean: #ffffff;
    --text-phonetic: #94a3b8;
    --text-gloss: #cbd5e1;
    --text-french: #e2e8f0;
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-text: #ffffff;
    --badge-bg: #1e3a8a;
    --badge-text: #93c5fd;
}

/* ==========================================================================
   STYLES GÉNÉRAUX & TYPOGRAPHIE
   ========================================================================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    transition: background-color 0.25s ease, color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.font-korean {
    font-family: 'Noto Sans KR', sans-serif;
}

.surface-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.toolbar-glass {
    background-color: var(--bg-toolbar);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ==========================================================================
   BOUTONS DE THÈME, LANGUE & NAVIGATION
   ========================================================================== */
.theme-btn,
.lang-btn,
.nav-tab-btn,
.modal-tab-btn {
    opacity: 0.75;
    color: var(--text-primary);
    transition: all 0.18s ease;
}

.theme-btn:hover,
.lang-btn:hover,
.nav-tab-btn:hover,
.modal-tab-btn:hover {
    opacity: 1;
}

.theme-btn.active,
.lang-btn.active,
.nav-tab-btn.active,
.modal-tab-btn.active {
    opacity: 1;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-subtle);
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--accent-text);
}

.btn-accent:hover {
    background-color: var(--accent-hover);
}

/* ==========================================================================
   BLOCS INTERLINÉAIRES (3 LIGNES ALIGNÉES PAR MOT / GROUPE)
   ========================================================================== */
.word-card {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    border: 1.5px solid transparent;
    background-color: transparent;
    cursor: pointer;
    user-select: none;
    transition: all 0.18s ease;
    min-width: 4.5rem;
}

.word-card:hover {
    background-color: var(--bg-word-hover);
    border-color: var(--border-subtle);
}

.word-card:active {
    transform: scale(0.97);
}

.word-card.speaking,
.jamo-card.speaking {
    background-color: var(--bg-word-active);
    border-color: var(--border-word-active);
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.22);
}

.line-phonetic {
    color: var(--text-phonetic);
    font-size: 0.82rem;
    font-style: italic;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.line-korean {
    color: var(--text-korean);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.line-gloss {
    color: var(--text-gloss);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
}

body.hide-phonetic .line-phonetic {
    display: none;
}

body.hide-gloss .line-gloss {
    display: none;
}

.french-translation-box {
    background-color: var(--bg-french-box);
    border-left: 4px solid var(--accent-color);
    color: var(--text-french);
}

/* ==========================================================================
   CARTES INTERACTIVES DE L'ALPHABET HANGUL (SIMILARITÉ & TABLEAU DIDACTIQUE)
   ========================================================================== */
.jamo-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.9rem;
    border-radius: 0.85rem;
    border: 1.5px solid var(--border-subtle);
    background-color: var(--bg-surface);
    cursor: pointer;
    user-select: none;
    transition: all 0.16s ease;
    min-width: 4.6rem;
}

.jamo-card:hover {
    background-color: var(--bg-word-hover);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.jamo-card.w-base-highlight {
    border-color: var(--accent-color);
    border-style: dashed;
}

.jamo-double-pill {
    position: absolute;
    top: -0.55rem;
    right: -0.45rem;
    padding: 0.1rem 0.42rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    background-color: var(--badge-bg);
    color: var(--badge-text);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.w-compound-callout {
    background-color: var(--bg-french-box);
    border: 1.5px dashed var(--accent-color);
    border-radius: 0.85rem;
    padding: 0.65rem 1rem;
}

/* ==========================================================================
   CADRE VIDÉO CINÉMA PLEIN CADRE (BORDS NOIRS + RECADRAGE BIBLE.IS) & KARAOKÉ
   ========================================================================== */
.video-cinema-stage {
    position: relative;
    width: 100%;
    height: var(--cinema-stage-height, 42vh);
    min-height: 290px;
    max-height: 520px;
    background-color: #000000;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Recadre uniquement le lecteur vidéo de Bible.is en masquant sa barre rouge haute
   et toute sa zone blanche/rouge inférieure, tout en agrandissant la vidéo sur fond noir */
.bible-is-cinema-iframe {
    position: absolute;
    top: var(--iframe-offset-y, -54px);
    left: 50%;
    width: 100%;
    height: 920px;
    border: 0;
    transform: translateX(-50%) scale(var(--iframe-zoom, 1.28));
    transform-origin: top center;
    background-color: #000000;
}

/* Mode non recadré (si l'utilisateur souhaite voir toute la page Bible.is) */
.video-cinema-stage.full-page-mode .bible-is-cinema-iframe {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: none;
}

.verse-card-karaoke-active {
    border: 2px solid var(--accent-color) !important;
    box-shadow: 0 0 0 4px rgba(180, 83, 9, 0.14), 0 8px 20px rgba(0, 0, 0, 0.12) !important;
    transition: all 0.25s ease;
}

/* ==========================================================================
   TIROIR SUPÉRIEUR ALPHABET HANGUL (COUVRE LE MENU HAUT + LAISSE LE BAS LISIBLE)
   ========================================================================== */
.alphabet-top-drawer-body {
    max-height: 38vh;
    min-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
}



