/* ============================================================
   single-text.css — styles de la page texte (single « text »)
   Feuille unifiée : layout / reader / méta / actions + suivi de
   lecture (ex-lectures.css, fusionné en bas de ce fichier).
   Chargée pour tous les visiteurs sur les pages texte.
   La barre d'édition auteur est stylée séparément dans
   author_toolbar.css (chargée uniquement pour les auteurs).
   ============================================================ */

/* Titre et auteur */

.single-text h1.entry-title {
    font-size: 2.5em !important;
    margin-bottom: 0 !important;
}

.authors{
    margin:0 !important;
}

/* css fixes */
span {
    font-family: var(--typo-texte) !important;
}

.single-text #primary {
    margin-top:0px !important;
}

/* ============================================================
   Layout — colonne actions (droite)
   Le conteneur .text-layout-bottom et la grille .text-columns
   sont définis plus bas (section « Layout » V2).
   ============================================================ */

.text-col-actions {
    flex: 3;
    min-width: 0;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
}

/* Éléments de la barre d'actions mobile — masqués par défaut (desktop) */
.mobile-actions-toggle,
.mobile-actions-extra,
.mobile-actions-main {
    display: none;
}

@media (max-width: 768px) {
    .text-layout-bottom { flex-direction: column; }

    .text-col-actions {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        top: auto; /* reset du top: 2rem défini en desktop */
        flex: none;
        min-width: unset;
        background: white;
        border-top: 1px solid #eee;
        z-index: 200;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
        display: flex;
        flex-direction: column;
        align-self: auto;
    }

    /* Zone principale — toujours visible, en bas */
    .mobile-actions-main {
        display: block;
        padding: 0.4rem 1rem 0.6rem;
        order: 3;
    }
    .mobile-actions-main .btn-primary {
        display: block;
        width: 100%;
        font-size: 0.95rem;
        padding: 0.8rem 1rem;
        text-align: center;
        box-sizing: border-box;
    }

    /* Actions secondaires — cachées par défaut, au-dessus du bouton principal */
    .mobile-actions-extra {
        order: 2;
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        overflow: hidden;
        max-height: 0;
        padding: 0 1rem;
        transition: max-height 0.3s ease, padding-top 0.3s ease, padding-bottom 0.3s ease;
    }
    .text-col-actions.is-expanded .mobile-actions-extra {
        max-height: 200px;
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }

    /* Chevron — tout en haut de la barre */
    .mobile-actions-toggle {
        order: 1;
        display: flex;
        justify-content: center;
        padding: 0.2rem 0 0.1rem;
        cursor: pointer;
        background: none;
        border: none;
        width: 100%;
        color: #aaa !important;
        transition: color 0.15s;
    }
    .mobile-actions-toggle:hover,
    .mobile-actions-toggle:focus {
        color: #555 !important;
        background: none !important;
    }
    .mobile-actions-toggle svg {
        transition: transform 0.3s ease;
    }
    .text-col-actions.is-expanded .mobile-actions-toggle svg {
        transform: rotate(180deg);
    }

    /* Sur mobile : masquer la colonne desktop */
    .text-col-actions > .text-actions { display: none; }
}

/* ============================================================
   Métadonnées — pills
   ============================================================ */

.text-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin: 0.25rem 0;
}
.text-meta-tags .meta-label {
    font-size: 0.8rem;
    color: #666;
    margin-right: 0.15rem;
    white-space: nowrap;
}
.text-meta-tags .meta-pill {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 0;
    font-size: 0.78rem;
    line-height: 1.4;
    background: #f0f0f0;
    color: #333;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.15s;
}
a.meta-pill:hover {
    background: #e0e0e0;
    color: #111;
}
.meta-pill--more {
    background: none;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 0.78rem;
    padding: 0.2rem 0.65rem;
    border-radius: 0;
    color: #555;
    transition: border-color 0.15s, color 0.15s;
}
.meta-pill--more:hover {
    border-color: #888;
    color: #111;
}

/* ============================================================
   Conteneur expandable (personnages, décors, résumé)
   ============================================================ */

