/* export.css — diaporama construit à partir d'un export org-mode */

:root {
    --fs: 24px;            /* taille du texte de la diapo (ajustée par export.js, 30 px max) */
    --plan-w: 260px;       /* largeur de l'arbre des titres du chapitre */
    --mu-taille: 58px;     /* taille de la lettre μ du logo */
    --noir: #111;
    --accent: #f2b134;
    --bleu: #1b4f8a;
    --gris-clair: #f3f3f1;
    --gris-bord: #d5d5d0;
}

*, *::before, *::after { box-sizing: border-box; }


html, body {
    height: 100%; margin: 0;
}

body.diapo-actif { overflow: hidden; }

body {
    font-family: "Segoe UI", "DejaVu Sans", "Liberation Sans", Arial, sans-serif;
    color: #1d1d1d;
    background: #fff;
}

/* ---------- Structure générale ---------- */

#diapo {
    height: 100vh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
}

#zone {
    display: flex;
    min-height: 0;
}

footer#pied:empty { display: none; }

/* ---------- nav ---------- */

#barre {
    display: flex;
    align-items: stretch;
    gap: 6px;
    padding: 0 10px;
    background: #222;
    color: #fff;
}

#barre { min-height: 66px; }   /* environ +50 % */

#barre button {
    font: inherit;
    color: #ddd;
    background: transparent;
    border: 0;
    cursor: pointer;
}

#barre .outil {
    padding: 6px 10px;
    font-size: 18px;
    align-self: center;
    border-radius: 4px;
}
#barre .outil:hover { background: #444; color: #fff; }

#menu-chapitres {
    flex: 1;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: thin;
}

#menu-chapitres button {
    display: flex;
    align-items: center;
    /* padding: 0 20px; */
    padding: 0 30px;
    font-size: 17px;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

#menu-chapitres button:hover { color: #fff; background: #333; }

/* #menu-chapitres button.actif { */
/*     color: #fff; */
/*     border-bottom-color: var(--accent); */
/* } */

#menu-chapitres button.actif {
  color: #111;
  background: var(--accent);   /* fond doré plein */
  font-weight: 700;
  border-bottom-color: #fff;
}

#menu-chapitres button.deux-lignes {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1px;
  font-size: 14px;          /* réduit pour que les deux lignes tiennent dans la hauteur de nav */
  line-height: 1.2;
  text-align: center;
}
#menu-chapitres button.deux-lignes span {
  display: block;
  white-space: nowrap;
}

#horloge {
    align-self: center;
    padding-left: 10px;
    font-size: 20px;
    font-variant-numeric: tabular-nums;
    color: #ddd;
}

/* ---------- header ---------- */

/* #entete { */
/*     display: flex; */
/*     align-items: center; */
/*     gap: 14px; */
/*     padding: 6px 16px; */
/*     border-bottom: 1px solid var(--gris-bord); */
/*     background: #fff; */
/* } */

#entete {
  display: grid;
  /*grid-template-columns: 1fr minmax(0, 3fr) 1fr;*/   /* colonne centrale réellement centrée */
  grid-template-columns: 1fr auto 1fr;   /* le titre prend sa largeur naturelle, centré */
  align-items: center;
  gap: 14px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--gris-bord);
  background: #fff;
}
#entete .logo { justify-self: start; }
#compteur { justify-self: end; }

.logo {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* fontes à empattement calligraphique, disponibles localement (Ubuntu : fonts-urw-base35) */
    font-family: "Palatino Linotype", "Palatino", "URW Palladio L", "P052",
                 "Book Antiqua", "Georgia", serif;
    font-style: italic;
    font-weight: 700;
    font-size: var(--mu-taille);
    line-height: 1;
    user-select: none;
}

/* .logo .mu { transform: translateY(-4px); } */
.logo .mu { transform: translateY(-11px); }   /* était -4px */

/* #titre-chapitre { */
/*     flex: 1; */
/*     margin: 0; */
/*     font-size: 22px; */
/*     font-weight: 600; */
/*     color: var(--bleu); */
/*     white-space: nowrap; */
/*     overflow: hidden; */
/*     text-overflow: ellipsis; */
/* } */

#titre-chapitre {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  text-align: center;
  color: var(--bleu);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#compteur {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    color: #555;
}

/* ---------- aside : arbre des titres du chapitre ---------- */

#plan {
    flex: none;
    width: var(--plan-w);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
    background: var(--gris-clair);
    border-right: 1px solid var(--gris-bord);
    font-size: 15px;
    transition: width .2s ease;
}
#plan.replie {
    width: 0;
    padding: 0;
    border-right: 0;
}

#plan ul { list-style: none; margin: 0; padding: 0; }

#plan button {
    display: block;
    width: 100%;
    font: inherit;
    text-align: left;
    color: #333;
    background: transparent;
    border: 0;
    border-left: 4px solid transparent;
    padding: 5px 12px;
    cursor: pointer;
}
#plan button:hover { background: #e6e6e2; }
#plan button.actif {
    background: #e0e8f3;
    border-left-color: var(--bleu);
    font-weight: 600;
}

/* ---------- main : diapositive ---------- */

#principal {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    padding: 14px 26px;
    overflow: hidden;
}

