.histoire-fiche-hero {
    background-color: var(--couleur-beige);
    padding: 56px 0 64px;
}

[data-theme="sombre"] .histoire-fiche-hero {
    background-color: #171b1e;
}

.histoire-fiche-mise-en-page {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 44px;
    align-items: start;
}

.histoire-fiche-couverture {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 16px;
    background-color: rgba(38, 53, 60, 0.06);
    background-size: cover;
    background-position: center;
    box-shadow: 0 16px 40px rgba(38, 53, 60, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(38, 53, 60, 0.25);
    font-size: 2.4rem;
}

/* CORRECTIF — la tuile de couverture "sans image" de la fiche histoire
   n'avait pas de variante sombre (icône + fond pensés pour fond clair) */
[data-theme="sombre"] .histoire-fiche-couverture {
    background-color: rgba(255, 255, 255, 0.06);
    color: rgba(240, 235, 230, 0.2);
}

.histoire-fiche-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.histoire-fiche-badge-genre {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    background-color: rgba(255, 103, 106, 0.1);
    color: var(--couleur-corail);
}

.histoire-fiche-titre {
    font-family: var(--police-exergue);
    font-size: 2.4rem;
    color: var(--couleur-anthracite);
    margin-bottom: 12px;
    line-height: 1.2;
}

[data-theme="sombre"] .histoire-fiche-titre {
    color: #f0ebe6;
}

.histoire-fiche-auteur {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.histoire-fiche-auteur-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--couleur-corail);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.histoire-fiche-auteur-nom {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--couleur-anthracite);
}

[data-theme="sombre"] .histoire-fiche-auteur-nom {
    color: #f0ebe6;
}

.histoire-fiche-description {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(38, 53, 60, 0.75);
    margin-bottom: 24px;
    max-width: 620px;
}

[data-theme="sombre"] .histoire-fiche-description {
    color: rgba(240, 235, 230, 0.75);
}

.histoire-fiche-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 28px;
}

.histoire-fiche-stat {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.88rem;
    color: rgba(38, 53, 60, 0.6);
}

.histoire-fiche-stat i {
    color: var(--couleur-corail);
}

[data-theme="sombre"] .histoire-fiche-stat {
    color: rgba(240, 235, 230, 0.6);
}

.histoire-fiche-actions {
    display: flex;
    gap: 12px;
}

/* ==========================================================================
   SOMMAIRE DES CHAPITRES
   ========================================================================== */

.histoire-fiche-sommaire {
    padding: 56px 0 80px;
}

/* CORRECTIF — le conteneur de la section sommaire n'avait pas de fond sombre
   propre, restait sur le fond de page clair par défaut au-dessus/autour
   du sommaire */
[data-theme="sombre"] .histoire-fiche-sommaire {
    background-color: #171b1e;
}

.histoire-fiche-sommaire h2 {
    font-family: var(--police-exergue);
    font-size: 1.5rem;
    color: var(--couleur-anthracite);
    margin-bottom: 20px;
}

[data-theme="sombre"] .histoire-fiche-sommaire h2 {
    color: #f0ebe6;
}

.liste-sommaire {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 700px;
}

.sommaire-chapitre {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(38, 53, 60, 0.05);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.sommaire-chapitre:hover {
    box-shadow: 0 8px 20px rgba(38, 53, 60, 0.1);
    transform: translateX(2px);
}

[data-theme="sombre"] .sommaire-chapitre {
    background-color: #232a2f;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sommaire-chapitre__numero {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 103, 106, 0.1);
    color: var(--couleur-corail);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* CORRECTIF — le badge numéroté (fond corail très transparent, pensé pour
   un fond blanc) devenait délavé sur une carte sombre (#232a2f) */
[data-theme="sombre"] .sommaire-chapitre__numero {
    background-color: rgba(255, 103, 106, 0.18);
}

.sommaire-chapitre__corps {
    flex: 1;
    min-width: 0;
}

.sommaire-chapitre__titre {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--couleur-anthracite);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="sombre"] .sommaire-chapitre__titre {
    color: #f0ebe6;
}

.sommaire-chapitre__meta {
    font-size: 0.78rem;
    color: rgba(38, 53, 60, 0.5);
    margin-top: 2px;
}

[data-theme="sombre"] .sommaire-chapitre__meta {
    color: rgba(240, 235, 230, 0.5);
}

.sommaire-chapitre__badge-brouillon {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: rgba(202, 136, 0, 0.1);
    color: var(--couleur-ocre);
    flex-shrink: 0;
}

/* CORRECTIF — même souci de contraste que le badge numéroté ci-dessus */
[data-theme="sombre"] .sommaire-chapitre__badge-brouillon {
    background-color: rgba(202, 136, 0, 0.18);
}

.histoire-fiche-vide {
    text-align: center;
    padding: 60px 20px;
    color: rgba(38, 53, 60, 0.45);
}

/* CORRECTIF — le message d'état vide ("Aucun chapitre publié") n'avait
   pas de variante sombre */
[data-theme="sombre"] .histoire-fiche-vide {
    color: rgba(240, 235, 230, 0.45);
}

@media (max-width: 760px) {
    .histoire-fiche-mise-en-page {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .histoire-fiche-couverture {
        max-width: 200px;
        margin: 0 auto;
    }

    .histoire-fiche-genres,
    .histoire-fiche-auteur,
    .histoire-fiche-stats,
    .histoire-fiche-actions {
        justify-content: center;
    }

    .histoire-fiche-actions {
        flex-direction: column;
        width: 100%;
    }

    .histoire-fiche-titre {
        font-size: 1.8rem;
    }
}

.histoire-fiche-auteur-ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.histoire-fiche-auteur-abonnes {
    display: block;
    font-size: 0.76rem;
    color: rgba(38, 53, 60, 0.45);
    margin-top: 1px;
}

[data-theme="sombre"] .histoire-fiche-auteur-abonnes {
    color: rgba(240, 235, 230, 0.45);
}

.histoire-bouton-suivre {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 999px;
    background-color: var(--couleur-corail);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.histoire-bouton-suivre:hover {
    transform: translateY(-1px);
}

.histoire-bouton-suivre--actif {
    background-color: transparent;
    border: 1.5px solid rgba(38, 53, 60, 0.2);
    color: var(--couleur-anthracite);
}

[data-theme="sombre"] .histoire-bouton-suivre--actif {
    border-color: rgba(255, 255, 255, 0.2);
    color: #f0ebe6;
}

.histoire-fiche-boutons-secondaires {
    margin-bottom: 24px;
}

.histoire-bouton-favori {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    border: 1.5px solid rgba(38, 53, 60, 0.15);
    color: var(--couleur-anthracite);
    font-size: 0.88rem;
    font-weight: 600;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.histoire-bouton-favori i {
    color: var(--couleur-corail);
}

.histoire-bouton-favori:hover {
    border-color: var(--couleur-corail);
}

.histoire-bouton-favori--actif {
    background-color: rgba(255, 103, 106, 0.08);
    border-color: var(--couleur-corail);
    color: var(--couleur-corail);
}

[data-theme="sombre"] .histoire-bouton-favori {
    border-color: rgba(255, 255, 255, 0.15);
    color: #f0ebe6;
}

@media (max-width: 760px) {
    .histoire-fiche-auteur-ligne {
        justify-content: center;
    }
}