/* =================================================================
   Diaporama — une diapositive par écran
   Les tailles sont exprimées en vw/vh : le texte occupe l'écran,
   qu'il s'agisse d'un vidéoprojecteur ou d'un téléphone.
   ================================================================= */

.page-diaporama {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--papier);
}

/* ---------------------------- scène ----------------------------- */

.scene {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vh, 4rem) clamp(1.5rem, 6vw, 6rem) clamp(5rem, 10vh, 7rem);
  outline: none;
}

.diapo {
  width: 100%;
  max-width: 58rem;
  animation: apparition 0.18s ease-out;
}

@keyframes apparition {
  from { opacity: 0; }
  to { opacity: 1; }
}

.diapo__etiquette {
  font-family: var(--sans);
  font-size: clamp(0.7rem, 1.3vw, 0.95rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 clamp(0.6rem, 1.5vh, 1.2rem);
}

.diapo__titre {
  font-size: clamp(1.5rem, min(4.2vw, 5.8vh), 3.6rem);
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 clamp(1rem, 3vh, 2rem);
}

.diapo__chapeau {
  font-size: clamp(0.95rem, min(2.1vw, 2.75vh), 1.7rem);
  color: var(--encre-douce);
  margin: 0 0 clamp(1rem, 2.5vh, 1.8rem);
}

.diapo__note {
  font-family: var(--sans);
  font-size: clamp(0.85rem, 1.5vw, 1.2rem);
  color: var(--encre-douce);
  margin: clamp(1.2rem, 3vh, 2rem) 0 0;
  padding-top: clamp(0.6rem, 1.5vh, 1rem);
  border-top: 1px solid var(--filet);
}

.diapo em { font-style: italic; }
.diapo .vedette { color: var(--accent); font-weight: 600; font-style: normal; }

/* ------------------------ diapo de titre ------------------------ */

.diapo--titre { text-align: center; }
.diapo--titre .diapo__titre {
  font-size: clamp(2rem, min(6vw, 8vh), 5rem);
  margin-bottom: clamp(1rem, 2.5vh, 1.6rem);
}
.diapo--titre .diapo__sous-titre {
  font-family: var(--sans);
  font-size: clamp(0.95rem, 1.9vw, 1.5rem);
  letter-spacing: 0.06em;
  color: var(--encre-douce);
  margin: 0;
}
.diapo--titre::after {
  content: "";
  display: block;
  width: 4rem;
  height: 3px;
  background: var(--accent);
  margin: clamp(1.5rem, 4vh, 2.5rem) auto 0;
}

/* ----------------------- diapo de partie ------------------------ */

.diapo--partie { text-align: center; }
.diapo--partie .diapo__numero {
  font-family: var(--sans);
  font-size: clamp(2.6rem, min(9vw, 11.1vh), 7rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent-clair);
  margin: 0 0 -0.15em;
}
.diapo--partie .diapo__titre { font-size: clamp(1.8rem, min(5.2vw, 6.7vh), 4.2rem); }
.diapo--partie .diapo__sous-titre {
  font-family: var(--sans);
  font-size: clamp(0.95rem, 1.8vw, 1.4rem);
  color: var(--encre-douce);
  margin: 0;
}

/* -------------------------- diapo règle ------------------------- */

.diapo--regle { border-left: 4px solid var(--accent); padding-left: clamp(1.2rem, 3vw, 2.5rem); }

.diapo__enonce {
  font-size: clamp(1.1rem, min(2.9vw, 3.7vh), 2.3rem);
  line-height: 1.35;
  margin: 0 0 clamp(1.2rem, 3vh, 2rem);
  padding-bottom: clamp(0.8rem, 2vh, 1.4rem);
  border-bottom: 1px solid var(--filet);
}

.diapo__exemples { list-style: none; margin: 0; padding: 0; }
.diapo__exemples li {
  font-size: clamp(1rem, min(2.4vw, 3.05vh), 1.9rem);
  font-style: italic;
  line-height: 1.5;
  padding: 0.15em 0;
}

/* -------------------------- diapo liste ------------------------- */

.diapo__items { list-style: none; margin: 0; padding: 0; }
.diapo__items li {
  font-size: clamp(1rem, min(2.5vw, 3.2vh), 2rem);
  line-height: 1.45;
  padding: clamp(0.4rem, 1.2vh, 0.8rem) 0 clamp(0.4rem, 1.2vh, 0.8rem) clamp(1rem, 2vw, 1.6rem);
  border-left: 3px solid var(--filet);
  margin-bottom: clamp(0.4rem, 1.2vh, 0.9rem);
}
.diapo__items li:last-child { margin-bottom: 0; }

/* ------------------------- diapo tableau ------------------------ */

.diapo__tableau {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.95rem, min(2.2vw, 2.9vh), 1.8rem);
}
.diapo__tableau th {
  text-align: left;
  font-family: var(--sans);
  font-size: clamp(0.7rem, 1.2vw, 0.95rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--encre-douce);
  font-weight: 600;
  padding-bottom: 0.5em;
  border-bottom: 2px solid var(--filet-fort);
}
.diapo__tableau td {
  padding: clamp(0.2rem, 0.9vh, 0.5rem) 1.5rem clamp(0.2rem, 0.9vh, 0.5rem) 0;
  border-bottom: 1px solid var(--filet);
}
.diapo__tableau td:last-child { font-weight: 600; color: var(--accent); }