.expandable-block {
    position: relative;
    margin-bottom: 1.5rem;
}
.expandable-inner {
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.expandable-gradient {
    position: absolute;
    bottom: 1.5rem;
    left: 0; right: 0;
    height: 4rem;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.expandable-block.is-expanded .expandable-gradient {
    opacity: 0;
}

/* Bouton "Afficher plus" — centré, délimité par des traits latéraux */
.expandable-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.5rem;
    background: none;
    border: none;
    padding: 0.35rem 0;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
}
.expandable-toggle::before,
.expandable-toggle::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}
button.expandable-toggle:hover {
    color: #bdbdbd !important;
}
.expandable-toggle:hover::before,
.expandable-toggle:hover::after {
    background: #aaa;
}

/* ============================================================
   Cartouche auteur communauté
   ============================================================ */

.author-cartouche {
    border-top: 1px solid #e8e8e8;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}
.author-cartouche__meta {
    font-size: 0.78rem;
    color: #888;
    margin-bottom: 1rem;
}
.author-cartouche__meta a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.author-cartouche__body {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.author-cartouche__avatar {
    flex-shrink: 0;
}
.author-cartouche__avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.author-cartouche__info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.author-cartouche__name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #222;
    text-decoration: none;
}
.author-cartouche__name:hover { text-decoration: underline; }
.author-cartouche__bio {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.5;
    margin: 0;
}
.author-cartouche__link {
    font-size: 0.78rem;
    color: #555;
    text-decoration: underline;
    text-underline-offset: 2px;
    align-self: flex-start;
}
.author-cartouche__link:hover { color: #111; }

/* ============================================================
   Boutons d'action (colonne droite)
   ============================================================ */

.text-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Bouton principal — rouge plein */
.btn-primary {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #e02020;
    color: white !important;
    border: 2px solid #e02020;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.15s, border-color 0.15s;
    box-sizing: border-box;
}
.btn-primary:hover {
    background: #c01818;
    border-color: #c01818;
}

/* Bouton désactivé (lecture en cours / terminée) */
.btn-secondary[disabled] {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* Boutons secondaires — contour noir */
.btn-secondary {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    background: transparent;
    color: #111 !important;
    border: 2px solid #111;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
    box-sizing: border-box;
}
.btn-secondary:hover {
    background: #111;
    color: white !important;
}

/* Lien action discret (étoile, etc.) */
.text-action-link {
    display: flex;
    align-items: center;
    font-size: 0.82rem;
    color: #666;
    text-decoration: none;
    padding: 0.25rem 0;
    transition: color 0.15s;
}
.text-action-link:hover {
    color: #111;
}

/* ============================================================
   Popup
   ============================================================ */

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.popup-content {
    background: white;
    border-radius: 0;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: 90vh;
}
.popup-large {
    max-width: 600px;
}
.popup-intro {
    font-size: 0.85rem !important;
    color: #555 !important;
    line-height: 1.5;
}
.popup-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}
.popup-content h3 {
    margin: 0;
    font-size: 1.1rem;
}
.popup-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #444;
}
/* Dans la popup les .btn-secondary ne doivent pas être full-width */
.popup-content .btn-secondary {
    width: auto;
    display: inline-block;
    align-self: flex-start;
}
.popup-notice {
    font-size: 0.82rem !important;
    color: #666 !important;
}
.popup-disclaimer {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.75rem !important;
    color: #888 !important;
    font-style: italic;
}
.popup-disclaimer a {
    color: inherit;
    text-decoration: underline;
}

/* ============================================================
   Critiques — note moyenne agrégée
   ============================================================ */

.text-critiques {
    margin-bottom: 1.5rem;
}
.critique-note-globale {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.critique-count {
    font-size: 0.82rem;
    color: #888;
}
.critique-detail {
    margin-top: 0.5rem;
}
.critique-detail summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
    list-style: none;
}
.critique-detail summary::-webkit-details-marker {
    display: none;
}
.critique-detail summary .chevron {
    display: inline-block;
    transition: transform 0.2s ease;
}
.critique-detail[open] summary .chevron {
    transform: rotate(90deg);
}
.critique-criteres {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.critique-criteres li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
}
.critere-label {
    min-width: 100px;
    color: #444;
}
.critere-score {
    color: #888;
}

/* ============================================================
   Bloc partage
   ============================================================ */

.text-share {
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}
.text-share__label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.text-share__links {
    display: flex;
    gap: 0.5rem;
}
.text-share__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: transparent;
    color: #444;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    padding: 0;
}
.text-share__btn:hover {
    border-color: #111;
    color: #111;
    background: #f5f5f5;
}
.text-share__copy.copied {
    border-color: #2a9d2a;
    color: #2a9d2a;
}

