/* PAO.css - Styles des blocs de composition des chapitres. */
:root {
    --pao-texte: #252321;
    --pao-fond1: #e3c4b1;
    --pao-fond2: #f3ebe5;
    --pao-barre: #dfbea8;
    --pao-trait: #dfbea8;
    --pao-lien: #7c4b34;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--pao-texte); font: 400 17px/1.62 Arial, Helvetica, sans-serif; }
.chapitre { padding: 48px 0 96px; }
.chapitre-contenu, .chapitre-nav { width: 80%; margin-left: auto; margin-right: auto; }
.chapitre-contenu { min-width: 0; }
/* La bannière suit le même couloir (80 %) que les briques PAO. */
.chapitre-banniere { width: 80%; margin-left: auto; margin-right: auto; line-height: 0; }
.chapitre-banniere .banniere-chapitre { width: 100% !important; }
.chapitre-banniere img { display: block; width: 100% !important; max-width: 100% !important; height: auto !important; }
a { color: var(--pao-lien); text-underline-offset: 0.15em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* Le sous-menu n'existe que si le dossier contient plusieurs TXT. */
.chapitre-nav { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0; margin-bottom: 38px; }
.chapitre-nav a { display: inline-block; text-decoration: none; padding: 0 14px; border-right: 1px solid #86817e; color: var(--pao-texte); font-size: 0.95rem; line-height: 1.3; }
.chapitre-nav a:last-child { border-right: 0; }
.chapitre-nav a[aria-current="page"] { font-weight: 700; }
.chapitre-nav a:hover, .chapitre-nav a:focus-visible { text-decoration: underline; }

/* Niveaux de lecture */
.pao-titre { margin: 0 0 13px; font: 700 clamp(1.8rem, 3vw, 3.2rem)/1.18 Arial, Helvetica, sans-serif; }
.pao-surtitre { margin: 0 0 26px; font: 400 clamp(1.05rem, 1.6vw, 1.32rem)/1.3 Arial, Helvetica, sans-serif; }
.pao-paragraphe, .pao-deux-colonnes, .pao-tabule, .pao-photo, .pao-duo, .pao-nota { margin: 0 0 25px; }

/* Paragraphes en deux colonnes ; le texte circule tout seul. */
.pao-deux-colonnes { column-count: 2; column-gap: 40px; column-rule: 1px solid #b0aaa5; }
.pao-deux-colonnes p { break-inside: avoid; }

/* Photos : toujours largeur disponible, hauteur AUTOMATIQUE, jamais de recadrage. */
.pao-photo, .pao-duo__photo { padding: 0; border: 0; }
.pao-photo img, .pao-duo__photo img { display: block; width: 100%; height: auto; max-height: none; object-fit: contain; }
.pao-image-manquante { border: 1px dashed #b8a99e; background: #faf6f3; padding: 24px; font: 0.86rem/1.5 Arial, sans-serif; color: #756254; }

/* Duo image et aparté, ordre defini par le TXT. */
.pao-duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); align-items: start; gap: 28px; }
.pao-duo--inverse { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.pao-duo__photo { margin: 0; min-width: 0; }
.pao-aparte { min-width: 0; display: flex; gap: 8px; padding: 0; margin: 28px 0 0; font: italic clamp(1.12rem, 1.7vw, 1.7rem)/1.25 Georgia, 'Times New Roman', serif; }
.pao-aparte::before { content: '“'; flex: 0 0 auto; margin-top: -0.15em; font: 700 clamp(5.2rem, 8vw, 8.7rem)/0.92 Georgia, serif; }
.pao-aparte p { margin: 0; }

/* Petites annotations et paragraphe ponctue d'un gros trait vertical. */
.pao-legende { margin: -12px 0 26px; font-size: 0.8rem; color: #5b5753; }
.pao-nota { font-size: 0.9rem; font-style: italic; margin-top: 8px; }
.pao-tabule { border-left: 18px solid var(--pao-barre); padding: 1px 0 1px 18px; }
.pao-trait { background: var(--pao-trait); height: 8px; width: 18%; margin: 30px auto; }

/* Fonds regroupant autant de briques qu'on veut. */
.pao-fond { padding: clamp(16px, 2.2vw, 34px); margin: 30px 0; }
.pao-fond--1 { background: var(--pao-fond1); }
.pao-fond--2 { background: var(--pao-fond2); }
.pao-fond > :last-child { margin-bottom: 0; }

@media (max-width: 700px) {
    body { font-size: 16px; line-height: 1.55; }
    .chapitre { padding: 24px 0 60px; }
    .chapitre-contenu, .chapitre-nav, .chapitre-banniere { width: calc(100% - 32px); }
    .chapitre-nav { margin-bottom: 28px; row-gap: 8px; }
    .chapitre-nav a { font-size: 0.9rem; padding: 0 10px; }
    .pao-deux-colonnes { column-count: 1; column-rule: 0; }
    .pao-duo, .pao-duo--inverse { display: flex; flex-direction: column; gap: 12px; }
    .pao-duo__photo { width: 100%; }
    .pao-duo--inverse .pao-duo__photo { order: 1; }
    .pao-duo--inverse .pao-aparte { order: 2; }
    .pao-aparte { font-size: 1.25rem; margin-top: 14px; }
    .pao-aparte::before { font-size: 5.6rem; }
    .pao-tabule { border-left-width: 12px; padding-left: 14px; }
    .pao-trait { width: 28%; }
}

/* Sous-menu facultatif [MENU] : reutilise le style du menu principal du chapitre. */
.chapitre-contenu .chapitre-nav { width: 100%; margin-top: 38px; margin-bottom: 0; }

/* Couleurs de page facultatives : sans directives TXT, rendu identique. */
.chapitre {
    background-color: var(--pao-page-background, transparent);
    color: var(--pao-page-text, inherit);
}
.chapitre .chapitre-nav a { color: var(--pao-page-text, var(--pao-texte)); }
.chapitre .pao-legende { color: var(--pao-page-text, #5b5753); }
.chapitre .chapitre-contenu a { color: var(--pao-page-link, var(--pao-lien)); }
.chapitre .chapitre-nav a { color: var(--pao-page-text, var(--pao-texte)); }

/* Brique [VIDEO] : lecteur natif, silencieux tant que l'utilisateur ne clique pas. */
.pao-video { margin: 0 0 25px; padding: 0; border: 0; }
.pao-video video { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: contain; background: #000; }
.pao-video-manquante { border: 1px dashed #b8a99e; background: #faf6f3; padding: 24px; font: 0.86rem/1.5 Arial, sans-serif; color: #756254; margin: 0 0 25px; }
