/* Pre-illustration overlay */
.pre-illu-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 950;
  display: grid;
  place-items: center;
  transition: opacity 0.8s ease;
  font-family: "ExposureTrial", system-ui, -apple-system, Segoe UI, Roboto,
    sans-serif;
}

.pre-illu-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.pre-illu-page {
  transition: opacity 0.6s ease-out;
}

.pre-illu-content {
  text-align: center;
  width: min(96vw, 1100px);
  padding: 0 2vw;
  font-family: "ExposureItalicTrial+30", "ExposureTrial", system-ui,
    -apple-system, Segoe UI, Roboto, sans-serif;
  font-style: italic;
}

/* Agrandir la largeur sur desktop uniquement */
@media (min-width: 850px) {
  .pre-illu-content {
    width: min(95vw, 1200px);
  }
  /* Largeur encore plus grande pour la page data-index="9" uniquement */
  .pre-illu-content:has(.pre-illu-page[data-index="9"]:not(.hidden)) {
    width: min(98vw, 1400px);
  }
}

.pre-illu-page p {
  margin: 0;
  color: #000;
  font-weight: 400;
  font-size: clamp(20px, 5vw, 46px);
  line-height: 1.3;
  font-family: "ExposureItalicTrial+30", "ExposureTrial", system-ui,
    -apple-system, Segoe UI, Roboto, sans-serif;
  font-style: italic;
}

.pre-illu-page p .sentence {
  display: block;
  margin-bottom: 0.08em;
}

.pre-illu-page p .sentence:last-child {
  margin-bottom: 0;
}

/* On larger screens, avoid word wrapping changes on hover */
@media (min-width: 900px) {
  .pre-illu-page p {
    word-break: keep-all;
    overflow-wrap: normal;
    font-size: clamp(22px, 5.5vw, 50px);
  }
}

.pre-illu-page.hidden {
  display: none;
}

/* Page spécifique avec fond noir et texte blanc */
.pre-illu-overlay:has(.pre-illu-page[data-index="7"]:not(.hidden)) {
  background: #000;
}

.pre-illu-page[data-index="7"] p {
  color: #fff;
}

.pre-illu-page[data-index="7"] .trigger {
  color: #fff;
}

.pre-illu-page[data-index="7"] .trigger:hover {
  color: rgb(200, 0, 0);
}

/* Désactiver le hover sur mobile pour la page avec fond noir */
@media (max-width: 700px) {
  .pre-illu-page[data-index="7"] .trigger:hover {
    color: #fff;
  }
}

.pre-illu-hint {
  margin-top: 1.1rem;
  color: #888;
  font-size: clamp(12px, 2.4vw, 16px);
}

.pre-illu-page .trigger {
  color: inherit;
  cursor: pointer;
  font-family: "ExposureItalicTrial+30", "ExposureTrial", system-ui,
    -apple-system, Segoe UI, Roboto, sans-serif;
  font-style: italic;
  /* Avoid layout shifts: only paint gets heavier */
  transition: color 0.2s ease, text-shadow 180ms ease-in-out;
  text-shadow: none;
  backface-visibility: hidden;
}
.pre-illu-page .trigger:hover {
  color: rgb(200, 0, 0);
  /* Simulate heavier weight without changing glyph metrics */
  text-shadow: 0 0 0 currentColor, 0.015em 0 currentColor,
    -0.015em 0 currentColor, 0 0.015em currentColor, 0 -0.015em currentColor;
}

/* Désactiver le hover sur mobile pour éviter que les triggers restent en rouge */
@media (max-width: 700px) {
  .pre-illu-page .trigger:hover {
    color: inherit;
    text-shadow: none;
  }
}

@media (max-width: 480px) {
  .pre-illu-page p {
    font-size: clamp(18px, 5.5vw, 42px);
    line-height: 1.35;
  }

  .pre-illu-page .trigger {
    display: inline-block;
    padding: 0.1em 0;
  }
}