/* ============================================================
   V2 — Chapeau pleine largeur (même alignement que text-layout-bottom)
   ============================================================ */

.text-chapeau {
    max-width: var(--ast-content-width, 1200px);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
    padding-left: var(--ast-container-padding, 2rem);
    padding-right: var(--ast-container-padding, 2rem);
    box-sizing: border-box;
}
.text-chapeau__breadcrumb {
    font-size: 12px;
    color: #999;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.text-chapeau__breadcrumb a {
    color: inherit;
    text-decoration: none;
}
.text-chapeau__title {
    margin-bottom: 0.25rem !important;
}
.text-chapeau__authors {
    margin-bottom: 0.75rem !important;
}
.text-chapeau__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.text-chapeau__pill {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 12px;
    color: #555;
    text-decoration: none;
    white-space: nowrap;
}
.text-chapeau__pill:hover {
    border-color: #111;
    color: #111;
}
.text-chapeau__anchors {
    margin: 0.6rem 0 0;
    font-size: 13px;
    color: #888;
}
.text-chapeau__anchor-link {
    color: #555;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: #ccc;
}
.text-chapeau__anchor-link:hover {
    color: #111;
    text-decoration-color: #111;
}
.text-chapeau__anchor-sep {
    margin: 0 0.4rem;
    color: #ccc;
}
.text-chapeau__excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: #444;
}

/* ============================================================
   V2 — Titre reader
   ============================================================ */

.text-reader-label {
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0;
    text-transform: none;
    margin: 0 0 0.75rem;
    border-left: 3px solid #ff638e;
    padding-left: 0.6rem;
}

/* ============================================================
   V2 — Titres de sections (Personnages, Décors…)
   ============================================================ */

.text-section-label {
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    text-transform: none;
    letter-spacing: 0;
    margin: 0 0 0.75rem;
    border-left: 3px solid #ff638e;
    padding-left: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.section-count {
    font-size: 11px;
    font-weight: 400;
    color: #999;
}

/* ============================================================
   V2 — Séparateurs entre sections
   ============================================================ */

#characters,
#setting,
.author-cartouche,
.noter-texte-inline,
.discussion-section {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid #ebebeb;
}

.noter-texte-inline {
    display: flex;
    align-items: center;
}
.noter-texte-inline__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #555;
    text-decoration: none;
    transition: color 0.15s;
}
.noter-texte-inline__link:hover {
    color: #ff638e;
}
.noter-texte-inline__link svg {
    flex-shrink: 0;
}


/* ============================================================
   Reader — bouton plein écran visible au survol seulement
   ============================================================ */

#fullscreen-controls {
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
#text-container:hover #fullscreen-controls,
#text-container:focus-within #fullscreen-controls {
    opacity: 1;
    pointer-events: auto;
}
@media (max-width: 768px) {
    #fullscreen-controls {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ============================================================
   V2 — Progress-bar horizontale masquée (remplacée par scrollbar)
   ============================================================ */

.horizontal-progress-container {
    display: none !important;
}

/* ============================================================
   V2 — Layout : titre reader pleine largeur + colonnes 70/30
   ============================================================ */

.text-layout-bottom {
    display: block;
    margin-top: 1.5rem;
    max-width: var(--ast-content-width, 1200px);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--ast-container-padding, 2rem);
    padding-right: var(--ast-container-padding, 2rem);
    box-sizing: border-box;
}
.text-reader-header {
    width: 100%;
    margin-bottom: 0.75rem;
}
.text-columns {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}
.text-reader-col {
    flex: 7;
    min-width: 0;
}
/* .text-col-actions (desktop sticky + mobile fixed) est défini dans la
   section « Layout » en haut de ce fichier. */
