/* =========================
   RGAA — ACCESSIBILITÉ
========================== */

.skip-link{
    position:absolute;
    top:-100px;
    left:0;
    background:#dc2626;
    color:#ffffff;
    padding:10px 20px;
    font-weight:bold;
    text-decoration:none;
    z-index:9999;
    border-radius:0 0 8px 0;
    transition:top 0.2s;
}
.skip-link:focus{
    top:0;
}

/* Alignement icônes dans les boutons */
.btn .bi {
    font-size: 1em;
    line-height: 1;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

/* Focus visible global — WCAG 2.4.7 */
:focus-visible{
    outline:3px solid #f87171;
    outline-offset:3px;
}
a:focus-visible,
button:focus-visible{
    outline:3px solid #f87171;
    outline-offset:3px;
    border-radius:4px;
}
/* Focus sur cartes interactives de galerie */
[role="button"]:focus-visible,
.card-kanji:focus-visible,
.card[tabindex]:focus-visible {
    outline:3px solid #f87171;
    outline-offset:3px;
}
/* Bouton audio dans les overlays */
.btn-audio {
    display:inline-flex;
    align-items:center;
    gap:5px;
    background:rgba(220,38,38,.18);
    border:1px solid rgba(220,38,38,.45);
    border-radius:20px;
    color:#f87171;
    font-size:.78rem;
    font-weight:600;
    padding:4px 12px;
    cursor:pointer;
    margin-top:10px;
    font-family:'Noto Sans JP', sans-serif;
    transition:background .2s;
}
.btn-audio:hover,
.btn-audio:focus-visible {
    background:rgba(220,38,38,.35);
    color:#fff;
    outline:2px solid #f87171;
    outline-offset:2px;
}

/* =========================
   BASE
========================== */

*,
*::before,
*::after{
    box-sizing:border-box;
}

body{
    background-color:#0f172a;
    color:white;
    font-family:'Noto Sans JP', sans-serif;
    font-size:16px;
    line-height:1.6;
}

img{
    max-width:100%;
    height:auto;
    display:block;
}

/* =========================
   NAVBAR
========================== */

.navbar {
    background-color: #111827;
    border-bottom: 2px solid #dc2626;
    padding-top: .6rem;
    padding-bottom: .6rem;
}

.navbar-brand {
    font-weight: 800;
    color: #ffffff;
    font-size: 1.25rem;
    letter-spacing: -.01em;
    flex-shrink: 0;
}
.navbar-brand span { color: #dc2626; }

/* Liens du menu */
.nav-link {
    color: #cbd5e1 !important;
    font-size: .875rem;
    font-weight: 500;
    padding: .45rem .65rem !important;
    border-radius: 6px;
    transition: color .2s, background .2s;
    white-space: nowrap;
}
.nav-link:hover,
.nav-link:focus-visible {
    color: #f1f5f9 !important;
    background: rgba(255,255,255,.07);
}
.nav-link[aria-current="page"],
.nav-link[aria-current="true"] {
    color: #f87171 !important;
}

/* Exercices — mis en valeur */
.nav-link-exercices {
    color: #f87171 !important;
    border: 1px solid rgba(248,113,113,.35);
    padding: .4rem .85rem !important;
}
.nav-link-exercices:hover {
    background: rgba(248,113,113,.12) !important;
    border-color: rgba(248,113,113,.6);
    color: #fca5a5 !important;
}

/* Dropdown */
.dropdown-menu-dark {
    background-color: #1e293b;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    padding: .4rem .3rem;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.dropdown-item {
    color: #cbd5e1;
    font-size: .875rem;
    border-radius: 6px;
    padding: .45rem .85rem;
    display: flex;
    align-items: center;
    gap: 2px;
}
.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(220,38,38,.18);
    color: #f87171;
}
.dropdown-item[aria-current="page"] {
    color: #f87171;
    background: rgba(220,38,38,.1);
}

/* Labels de section dans les dropdowns */
.dropdown-header-label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #475569;
    padding: .3rem .85rem .1rem;
}

