/* Importation des polices Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;700&family=Cormorant+Garamond:ital,wght@1,400;1,700&display=swap');
/* Polices utilisées : Cormorant Garamond (Corps de texte) & Inter (Titres) */

/* Règles générales pour l'ensemble du site */
body {
    background-color: #202020; /* Fond noir */
    color: #F2F2F2; /* Texte blanc/gris clair */
    font-family: 'Cormorant Garamond', serif; 
    font-style: italic; 
    
    /* AJUSTEMENT 1 : Augmentation de l'interlettrage pour aérer */
    letter-spacing: 0.03em; /* Augmenté de 0.02em à 0.03em pour plus d'air */
    
    margin: 0;
    padding: 0;
    font-size: 18px; /* Corps de texte à 18px */
}

/* Styles pour les titres (Inter) */
h1, h2, h3, h4, .title-montserrat {
    font-family: 'Inter', sans-serif; 
    font-weight: 500; /* Poids 500 (Medium) pour un look plus fin et élégant */
    color: #F2F2F2;
    font-style: normal; /* Force les titres à rester droits pour contraster */
    
    /* AJUSTEMENT 2 : Réduction de l'interlettrage pour resserrer */
    letter-spacing: 0.05em; /* Réduit de 0.08em à 0.05em pour un aspect plus compact */
 /* text-transform: uppercase; */
}

/* Vous pouvez cibler spécifiquement les h1 pour qu'ils restent bien visibles si besoin */
h1 {
    font-weight: 700; /* On garde le 700 (Bold) pour H1 pour une hiérarchie claire */
    font-size: 1.1em; /* Réduit à 27px */ 
}
h2 {
    font-size: 0.9em; /* Réduit à 21.6px */ 
}
h4 {
    font-size: 0.75em; /* Défini à 18px (taille du corps) */
    margin-top: 30px;
    margin-bottom: 5px;
}
/* Fin des ajustements de taille */


/* Conteneur principal du contenu textuel */
.content-wrapper {
    max-width: 900px; 
    margin: 40px auto; 
    padding: 0 20px; 
    line-height: 1.6;
    text-align: justify; 
}

/* Styles pour les paragraphes, y compris pour simuler des listes */
p, .list-item {
    margin-bottom: 0.8em; 
}

/* Règle spécifique pour les VRAIS PARAGRAPHES (qui n'ont pas la classe .list-item) et le DERNIER élément de liste */
p:not(.list-item), 
.list-item:last-of-type {
    margin-bottom: 2em; 
}

/* Correction pour les cas où plusieurs list-item sont consécutifs */
.list-item + .list-item {
    margin-top: 0; 
}

.list-item {
    margin-left: 20px;
    text-indent: -10px; 
}
.list-item::before {
    content: "• ";
}
.list-item {
    margin-left: 20px;
    text-indent: -10px; 
}
.list-item::before {
    content: "• ";
}

/* --- GESTION DES IMAGES BANDEAU RESPONSIVE --- */

/* Conteneur pour le bandeau */
.banner-container {
    width: 100%;
    height: 500px; 
    overflow: hidden;
    position: relative;
}

/* Style de base pour les images */
.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: none; 
}

/* 1. Configuration pour les grands écrans (Desktop) */
.banner-image.desktop {
    display: block; 
}
.banner-image.mobile {
    display: none; 
}

/* 2. MEDIA QUERY pour les petits écrans (Mobile) */
@media screen and (max-width: 768px) {
    
    /* Change la hauteur pour le format mobile */
    .banner-container {
        height: 60vh; 
    }

    /* Inversion de l'affichage */
    .banner-image.desktop {
        display: none; 
    }
    .banner-image.mobile {
        display: block; 
    }
    
    /* Ajustement de l'interlettrage sur mobile */
    body {
        letter-spacing: 0.02em; /* Légère augmentation pour l'aération */
    }
    h1, h2, h3, h4, .title-montserrat {
        letter-spacing: 0.03em; /* Encore plus resserré que le bureau */
    }
}

/* Style du lien dans le texte (pour la navigation) */
a {
    color: #F2F2F2; 
    text-decoration: underline; 
    cursor: pointer;
    font-weight: 700;
    font-style: normal; 
    letter-spacing: normal; /* Les liens ne doivent pas être sur-espacés */
}
a:hover {
    color: grey;
}

/* Nouvelle classe pour indenter le contenu des sections */
.indented-section {
    padding-left: 30px; 
    /* Assure que la justification fonctionne à l'intérieur de la section */
    text-align: justify; 
}

/* Ajustement pour que l'indentation soit réduite sur mobile */
@media screen and (max-width: 768px) {
    .indented-section {
        padding-left: 15px; 
    }
}

/* Cache l'élément visuellement mais le maintient pour les lecteurs d'écran et le SEO */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Sélecteur de langue FR / EN */
.language-switch {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 20;
    display: flex;
    gap: 8px;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-style: normal;
    letter-spacing: normal;
}
.language-switch a {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid rgba(242, 242, 242, 0.65);
    border-radius: 3px;
    background: rgba(32, 32, 32, 0.72);
    color: #F2F2F2;
    text-decoration: none;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
}
.language-switch a:hover,
.language-switch a.active {
    background: rgba(123, 17, 19, 0.92);
    border-color: #d4af37;
    color: #fff;
}