@media (max-width: 768px) {
    .text-columns { flex-direction: column; }
}



/* ============================================================
   SUIVI DE LECTURE — fusionné depuis lectures.css
   (reader #text_content, barres de progression, plein écran,
    boutons listes/statut). Chargé pour tous sur la page texte.
   ============================================================ */

img.gravatar.avatar.avatar-80.um-avatar.um-avatar-uploaded {
    border-radius: 80px;
}

.um-user-profile.user-1 div {
    display: inline-block;
    margin-right: 15px;
}

.comments-rating {
	border: none;
	padding: 0;
	margin-left: 0;
}

.comments-rating label {
	display: inline-block;
}

.rating-container {
	font-size: 0;
	display: flex;
	justify-content: flex-end;
	flex-direction: row-reverse;
}

.rating-container * {
	font-size: 1.4rem;
}

.rating-container > input {
	display: none;
}

.rating-container > input + label {
	/* only enough room for the star */
	font-family: 'dashicons' !important ;
	display: inline-block;
	overflow: hidden;
	text-indent: 9999px;
	width: 1em;
	white-space: nowrap;
	cursor: pointer;
	margin: 0;
}

.rating-container > input + label:before {
	display: inline-block;
	text-indent: -9999px;
	content: "\f154";
	color: #888;
}

.rating-container > input:checked ~ label:before,
.rating-container > input + label:hover ~ label:before,
.rating-container > input + label:hover:before {
	content: "\f155";
	color: #e52;
	text-shadow: 0 0 1px #333;
}

.rating-container > .star-cb-clear + label {
	text-indent: -9999px;
	width: .5em;
	margin-left: -.5em;
}

.rating-container > .star-cb-clear + label:before {
	width: .5em;
}

.rating-container:hover > input + label:before {
	content: "\f154";
	color: #888;
	text-shadow: none;
}

.rating-container:hover > input + label:hover ~ label:before,
.rating-container:hover > input + label:hover:before {
	content: "\f155";
	color: #e52;
	text-shadow: 0 0 1px #333;
}

.comment-respond .rating-container > .star-cb-clear + label, .comment-respond .rating-container > input + label:before {
	text-indent: 9999px;
}

.comment-respond .rating-container > input + label {
	text-indent: -9999px;
}

/* Progress Bar */


/* Conteneur du texte */
#text_content {
    position: relative !important;
    /* L'espace pour la scrollbar est réservé par scrollbar-gutter: stable
       (règle #text_content plus bas) ; padding uniforme de 2em. */
    padding: 2em;
    color: black;
    background: linear-gradient(to bottom, #fffcf6 50%, #fef7e9);
    border: 0.5px solid lightgray;
    height: 100%;
}


/* Wrapper pour positionner la barre de progression (désactivé — voir barre horizontale ci-dessous) */
.progress-wrapper {
    display: none !important;
}

/* Barre de progression verticale standard — remplacée par la barre horizontale */
.vertical-progress-container:not(.fullscreen-only) {
    display: none !important;
}

.vertical-progress-bar {
    width: 100%;
    height: 0%;
    background: #ff638e; /* Couleur rose du thème */
    position: absolute;
    top: 0;
    border-radius: 3px;
    transition: height 0.2s ease-out;
}

/* Barre de progression spécifique pour le mode plein écran */
.vertical-progress-container.fullscreen-only {
    display: none; /* Masquée par défaut */
}

/* Barre de progression horizontale — sous le reader */
.horizontal-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 0 0 4px 4px; /* arrondi uniquement en bas, suit le cadre reader */
    margin-top: 0;
    overflow: hidden;
}

.horizontal-progress-bar {
    height: 100%;
    width: 0%;
    background: #ff638e;
    border-radius: 0 0 4px 4px;
    transition: width 0.2s ease-out;
}