/* =========================
   HERO
========================== */

.hero{
    min-height:90vh;
    background:
        linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.45)),
        url('img/hero-bg.jpg') center/cover no-repeat;
    display:flex;
    align-items:center;
    padding:60px 0;
}

.hero h1{
    font-size:clamp(1.8rem, 5vw, 4rem);
    font-weight:700;
    line-height:1.2;
}

.hero p{
    font-size:clamp(1rem, 2.5vw, 1.3rem);
    color:#d1d5db;
}

.btn-japan{
    background-color:#dc2626;
    border:none;
    padding:12px 30px;
    font-size:clamp(0.95rem, 2vw, 1.1rem);
    transition:0.3s;
    white-space:nowrap;
}

.btn-japan:hover{
    background-color:#b91c1c;
}

@media(max-width:576px){
    .hero{
        min-height:70vh;
        text-align:center;
    }
    .hero .mt-5{
        display:flex;
        flex-direction:column;
        gap:12px;
        align-items:center;
    }
    .hero .btn{
        width:100%;
        max-width:280px;
    }
}

/* =========================
   SECTIONS TITRES
========================== */

.section-title{
    font-size:clamp(1.5rem, 4vw, 2.2rem);
    font-weight:bold;
    margin-bottom:40px;
    text-align:center;
}

/* =========================
   CARDS MODULES
========================== */

.card-japan{
    background-color:#1e293b;
    border:none;
    border-radius:20px;
    overflow:hidden;
    transition:0.3s;
    height:100%;
}

.card-japan:hover{
    transform:translateY(-8px);
    box-shadow:0 10px 25px rgba(0,0,0,0.5);
}

.card-japan img{
    width:100%;
    height:200px;
    object-fit:cover;
}

/* ── Overlay texte japonais sur image carte ── */
.card-img-overlay-wrap {
    position: relative;
    overflow: hidden;
}

.card-img-overlay-wrap .card-img-top {
    display: block;
}

.card-img-jp-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 15, 30, 0.45);
    gap: 6px;
}

.jp-main {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 3.8rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 18px rgba(0,0,0,0.7);
    letter-spacing: .05em;
    line-height: 1;
}