/* ----------------------- diapo comparaison ---------------------- */

/* Deux colonnes côte à côte : on laisse respirer davantage que du texte suivi. */
.diapo--comparaison, .diapo--image, .diapo--tableau { max-width: 70rem; }

.diapo__comparaison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}
.diapo__colonne { padding-top: 0.8rem; border-top: 3px solid var(--filet-fort); }
.diapo__colonne--non { border-top-color: var(--faux); }
.diapo__colonne--oui { border-top-color: var(--juste); }
.diapo__colonne-titre {
  font-family: var(--sans);
  font-size: clamp(0.72rem, 1.3vw, 1rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 clamp(0.6rem, 1.8vh, 1.2rem);
}
.diapo__colonne--non .diapo__colonne-titre { color: var(--faux); }
.diapo__colonne--oui .diapo__colonne-titre { color: var(--juste); }
.diapo__cas-phrase {
  font-size: clamp(0.95rem, min(2.2vw, 2.8vh), 1.75rem);
  font-style: italic;
  line-height: 1.4;
  margin: 0 0 0.4em;
}
.diapo__cas-commentaire {
  font-family: var(--sans);
  font-size: clamp(0.82rem, 1.4vw, 1.1rem);
  color: var(--encre-douce);
  margin: 0;
}

/* ------------------------ diapo question ------------------------ */

.diapo--question { text-align: center; }
.diapo__question-phrase {
  font-size: clamp(1.3rem, min(3.6vw, 4.8vh), 3rem);
  line-height: 1.3;
  margin: 0 0 clamp(1.2rem, 3.5vh, 2.5rem);
}
.diapo__trou {
  display: inline-block;
  min-width: 3.5em;
  border-bottom: 3px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.diapo__trou--vide { color: transparent; }

.diapo__verbe {
  font-family: var(--sans);
  font-size: clamp(0.8rem, 1.5vw, 1.15rem);
  color: var(--encre-douce);
  margin: -0.6em 0 clamp(1.2rem, 3vh, 2rem);
}

.diapo__reponse {
  border-top: 1px solid var(--filet);
  padding-top: clamp(1rem, 2.5vh, 1.6rem);
  max-width: 44rem;
  margin: 0 auto;
}
.diapo__reponse[hidden] { display: none; }
.diapo__explication {
  font-size: clamp(0.95rem, min(2vw, 2.45vh), 1.5rem);
  line-height: 1.45;
  margin: 0 0 0.6em;
}
.diapo__regle-citee {
  font-family: var(--sans);
  font-size: clamp(0.78rem, 1.4vw, 1.05rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--encre-douce);
  margin: 0;
}
.diapo__invite {
  font-family: var(--sans);
  font-size: clamp(0.8rem, 1.4vw, 1.05rem);
  color: var(--encre-douce);
  margin: clamp(1rem, 2.5vh, 1.6rem) 0 0;
}

/* -------------------------- diapo image ------------------------- */

.diapo--image { text-align: center; }
.diapo--image .diapo__titre {
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  margin-bottom: clamp(0.8rem, 2vh, 1.4rem);
}
.diapo__image {
  max-width: 100%;
  max-height: 62vh;
  height: auto;
  border: 1px solid var(--filet);
  background: #fff;
}
.diapo__legende {
  font-family: var(--sans);
  font-size: clamp(0.75rem, 1.3vw, 1rem);
  color: var(--encre-douce);
  margin: 0.8rem 0 0;
}

/* --------------------- zones de clic latérales ------------------ */

.zone-clic {
  position: fixed;
  top: 0;
  bottom: clamp(4.5rem, 9vh, 6rem);
  width: 15vw;
  max-width: 10rem;
  cursor: pointer;
  z-index: 5;
}
.zone-clic--avant { left: 0; }
.zone-clic--apres { right: 0; left: 15vw; width: auto; max-width: none; }

/* --------------------------- pilotage --------------------------- */

.pilotage {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem clamp(1rem, 3vw, 2rem);
  background: rgba(251, 250, 247, 0.94);
  border-top: 1px solid var(--filet);
  backdrop-filter: blur(6px);
}
.pilotage__espace { flex: 1; }

.pilotage__bouton {
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.45rem 0.7rem;
  min-width: 2.2rem;
  background: transparent;
  border: 1px solid var(--filet-fort);
  border-radius: 2px;
  color: var(--encre-douce);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pilotage__bouton:hover {
  background: var(--papier-creux);
  color: var(--encre);
  border-color: var(--encre-douce);
}
.pilotage__bouton:disabled { opacity: 0.3; cursor: default; }
.pilotage__bouton:disabled:hover { background: transparent; border-color: var(--filet-fort); }
.pilotage__bouton--texte { font-size: 0.83rem; padding: 0.45rem 0.8rem; }

.pilotage__compteur {
  font-family: var(--sans);
  font-size: 0.83rem;
  padding: 0.45rem 0.8rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--encre-douce);
  cursor: pointer;
}
.pilotage__compteur:hover { border-color: var(--filet-fort); background: var(--papier-creux); }

.progression--diaporama {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 11;
  height: 3px;
  background: transparent;
}

/* ----------------------------- plan ----------------------------- */

.plan, .aide {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(34, 32, 29, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.plan[hidden], .aide[hidden] { display: none; }

.plan__contenu, .aide__contenu {
  background: var(--papier);
  border: 1px solid var(--filet-fort);
  padding: 1.8rem 2rem;
  max-width: 34rem;
  width: 100%;
  max-height: 80vh;
  overflow: auto;
}
.plan__contenu h2, .aide__contenu h2 { margin: 0 0 1rem; font-size: 1.25rem; }

.plan__liste { list-style: none; margin: 0 0 1.2rem; padding: 0; counter-reset: diapo; }
.plan__liste li { counter-increment: diapo; }
.plan__entree {
  display: flex;
  gap: 0.8rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  padding: 0.45rem 0.6rem;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--encre);
  cursor: pointer;
}
.plan__entree:hover { background: var(--papier-creux); }
.plan__entree.est-active { border-left-color: var(--accent); background: var(--papier-creux); }
.plan__numero {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--encre-douce);
  min-width: 1.6rem;
}
.plan__entree--partie .plan__intitule { font-weight: 600; }

/* ----------------------------- aide ----------------------------- */

.aide__contenu dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1.2rem;
  margin: 0 0 1.3rem;
  font-size: 0.92rem;
}
.aide__contenu dt {
  font-family: var(--sans);
  font-size: 0.8rem;
  border: 1px solid var(--filet-fort);
  border-radius: 2px;
  padding: 0.1rem 0.45rem;
  justify-self: start;
  color: var(--encre-douce);
}
.aide__contenu dd { margin: 0; }

.bouton-aide {
  position: fixed;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 12;
  width: 1.9rem;
  height: 1.9rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid var(--filet);
  border-radius: 50%;
  color: var(--encre-douce);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.bouton-aide:hover { opacity: 1; background: var(--papier-creux); }

/* --------------------------- responsive ------------------------- */

@media (max-width: 720px) {
  .scene { padding: 3.5rem 1.2rem 5.5rem; align-items: flex-start; overflow-y: auto; }
  .diapo__comparaison { grid-template-columns: 1fr; gap: 1.5rem; }
  .zone-clic { display: none; }
  .pilotage { gap: 0.35rem; padding: 0.6rem 0.8rem; }
  .pilotage__bouton--texte { font-size: 0.75rem; padding: 0.45rem 0.55rem; }
  .pilotage__compteur { font-size: 0.75rem; padding: 0.45rem 0.4rem; }
  .diapo--regle { border-left-width: 3px; }
}

@media (max-height: 560px) {
  .scene { padding-top: 2rem; padding-bottom: 4.5rem; }
  .diapo__image { max-height: 45vh; }
}

@media (prefers-reduced-motion: reduce) {
  .diapo { animation: none; }
}