/* Styles spécifiques pour le mode plein écran */
:fullscreen #text_content,
:-webkit-full-screen #text_content,
:-moz-full-screen #text_content,
:-ms-fullscreen #text_content {
    /* La largeur exacte est appliquée en JS (lectures.js) pour reproduire
       précisément la largeur du mode normal et éviter un reflow du texte
       qui décalerait la progression de lecture enregistrée. */
    margin: 0 auto !important; /* Centrer le contenu */
    background-color: #fff9ee;
    color: #333;
    line-height: 1.6;
    padding: 20px 25px 20px 20px; /* Plus d'espace à droite pour la barre de progression */
    height: 100% !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}

/* Créer un conteneur plein écran personnalisé */
.fullscreen-container {
    display: none; /* Masqué par défaut */
    background-color: #1a1a1a !important;
}

:fullscreen .fullscreen-container,
:-webkit-full-screen .fullscreen-container,
:-moz-full-screen .fullscreen-container,
:-ms-fullscreen .fullscreen-container {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    background-color: #1a1a1a;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
}

/* Afficher la barre de progression spécifique au plein écran uniquement en mode plein écran */
:fullscreen .vertical-progress-container.fullscreen-only,
:-webkit-full-screen .vertical-progress-container.fullscreen-only,
:-moz-full-screen .vertical-progress-container.fullscreen-only,
:-ms-fullscreen .vertical-progress-container.fullscreen-only {
    display: block !important;
    position: fixed !important;
    top: 20px !important; /* Aligner avec le padding du texte */
    right: calc(20% - 6px) !important; /* Positionner à côté du contenu qui fait 60% */
    height: calc(100% - 40px) !important; /* Ajuster pour le padding */
    z-index: 9999 !important;
    width: 6px;
    opacity: 1 !important;
}

/* Scrollbar rose — toujours visible */

#text_content {
  overflow-y: scroll !important;
  scrollbar-gutter: stable;          /* réserve la place, évite le décalage */
  /* scrollbar-width: thin;   ← À SUPPRIMER : c'est lui qui force l'overlay et neutralise le style WebKit */
  scrollbar-color: rgb(255,99,142) rgb(252,232,238);  /* pour Firefox */
}
#text_content::-webkit-scrollbar       { width: 8px; background: rgb(252,232,238); }  /* 5px → 8px conseillé pour la visibilité */
#text_content::-webkit-scrollbar-track { background: rgb(252,232,238); border-radius: 0 4px 4px 0; }
#text_content::-webkit-scrollbar-thumb { background: rgb(255,99,142); border-radius: 3px; min-height: 30px; }
#text_content::-webkit-scrollbar-thumb:hover { background: rgb(224,80,122); }


/* Ajustements responsifs */
@media screen and (max-width: 768px) {
    .vertical-progress-container {
        width: 4px; /* Plus mince sur mobile */
    }
    
    .vertical-progress-container:hover {
        width: 6px;
    }
    
    #text_content {
        padding-right: 10px;
    }
    
    :fullscreen .vertical-progress-container.fullscreen-only,
    :-webkit-full-screen .vertical-progress-container.fullscreen-only,
    :-moz-full-screen .vertical-progress-container.fullscreen-only,
    :-ms-fullscreen .vertical-progress-container.fullscreen-only {
        right: 5% !important; /* Ajuster la position en fonction de la largeur */
    }
}

/* Boutons */

/* Styles pour un bouton plein écran amélioré */
#fullscreen-controls {
    display: flex;
    justify-content: flex-end;
    margin: 15px 0;
    position: absolute;
    top: 15px;       /* rapatrié du CSS inline du module */
    right: 15px;
    z-index: 5;
}

#enter_full_screen {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #ff638e;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#enter_full_screen:hover {
    background-color: #e14c77;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#enter_full_screen:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#enter_full_screen:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,99,142,0.3);
}

#enter_full_screen svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Style pour le mode sombre (optionnel) */
.dark-theme #enter_full_screen {
    background-color: #2c3e50;
    color: #f5f5f5;
}

.dark-theme #enter_full_screen:hover {
    background-color: #1a2530;
}

/* Styles pour l'état plein écran */
#exit_full_screen {
    position: fixed;
    top: 20px;
    right: 20px;
    display: none; /* Masqué par défaut */
    align-items: center;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #333;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 9999;
}