.jp-sub {
    font-size: .85rem;
    font-weight: 600;
    color: rgba(255,255,255,.85);
    letter-spacing: .12em;
    text-transform: uppercase;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

/* ── Visuels modules homepage ── */
.module-visual {
    position:relative;
    height:200px;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.module-char {
    font-family:'Noto Sans JP', sans-serif;
    font-size:9rem;
    font-weight:900;
    color:rgba(255,255,255,0.18);
    line-height:1;
    position:absolute;
    left:10%;
    user-select:none;
}

.module-char-sub {
    font-family:'Noto Sans JP', sans-serif;
    font-size:5.5rem;
    font-weight:700;
    color:rgba(255,255,255,0.28);
    line-height:1;
    position:absolute;
    right:12%;
    bottom:10%;
    user-select:none;
}

.module-label-top {
    position:absolute;
    top:14px;
    right:16px;
    font-size:.72rem;
    font-weight:700;
    letter-spacing:.08em;
    text-transform:uppercase;
    color:rgba(255,255,255,.55);
    background:rgba(0,0,0,.3);
    padding:3px 10px;
    border-radius:20px;
}

.module-card:hover .module-char {
    color:rgba(255,255,255,0.30);
    transition:color .3s;
}
.module-card:hover .module-char-sub {
    color:rgba(255,255,255,0.42);
    transition:color .3s;
}

.card-body h5{
    font-weight:bold;
    font-size:clamp(1rem, 2vw, 1.2rem);
}

.card-body p{
    color:#cbd5e1;
    font-size:clamp(0.85rem, 1.5vw, 0.95rem);
}

/* =========================
   FEATURES / VIGNETTES
========================== */

.feature-box{
    background-color:#1e293b;
    border-radius:20px;
    padding:clamp(20px, 4vw, 30px);
    text-align:center;
    transition:0.3s;
    display:flex;
    flex-direction:column;
    align-items:center;
    height:100%;
}

.feature-box:hover{
    transform:scale(1.02);
}

.feature-box img{
    width:100%;
    height:180px;
    object-fit:cover;
    border-radius:12px;
    margin-bottom:1rem;
}

.feature-box h4{
    font-size:clamp(1rem, 2.5vw, 1.2rem);
    font-weight:bold;
    margin-bottom:0.75rem;
}

.feature-box p{
    color:#cbd5e1;
    font-size:clamp(0.85rem, 1.5vw, 0.95rem);
    flex-grow:1;
}

.feature-box > i,
.feature-box > a > i {
    font-size:3rem;
    color:#dc2626;
    margin-bottom:20px;
}
.feature-box .btn i {
    font-size: 1em;
    vertical-align: middle;
    position: relative;
    top: -1px;
    margin-bottom: 0;
    color: inherit;
}

.feature-box .btn{
    align-self:center;
    width:auto;
    margin-top:1rem;
    white-space:nowrap;
}

@media(max-width:768px){
    .feature-box img{
        height:150px;
    }
}

/* =========================
   INTRODUCTION (pages cours)
========================== */

.intro-section{
    margin-bottom:60px;
}

.intro-box{
    background:#1e293b;
    padding:clamp(20px, 5vw, 40px);
    border-radius:20px;
    border:1px solid rgba(255,255,255,0.05);
}

.intro-box h2{
    margin-bottom:20px;
    font-weight:bold;
    color:#ffffff;
    font-size:clamp(1.2rem, 3vw, 1.7rem);
}

.intro-box p{
    color:#cbd5e1;
    line-height:1.8;
    font-size:clamp(0.9rem, 1.5vw, 1rem);
}

.kana-rules{
    padding-left:20px;
}

.kana-rules li{
    margin-bottom:12px;
    color:#e2e8f0;
    font-size:clamp(0.9rem, 1.5vw, 1rem);
}

.memo-text{
    background:#0f172a;
    border-left:5px solid #dc2626;
    padding:20px;
    font-size:clamp(1.2rem, 4vw, 2rem);
    font-weight:bold;
    letter-spacing:clamp(2px, 1vw, 5px);
    text-align:center;
    border-radius:10px;
    word-break:break-all;
}

/* =========================
   HERO SMALL (pages internes)
========================== */

.hero-small{
    padding:clamp(40px, 8vw, 80px) 0;
    text-align:center;
}

.hero-small h1{
    font-size:clamp(1.8rem, 5vw, 4rem);
    font-weight:bold;
    line-height:1.2;
}

.hero-small p{
    font-size:clamp(1rem, 2vw, 1.2rem);
    color:#cbd5e1;
}

/* =========================
   KANA CARDS (hiragana/katakana)
========================== */

.kana-section{
    margin-bottom:60px;
}

.kana-card{
    background:#1e293b;
    border-radius:20px;
    padding:clamp(15px, 3vw, 30px);
    text-align:center;
    transition:0.3s;
    height:100%;
    border:1px solid rgba(255,255,255,0.05);
}

.kana-card:hover{
    transform:translateY(-8px);
    box-shadow:0 10px 25px rgba(0,0,0,0.5);
}

.kana{
    font-size:clamp(2rem, 6vw, 3rem);
    font-weight:bold;
    line-height:1;
}

.romaji{
    color:#f87171;
    font-size:clamp(1.1rem, 3vw, 1.8rem);
    margin-top:10px;
    font-weight:bold;
}

/* =========================
   GÉOGRAPHIE — IMAGES
========================== */

.img-geo{
    width:100%;
    max-height:450px;
    object-fit:cover;
    border-radius:16px;
}

/* =========================
   FOOTER
========================== */

footer{
    background-color:#111827;
    padding:clamp(25px, 5vw, 40px) 0;
    margin-top:60px;
    border-top:2px solid #dc2626;
    text-align:center;
}

footer h4{
    font-size:clamp(1rem, 3vw, 1.3rem);
}

footer p{
    font-size:clamp(0.85rem, 1.5vw, 0.95rem);
    color:#cbd5e1;
}

footer a{
    color:#f87171;
    text-decoration:none;
}

footer a:hover{
    color:#ffffff;
    text-decoration:underline;
}

/* =========================
   UTILITAIRES RESPONSIVE
========================== */

@media(max-width:576px){
    .btn{
        font-size:0.9rem;
        padding:10px 18px;
    }
    .section-title{
        margin-bottom:25px;
    }
    .intro-section{
        margin-bottom:40px;
    }
    .kana-section{
        margin-bottom:40px;
    }
}

/* ── Bouton retour en haut ── */
#back-to-top {
    position: fixed !important;
    bottom: 28px !important;
    right: 20px !important;
    left: auto !important;
    z-index: 9999;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626, #f97316);
    color: #fff;
    border: 2px solid rgba(255,255,255,.2);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font-size: 1.3rem;
    box-shadow: 0 6px 20px rgba(220,38,38,.45), 0 2px 8px rgba(0,0,0,.4);
    opacity: 0;
    transform: translateY(20px) scale(0.85);
    transition: opacity .3s, transform .3s cubic-bezier(.34,1.56,.64,1), background .2s, box-shadow .2s;
    pointer-events: none;
}
#back-to-top .btn-label {
    font-size: .5rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1;
    opacity: .85;
}
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
#back-to-top:hover {
    background: linear-gradient(135deg, #b91c1c, #ea580c);
    box-shadow: 0 8px 28px rgba(220,38,38,.6), 0 2px 8px rgba(0,0,0,.4);
    transform: translateY(-3px) scale(1.08);
}
#back-to-top:active {
    transform: scale(0.95);
}