.diapo {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    gap: 24px;
    font-size: var(--fs);   /* 30 px maximum : voir FS_MAX dans export.js */
    /* line-height: 1.35; */
    line-height: var(--lh, 1.35);
}

.colonne {
    min-width: 0;
    max-height: 100%;
    overflow: auto;
}

.titre-diapo {
    margin: 0 0 .6em;
    font-size: min(30px, calc(var(--fs) * 1.2));
    font-weight: 700;
    color: var(--bleu);
}

.corps :is(h1, h2, h3, h4, h5, h6) { font-size: inherit; }
/* .corps p { margin: .4em 0; } */
.corps p { margin: 1em 0; }
.corps ul, .corps ol { margin: .4em 0; padding-left: 1.3em; }
.corps li { margin: .2em 0; }
.corps pre {
    font-size: .8em;
    white-space: pre-wrap;
    background: #f4f4f2;
    padding: .5em .7em;
    border-radius: 4px;
}
.corps code { font-size: .9em; }
.corps table { border-collapse: collapse; }
.corps th, .corps td { border: 1px solid #bbb; padding: .15em .5em; }
.corps img { max-width: 100%; max-height: 40vh; }

.underline { text-decoration: underline; }
.org-center, .center { text-align: center; }
.org-right, .right { text-align: right; }
.org-left, .left { text-align: left; }

/* texte seul : centré */
.diapo.texte {
    align-items: center;
    justify-content: center;
}
.diapo.texte .colonne {
    width: 100%;
    max-width: 1200px;
}

/* image seule : centrée ; la taille des figures est fixée par export.js */
.diapo.image {
    align-items: center;
    justify-content: center;
}
.diapo.image > figure { flex: none; }

/* figure = image (éventuellement liée) + légende de même largeur que l'image */
figure.vignette-fig {
    margin: 0;
    min-width: 0;
}
figure.vignette-fig > a { display: block; cursor: pointer; }
figure.vignette-fig img {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    max-height: none;
}
figure.vignette-fig figcaption {
    padding-top: 6px;
    font-size: 16px;
    font-style: italic;
    line-height: 1.3;
    text-align: left;          /* alignée à gauche de l'image */
    overflow-wrap: anywhere;   /* passe à la ligne, même pour un mot très long */
    color: #555;
}

/* image + texte : deux colonnes ; largeur de l'aside fixée par export.js */
/* .diapo.mixte { align-items: stretch; } */

.diapo.mixte aside.vignette {
    flex: none;
    height: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

/* .diapo.mixte .colonne { */
/*     flex: 1; */
/*     align-self: center; */
/* } */

.diapo.mixte { gap: 0; }                      /* l'écart est géré par la colonne */

.diapo.mixte .colonne {
  padding: 0 24px 0 40px;                     /* haut, droite, bas, gauche */
}

/* diapo de transition : titre seul, grand et centré */
.diapo.transition {
    align-items: center;
    justify-content: center;
}
.titre-transition {
    max-width: 1100px;
    text-align: center;
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--bleu);
}

/* image affichée temporairement à la place du texte (clic) */
.diapo.mixte.zoom aside.vignette {
    flex: 1;
    width: auto !important;
    cursor: zoom-out;
}
.diapo.mixte.zoom .colonne { display: none; }


#titre-cours {
    align-self: center;
    padding: 0 30px; /* même espacement que les titres du menu */
    font-family: "Palatino Linotype", "Palatino", "URW Palladio L", "P052",
                 "Book Antiqua", "Georgia", serif;
    font-style: italic;
    font-weight: bold ;
    font-size: 30px;
    line-height: 1.6;
    letter-spacing: .08em;
    text-align: center;
    white-space: nowrap;
    color: #c8ad6e;                /* or atténué, cohérent avec le liseré doré du menu */
}
#titre-cours span { display: block; }

#champ-n {
    font: inherit;
    font-variant-numeric: tabular-nums;   /* après « font », qui le réinitialiserait */
    color: inherit;
    text-align: right;
    background: transparent;
    border: 0;
    border-bottom: 1px dashed #999;
    padding: 0 2px;
}
#champ-n:hover { background: #eef3fa; }
#champ-n:focus {
    outline: 0;
    background: #eef3fa;
    border-bottom: 2px solid var(--bleu);
}

#aide {
    position: fixed;
    inset: 0;
    z-index: 100;
    overflow-y: auto;
    padding: 56px 8vw 48px;
    background: #fff;
    cursor: zoom-out;
}

#aide a { cursor: pointer; }
#aide[hidden] { display: none; }

#aide .contenu-aide {
    max-width: 900px;
    margin: 0 auto;
    font-size: 20px;
    line-height: 1.6;
}
#aide .contenu-aide h2 {
    font-size: 30px;
    color: var(--bleu);
    margin: 0 0 .8em;
}

#fermer-aide {
    position: fixed;
    top: 12px;
    right: 18px;
    font: inherit;
    font-size: 22px;
    color: #333;
    background: #eee;
    border: 0;
    border-radius: 4px;
    padding: 4px 12px;
    cursor: pointer;
}

#fermer-aide:hover { background: #ddd; }