/* Bouton de lecture des extraits */
.bouton-theatre {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-style: normal;
    letter-spacing: 0.5px;
    color: #fff !important;
    background-color: #7b1113;
    padding: 6px 14px;
    text-decoration: none;
    border: 1px solid #d4af37;
    border-radius: 2px;
    transition: all 0.3s ease;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.15);
}
.bouton-theatre:hover {
    background-color: #5a090b;
    border-color: #fff;
    transform: translateY(-1px);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.25);
}

@media screen and (max-width: 768px) {
    .language-switch {
        top: 10px;
        right: 10px;
        gap: 6px;
    }
    .language-switch a {
        padding: 5px 8px;
        font-size: 11px;
    }
}

/* --- PAGE DE LECTURE DES EXTRAITS --- */
.excerpt-reader-body {
    background: #171717;
    overflow-x: hidden;
}

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 60;
    background: rgba(255, 255, 255, 0.08);
}

.reading-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: #d4af37;
}

.excerpt-toolbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 12px max(18px, calc((100vw - 980px) / 2));
    padding-top: max(12px, env(safe-area-inset-top));
    background: rgba(23, 23, 23, 0.96);
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-size: 13px;
}

.excerpt-toolbar a {
    text-decoration: none;
}

.excerpt-reader {
    max-width: 980px;
    margin: 0 auto;
    padding: 44px 24px 70px;
}

.excerpt-reader-header {
    text-align: center;
    margin: 0 auto 42px;
}

.excerpt-reader-header h1 {
    margin: 4px 0 5px;
    font-size: clamp(30px, 5vw, 48px);
}

.excerpt-reader-header p {
    margin: 0.35em 0;
}

.excerpt-kicker {
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #d4af37;
}

.excerpt-reader-note {
    margin-top: 20px !important;
    font-size: 16px;
    color: rgba(242, 242, 242, 0.78);
}

.orientation-hint {
    display: none;
}

.script-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 34px;
}

.script-page {
    width: min(100%, 900px);
    margin: 0;
    background: #fff;
    line-height: 0;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
}

.script-page img {
    display: block;
    width: 100%;
    height: auto;
}

.excerpt-reader-footer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 44px;
    text-align: center;
}

@media screen and (max-width: 768px) {
    .excerpt-toolbar {
        padding-right: max(12px, env(safe-area-inset-right));
        padding-left: max(12px, env(safe-area-inset-left));
        gap: 12px;
        font-size: 11px;
    }

    .excerpt-toolbar a:first-child {
        max-width: 68%;
    }

    .excerpt-reader {
        padding: 32px 8px 50px;
    }

    .excerpt-reader-header {
        padding: 0 12px;
        margin-bottom: 28px;
    }

    .script-pages {
        gap: 16px;
    }

    .script-page {
        width: 100%;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.42);
    }
}

/* On small phones in portrait mode, explicitly invite landscape reading. */
@media screen and (max-width: 540px) and (orientation: portrait) {
    .orientation-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        max-width: 360px;
        margin: 20px auto 0;
        padding: 11px 13px;
        border: 1px solid rgba(212, 175, 55, 0.55);
        border-radius: 8px;
        background: rgba(212, 175, 55, 0.08);
        color: rgba(255, 255, 255, 0.92);
        font-family: 'Inter', sans-serif;
        font-style: normal;
        font-size: 13px;
        line-height: 1.35;
    }

    .orientation-hint-icon {
        flex: 0 0 auto;
        font-size: 25px;
        color: #d4af37;
    }
}

/* Landscape phone: maximize the manuscript width, like a 16:9 video view. */
@media screen and (max-height: 540px) and (orientation: landscape) {
    .excerpt-toolbar {
        padding-top: max(7px, env(safe-area-inset-top));
        padding-bottom: 7px;
        font-size: 11px;
    }

    .excerpt-reader {
        max-width: none;
        padding: 14px max(4px, env(safe-area-inset-right)) 34px max(4px, env(safe-area-inset-left));
    }

    .excerpt-reader-header {
        margin-bottom: 16px;
    }

    .excerpt-reader-header h1 {
        font-size: 27px;
    }

    .excerpt-reader-note {
        display: none;
    }

    .script-pages {
        gap: 12px;
    }

    .script-page {
        width: 100%;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    }
}


/* --- CORRECTION IPHONE : centrage et largeur garantie des pages de lecture --- */
.excerpt-reader-body,
.excerpt-reader-body * {
    box-sizing: border-box;
}

.excerpt-reader-body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow-x: hidden;
    text-align: center;
}

.excerpt-toolbar {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
}

.excerpt-reader,
.excerpt-reader-header,
.script-pages,
.script-page {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.excerpt-reader {
    max-width: 980px;
}

.script-pages {
    align-items: center;
}

.script-page {
    max-width: 900px;
    overflow: hidden;
}

.script-page img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}

.orientation-hint,
.excerpt-reader-note,
.excerpt-reader-footer {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

@media screen and (max-width: 768px) {
    .excerpt-reader {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .script-page {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}

@media screen and (max-height: 540px) and (orientation: landscape) {
    .excerpt-reader {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .script-page {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}