/* =========================
   MOUVEMENT RÉDUIT (WCAG 2.3.3)
========================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================
   THEME TOGGLE BAR
========================== */

.theme-bar {
    background: #0d1525;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    justify-content: flex-end;
    padding: 5px 16px;
}

#theme-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 20px;
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .78rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 4px 14px;
    transition: background .2s, border-color .2s, color .2s;
}
#theme-toggle:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.35);
    color: #fff;
}
#theme-toggle i { font-size: .9rem; }

/* =========================
   THEME CLAIR (JOUR)
========================== */

html.theme-light body                       { background-color: #f1f5f9; color: #1e293b; }
html.theme-light .navbar                    { background-color: #ffffff !important; border-bottom-color: #dc2626; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
html.theme-light .navbar-brand             { color: #1e293b !important; }
html.theme-light .nav-link                 { color: #475569 !important; }
html.theme-light .nav-link:hover           { color: #1e293b !important; background: rgba(0,0,0,.05); }
html.theme-light .nav-link[aria-current="page"],
html.theme-light .nav-link[aria-current="true"] { color: #dc2626 !important; }
html.theme-light .nav-link-exercices       { color: #dc2626 !important; border-color: rgba(220,38,38,.4); }
html.theme-light .nav-link-exercices:hover { background: rgba(220,38,38,.07) !important; }
html.theme-light .navbar-toggler           { border-color: rgba(0,0,0,.2); }
html.theme-light .navbar-toggler-icon      { filter: invert(1); }
html.theme-light .dropdown-menu-dark       { background-color: #ffffff; border-color: #e2e8f0; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
html.theme-light .dropdown-item            { color: #334155; }
html.theme-light .dropdown-item:hover      { background-color: rgba(220,38,38,.08); color: #dc2626; }
html.theme-light .dropdown-item[aria-current="page"] { color: #dc2626; background: rgba(220,38,38,.06); }
html.theme-light .dropdown-header-label   { color: #94a3b8; }

html.theme-light .theme-bar                { background: #e2e8f0; border-bottom-color: rgba(0,0,0,.1); }
html.theme-light #theme-toggle             { border-color: rgba(0,0,0,.2); color: #475569; }
html.theme-light #theme-toggle:hover       { background: rgba(0,0,0,.06); color: #1e293b; }

html.theme-light .card-japan               { background-color: #ffffff; box-shadow: 0 2px 12px rgba(0,0,0,.1); }
html.theme-light .card-japan .card-body h5 { color: #1e293b; }
html.theme-light .card-japan .card-body p  { color: #475569; }
html.theme-light .kana-card                { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
html.theme-light .kana                     { color: #1e293b; }
html.theme-light .romaji                   { color: #dc2626; }
html.theme-light .intro-box                { background: #ffffff; border-color: #e2e8f0; }
html.theme-light .intro-box h2             { color: #1e293b; }
html.theme-light .intro-box p              { color: #475569; }
html.theme-light .kana-rules li            { color: #334155; }
html.theme-light .memo-text                { background: #f8fafc; color: #1e293b; border-left-color: #dc2626; }
html.theme-light .feature-box              { background-color: #ffffff; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
html.theme-light .feature-box h4           { color: #1e293b; }
html.theme-light .feature-box p            { color: #475569; }
html.theme-light .section-title            { color: #1e293b; }
html.theme-light .hero-small h1            { color: #1e293b; }
html.theme-light .hero-small p             { color: #475569; }
html.theme-light footer                    { background-color: #e2e8f0; border-top-color: #dc2626; }
html.theme-light footer h4                 { color: #1e293b; }
html.theme-light footer p                  { color: #475569; }
html.theme-light footer a                  { color: #dc2626; }

/* Tables et badges sur pages internes */
html.theme-light table                     { color: #1e293b; }
html.theme-light .table-dark               { --bs-table-bg: #f1f5f9; --bs-table-color: #1e293b; --bs-table-border-color: #e2e8f0; }
html.theme-light .badge.bg-secondary       { background-color: #e2e8f0 !important; color: #475569; }

/* Galerie vocabulaire */
html.theme-light .toolbar-vocab            { background: #ffffff; border-color: #e2e8f0; }
html.theme-light .toolbar-vocab input      { background: #f1f5f9; border-color: #cbd5e1; color: #1e293b; }
html.theme-light .toolbar-vocab input::placeholder { color: #94a3b8; }
html.theme-light #compteur                 { color: #64748b; }

/* ── Textes généraux → sombres en mode jour ── */
html.theme-light h1, html.theme-light h2, html.theme-light h3,
html.theme-light h4, html.theme-light h5, html.theme-light h6 { color: #1e293b; }

/* ── Tous les héros avec image : titres et sous-titres restent blancs ── */
html.theme-light .hero h1,
html.theme-light .hero-kanji h1,
html.theme-light .hero-vocab h1,
html.theme-light .hero-jlpt h1,
html.theme-light .hero-bases h1,
html.theme-light .hero-livres h1,
html.theme-light .hero-hiragana h1,
html.theme-light .hero-katakana h1,
html.theme-light .quiz-hero h1             { color: #ffffff !important; }

html.theme-light .hero p,
html.theme-light .hero-kanji p,
html.theme-light .hero-vocab p,
html.theme-light .hero-jlpt p,
html.theme-light .hero-bases p,
html.theme-light .hero-livres p,
html.theme-light .hero-hiragana p,
html.theme-light .hero-katakana p,
html.theme-light .quiz-hero p              { color: #e2e8f0 !important; }

html.theme-light .hero .btn-outline-light  { color: #fff !important; border-color: #fff !important; }
html.theme-light p                         { color: #334155; }
html.theme-light li                        { color: #334155; }
html.theme-light strong                    { color: #1e293b; }
html.theme-light em                        { color: #334155; }
html.theme-light label                     { color: #334155; }
html.theme-light .text-white               { color: #1e293b !important; }
html.theme-light .text-light,
html.theme-light .text-muted               { color: #475569 !important; }
html.theme-light kbd                       { background: #e2e8f0; color: #1e293b; border-color: #cbd5e1; }

/* ── Navigation interne (kanji-nav) ── */
html.theme-light .kanji-nav               { background: #ffffff; border-color: #e2e8f0; }
html.theme-light .kanji-nav a             { color: #dc2626; border-color: rgba(220,38,38,.3); }
html.theme-light .kanji-nav a:hover       { background: rgba(220,38,38,.1); }

/* ── Titres de section avec bordure ── */
html.theme-light .section-titre           { color: #1e293b !important; border-left-color: #dc2626; }

/* ── Cartes théorie (kanji.php, grammaire…) ── */
html.theme-light .theory-card             { background: #ffffff; border-color: #e2e8f0; color: #334155; }
html.theme-light .theory-card h3          { color: #dc2626 !important; }
html.theme-light .theory-card .kanji-ex   { color: #dc2626; }

/* ── Galerie kanji ── */
html.theme-light .toolbar-kanji           { background: #ffffff; border-color: #e2e8f0; }
html.theme-light .toolbar-kanji input     { background: #f1f5f9; border-color: #cbd5e1; color: #1e293b; }
html.theme-light .toolbar-kanji input::placeholder { color: #94a3b8; }
html.theme-light #compteur-kanji          { color: #64748b; }
html.theme-light .card-kanji              { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 2px 10px rgba(0,0,0,.1); }
html.theme-light .kanji-visible           { color: #dc2626; }
html.theme-light .hint-text               { color: #64748b; }
/* Les overlays gardent leur fond sombre — texte blanc conservé */
html.theme-light .overlay                 { background: rgba(15,23,42,0.97) !important; color: #f1f5f9 !important; }
html.theme-light .overlay .info-row       { color: #cbd5e1 !important; }
html.theme-light .overlay .info-row span  { color: #f1f5f9 !important; }
html.theme-light .overlay .exemple-bloc   { background: rgba(0,0,0,.3) !important; }
html.theme-light .overlay .ex-trad        { color: #94a3b8 !important; }
html.theme-light .overlay .jp,
html.theme-light .overlay .kj,
html.theme-light .overlay .fr,
html.theme-light .overlay .k-big,
html.theme-light .overlay .ex-kanji,
html.theme-light .overlay .ex-read        { color: inherit !important; }

/* ── Hero internes (bandeau de page) — fond clair, texte sombre ── */
html.theme-light .hero-small              { background: #f1f5f9; border-bottom: 2px solid #e2e8f0; }
html.theme-light .hero-small h1           { color: #1e293b !important; }
html.theme-light .hero-small p            { color: #475569 !important; }

/* ── Intro-section ── */
html.theme-light .intro-section           { background: transparent; }
html.theme-light .intro-box               { background: #ffffff; border-color: #e2e8f0; }
html.theme-light .intro-box h2            { color: #1e293b !important; }
html.theme-light .intro-box p             { color: #334155; }
html.theme-light .intro-box strong        { color: #1e293b; }
html.theme-light .kana-rules li           { color: #334155; }
html.theme-light .memo-text               { background: #f1f5f9; color: #1e293b; }

/* ── Kana cards (hiragana/katakana) ── */
html.theme-light .kana-card               { background: #ffffff; border-color: #e2e8f0; }
html.theme-light .kana                    { color: #1e293b; }
html.theme-light .romaji                  { color: #dc2626; }
html.theme-light .kana-section h2         { color: #1e293b !important; }

/* ── JLPT page ── */
html.theme-light .niveau-card             { border-color: #e2e8f0; }
html.theme-light .stat-box                { background: #f8fafc; border-color: #e2e8f0; }
html.theme-light .stat-box .stat-val      { color: #1e293b !important; }
html.theme-light .stat-box .stat-lbl      { color: #64748b; }
html.theme-light .conseil-card            { background: #ffffff; border-color: #e2e8f0; }
html.theme-light .conseil-card h4         { color: #1e293b !important; }
html.theme-light .conseil-card p          { color: #334155; }
html.theme-light .ressource-item          { background: #ffffff; border-color: #e2e8f0; }

/* ── Pages cours (grammaire, expressions, couleurs…) ── */
html.theme-light .phrase-card,
html.theme-light .grammar-card,
html.theme-light .color-card,
html.theme-light .expression-card         { background: #ffffff !important; border-color: #e2e8f0 !important; color: #334155 !important; }
html.theme-light [class*="-card"] h3,
html.theme-light [class*="-card"] h4      { color: #1e293b !important; }
html.theme-light [class*="-card"] p,
html.theme-light [class*="-card"] span    { color: #334155; }

/* ── Tables Bootstrap ── */
html.theme-light .table                   { --bs-table-color: #1e293b; --bs-table-bg: #ffffff; --bs-table-border-color: #e2e8f0; }
html.theme-light .table-dark              { --bs-table-color: #1e293b; --bs-table-bg: #f1f5f9; --bs-table-striped-bg: #e8edf4; --bs-table-border-color: #e2e8f0; }
html.theme-light .table th                { color: #1e293b !important; }
html.theme-light .table td                { color: #334155 !important; }

/* ── Badges ── */
html.theme-light .badge                   { filter: none; }
html.theme-light .badge.bg-dark           { background-color: #334155 !important; color: #fff !important; }
html.theme-light .badge.text-bg-secondary { background-color: #e2e8f0 !important; color: #334155 !important; }

/* ── Bouton audio ── */
html.theme-light .btn-audio               { background: rgba(220,38,38,.1); border-color: rgba(220,38,38,.35); color: #b91c1c; }
html.theme-light .btn-audio:hover         { background: rgba(220,38,38,.2); color: #991b1b; }

/* ── Back to top ── */
html.theme-light #back-to-top            { box-shadow: 0 6px 20px rgba(220,38,38,.3), 0 2px 8px rgba(0,0,0,.2); }

/* ── Page Livres ── */
html.theme-light .intro-bloc             { background: #ffffff !important; border: 1px solid #e2e8f0; color: #334155 !important; }
html.theme-light .intro-bloc p           { color: #334155 !important; }
html.theme-light .intro-bloc em          { color: #dc2626 !important; }
html.theme-light .intro-bloc strong      { color: #1e293b !important; }
html.theme-light .book-card              { background: #ffffff !important; border: 1px solid #e2e8f0; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
html.theme-light .book-body              { background: transparent !important; }
html.theme-light .book-cover             { background: #f1f5f9 !important; }
html.theme-light .book-title             { color: #1e293b !important; }
html.theme-light .book-desc              { color: #475569 !important; }
html.theme-light .book-topic             { background: #f1f5f9 !important; color: #334155 !important; border-color: #e2e8f0 !important; }
html.theme-light .book-price             { color: #b45309 !important; }
html.theme-light .book-footer            { border-top-color: #e2e8f0 !important; }
html.theme-light .badge-debutant         { background: rgba(220,38,38,.12) !important; color: #b91c1c !important; border-color: rgba(220,38,38,.3) !important; }
html.theme-light .badge-intermediaire    { background: rgba(13,148,136,.12) !important; color: #0f766e !important; border-color: rgba(13,148,136,.3) !important; }
html.theme-light .badge-kanjis           { background: rgba(124,58,237,.12) !important; color: #6d28d9 !important; border-color: rgba(124,58,237,.3) !important; }
html.theme-light .badge-culture          { background: rgba(217,119,6,.12) !important; color: #b45309 !important; border-color: rgba(217,119,6,.3) !important; }

/* ── Pages cours — catch-all cartes contenu ── */
/* Fonds de cartes internes */
html.theme-light [class*="-card"]:not(.card-kanji):not(.overlay) { background-color: #ffffff !important; border-color: #e2e8f0 !important; }
/* Titres dans les cartes */
html.theme-light [class*="-title"]        { color: #1e293b !important; }
html.theme-light [class*="-card"] h3,
html.theme-light [class*="-card"] h4      { color: #1e293b !important; }
/* Textes courants dans les cartes */
html.theme-light [class*="-card"] > p,
html.theme-light [class*="-card"] p       { color: #334155 !important; }
html.theme-light [class*="-card"] li      { color: #334155 !important; }
/* Textes français dans exercices */
html.theme-light [class*="-fr"]           { color: #1e293b !important; }
html.theme-light [class*="-en"]           { color: #475569 !important; }
/* Sections de contenu */
html.theme-light [class*="-section"] p,
html.theme-light [class*="-section"] li   { color: #334155 !important; }
html.theme-light [class*="-section"] h4   { color: #1e293b !important; }

/* ── Pages cours — JLPT section-titre ── */
html.theme-light .info-card               { background: #ffffff !important; color: #334155; }
html.theme-light .info-card strong        { color: #1e293b !important; }
html.theme-light .cal-card                { background: #ffffff !important; border-color: #e2e8f0 !important; }
html.theme-light .cal-card .cal-date      { color: #1e293b !important; }
html.theme-light .cal-card p              { color: #334155 !important; }
html.theme-light .ressource-list li       { color: #334155; }
html.theme-light .ressource-list .res-title { color: #1e293b !important; }

/* ── Grammaire ── */
html.theme-light .gram-subsection h4      { color: #1e293b !important; }
html.theme-light .phrase-ex               { background: #f8fafc !important; border-color: #e2e8f0 !important; }
html.theme-light .phrase-ex .ex-fr        { color: #1e293b !important; }
html.theme-light .phrase-ex .ex-label     { color: #475569 !important; }
html.theme-light .term-arrow              { color: #475569 !important; }
html.theme-light .group-card .g-title     { color: #1e293b !important; }

/* ── Corps humain, couleurs, animaux ── */
html.theme-light .health-fr               { color: #1e293b !important; }
html.theme-light .color-fr                { color: #1e293b !important; }
html.theme-light .color-en                { color: #475569 !important; }
html.theme-light .body-img-caption        { color: #475569 !important; }

/* ── Se présenter ── */
html.theme-light .pres-card               { background: #ffffff !important; }
html.theme-light .pres-card p,
html.theme-light .pres-card span          { color: #334155 !important; }
html.theme-light .pres-card strong        { color: #1e293b !important; }

/* ── Expressions temporelles ── */
html.theme-light .phrase-block            { background: #f8fafc !important; border-color: #e2e8f0 !important; }
html.theme-light .phrase-block p          { color: #334155 !important; }
html.theme-light .zodiac-hours            { color: #475569 !important; }
html.theme-light .phrase-en               { color: #475569 !important; }

/* ── Niveau JLPT cards (couleurs conservées, texte blanc forcé) ── */
html.theme-light .bg-n5,
html.theme-light .bg-n4,
html.theme-light .bg-n3,
html.theme-light .bg-n2,
html.theme-light .bg-n1                   { color: #fff !important; }
html.theme-light .niveau-card             { box-shadow: 0 2px 12px rgba(0,0,0,.15); }
html.theme-light .niveau-card p           { color: rgba(255,255,255,.9) !important; }

/* ── inline style color:#f1f5f9 sur <strong> ── */
html.theme-light strong[style*="color:#f1f5f9"],
html.theme-light strong[style*="color: #f1f5f9"] { color: #1e293b !important; }