#exit_full_screen:hover {
    background-color: rgba(44, 44, 44, 0.95);
}

:fullscreen #exit_full_screen,
:-webkit-full-screen #exit_full_screen,
:-moz-full-screen #exit_full_screen,
:-ms-fullscreen #exit_full_screen {
    display: flex;
}

/* Animation de pulsation pour attirer l'attention (optionnel) */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

.add_to_list {
    display: inline-block;
    margin: 10px 0;
    padding: 8px 16px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add_to_list:hover {
    background-color: #f0f0f0;
}



.add-to-readlist-btn {
    display: inline-block;
    padding: 8px 12px;
    background-color: #ff638e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
}

.add-to-readlist-btn:hover {
    background-color: #d13c00;
}

.read-status-btn {
    display: inline-block;
    padding: 8px 12px;
    background-color: #ccc;
    color: #333;
    border: none;
    border-radius: 5px;
    cursor: default;
}

/* Styles pour réorganiser le contenu sur mobile */
@media screen and (max-width: 768px) {
    /* Convertir le conteneur parent en flex container */
    .site-content .ast-container {
        flex-direction: column;
        display: flex
;
    }
    
    /* Modifier l'ordre des éléments */
    #secondary {
        order: 1; /* Apparaît en premier */
    }

    #primary {
        order: 2; /* Apparaît en second */
    }
}

/* ============================================================
   RAPATRIÉ depuis le CSS inline du module (hook Astra)
   Règles structurelles / techniques de la page texte.
   La typographie des textes édités (p.Sc-ne, p.Personnage,
   didascalies, dialogues…) reste gérée dans le CSS inline du
   module, car elle s'enrichit au fil des imports.
   NB : ces règles ne s'appliquent désormais que sur les pages
   texte (single-text.css n'y est chargé que là).
   ============================================================ */

/* Comportement page texte — sélection désactivée (anti-copie) */
body {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none;     /* IE 10 / 11 */
    user-select: none;         /* Standard */
}

/* TODO: marqué « temporaire » à l'origine — à confirmer/retirer */
#ast-scroll-top {
    display: none !important;
}

.astra-advanced-hook-171333 {
    clear: both;
}

/* Layout / structure */
.single-text #secondary {
    padding-top: 150px;
}

.single_text_extra {
    margin: 10px 0 30px 0;
}

/* hérité V1 : le float est probablement à retirer en V2
   (#characters est une section pleine largeur) — à revoir */
div#characters {
    float: left;
    padding-right: 10px;
}

table.characters td {
    vertical-align: top;
    padding: 10px !important;
}

td.col-1-4,
td.col-1-2 {
    vertical-align: top;
}

/* Conteneur du reader — hauteur + contexte de positionnement */
div#text-container {
    position: relative;
    height: 60vh;
}

/* Bouton de formulaire compact */
a.small_form_button {
    border: 1px solid var(--color-texte) !important;
    text-transform: uppercase !important;
    font-size: 14px !important;
    letter-spacing: 0.5px !important;
    padding: 3px 15px;
    cursor: pointer;
    margin-right: 5px;
}

/* Paywall */
.paywall {
    padding: 25px;
    background-image: url(https://www.bibliotheatre.com/wp-content/uploads/2024/07/alfons-morales-YLSwjSy7stw-unsplash.jpg) !important;
    background-size: cover;
    box-shadow: inset 0 0 0 2000px rgb(255 99 142 / 56%);
}
.paywall-container {
    background: white;
    padding: 25px;
    text-align: center;
}

/* Fixes rendu du texte importé (Quark) */
#text_content span {
    font-size: 1rem !important;
    line-height: 1.6em !important;
}
#text_content div {
    white-space: normal !important;
}

/* Largeur de lecture sur grand écran */
@media (min-width: 1200px) {
    .single-text.ast-plain-container.ast-no-sidebar #primary {
        padding: 0 !important;
    }
    div#text_content {
        max-width: 60vw;
        margin: auto;
    }
}

/* Empêcher l'impression (anti-copie) */
@media print {
    html,
    body {
        display: none;
    }
}

