/* Conteneur de titre */
.analyse_titre {
    text-align: center;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
}

/* Bloc latéral fixe (sommaire) */
.bloc1 {
    position: fixed;
    top: 140px;
    left: 0;
    width: 300px;
    padding: 20px;
    margin: 10px;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px #aaa;
    box-sizing: border-box;
}

.bloc1 div {
    margin-bottom: 12px;
}

/* Bloc de contenu principal */
.bloc2 {
    position: fixed;
    top: 140px;
    left: 330px;
    right: 0;
    bottom: 10px;
    padding: 20px;
    margin: 10px;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px #aaa;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: calc(100vh - 150px);
}

/* Niveaux de rubrique */
.sous-rubrique {
    text-indent: 20px;
}

.sous-sous-rubrique {
    text-indent: 40px;
}

/* Styles des titres */
.Titre_principal {
    font-family: 'EB Garamond';
    text-align: center;
    margin-top: 5px;
    width: 100%;
}

.Titre_volume {
    font-size: 25px;
}

/* Encarts bibliographiques */
.biblio_0,
.biblio_1,
.biblio_2 {
    margin-left: 20px;
    text-align: left;
}

.biblio_2 {
    margin-left: 33px;
}

/* Présentation dossiers ou volumes */
.Presentation_dossier_prepa {
    font-family: 'EB Garamond', serif;
    font-size: 16px;
    margin: 0 auto 15px auto;
    max-width: 900px;
    text-align: center;
    line-height: 1.5;
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0d5c1;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    flex-shrink: 0;
}
.Presentation_dossier_prepa p { margin: 0; }

/* Général */
.text-left {
    text-align: left !important;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

/* =========================================================
   MISE EN PAGE "APPLICATION" (Analyses & Transcriptions)
   ========================================================= */

/* Active le comportement "Application" sans scroll global */
body.page-application {
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    /* box-sizing force la hauteur 100vh à inclure le padding-top du menu_global.css */
    box-sizing: border-box; 
    background-color: #f4f4f9;
}

/* Les titres dans les pages application ne doivent pas s'écraser */
body.page-application .Titre_Tableau, 
body.page-application .Titre_principal {
    margin: 15px 0;
    flex-shrink: 0; 
}

/* Conteneur principal (prend tout l'espace restant sous le titre/présentation) */
body.page-application .layout-container {
    display: flex;
    align-items: stretch;
    width: 100%;
    margin: 0 0 20px 0;
    padding: 0;
    gap: 20px;
    flex: 1; /* Absorbe toute la hauteur restante automatiquement */
    min-height: 0; /* Crucial : autorise le scroll interne des enfants */
    box-sizing: border-box;
}

/* ---------------------------------------------------------
   COLONNE DE GAUCHE : SOMMAIRE / NAVIGATION
   --------------------------------------------------------- */
body.page-application .sidebar {
    flex: 0 0 320px; /* Largeur fixe */
    height: 100%;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid rgba(224, 213, 193, 0.8);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    box-sizing: border-box;
}
.sidebar a { text-decoration: none; color: #1A2530; display: block; padding: 4px 0; transition: color 0.2s; }
.sidebar a:hover { color: #005599; font-weight: bold; }
.sidebar details { margin-bottom: 5px; }
.sidebar summary { font-weight: bold; cursor: pointer; padding: 5px 0; color: #1A2530; font-family: 'EB Garamond', serif; font-size: 18px; transition: color 0.3s ease; }
.sidebar summary:hover { color: #005599; }

/* Sous-dossiers spécifiques à la Transcription (Folios) */
.sidebar details details { margin-top: 8px; margin-left: 10px; margin-bottom: 8px; }
.sidebar details details summary { background-color: #f8f9fa; border: 1px solid #e0d5c1; font-size: 15px; padding: 8px 12px; border-radius: 4px; font-family: 'Arial', sans-serif;}
.sidebar details details summary:hover { background-color: #e0d5c1; color: #1A2530; }

.folio-list { list-style: none; padding: 0; margin: 10px 0 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.folio-link { display: block; padding: 8px 4px; background-color: #f8f9fa; color: #1A2530; text-decoration: none; border: 1px solid #e0d5c1; border-radius: 4px; font-size: 13px; text-align: center; transition: all 0.2s ease; }
.folio-link:hover, .folio-link.active { background-color: #1A2530; color: #F8F5F0; font-weight: bold; border-color: #1A2530; }

/* ---------------------------------------------------------
   COLONNE DE DROITE : CONTENU (TEXTE D'ANALYSE)
   --------------------------------------------------------- */
.content-area {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: #ffffff;
    border: 1px solid rgba(224, 213, 193, 0.8);
    border-radius: 8px;
    padding: 30px 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    line-height: 1.6;
    font-size: 16px;
    color: #333;
    box-sizing: border-box;
}
.content-area h2, .content-area h3, .content-area h4 { font-family: 'EB Garamond', serif; color: #1A2530; }
.content-area h2 { border-bottom: 2px solid #e0d5c1; padding-bottom: 5px; scroll-margin-top: 20px; }
.content-area h3 { scroll-margin-top: 20px; margin-top: 30px; }
.content-area h4 { scroll-margin-top: 20px; }

/* ---------------------------------------------------------
   COLONNE DE DROITE : LECTEUR PDF (TRANSCRIPTION)
   --------------------------------------------------------- */
.content-viewer {
    flex: 1;
    height: 100%;
    overflow-y: auto; /* Active le défilement naturel de la colonne */
    overflow-x: hidden; /* Empêche l'apparition de l'ascenseur horizontal indésirable */
    background: transparent;
    box-sizing: border-box;
    padding-bottom: 20px; /* Un peu d'air en bas */
}
.content-viewer iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 297 / 210; /* Format Paysage (car le PDF contient le manuscrit à gauche et le texte à droite) */
    background: #fff;
    display: block;
    border: 1px solid rgba(224, 213, 193, 0.8);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    box-sizing: border-box; /* Force la bordure à s'intégrer dans les 100% de largeur */
}