/* ============================================================
   CONSULTATION — diaporama multi-pages
   ------------------------------------------------------------
   1. Lecture        → diapos en flux dans la page
   2. Présentation   → scène plein fenêtre, une diapo à la fois
   3. Responsive
   Balisage : partials/slideshow.html.twig
   ============================================================ */

@import url("epa-base.css");

/* ============================================================
   1. LECTURE
   ============================================================ */

.consultation .slideshow-launch {
  margin: 1.5rem 0 2rem;
  text-align: center;
}

.consultation .slideshow-slide {
  padding-block: 1.75rem;
  border-top: var(--epa-br-thickness-thin) solid var(--epa-edit-divider);
}

.consultation .slideshow-slide:first-child {
  padding-top: 0;
  border-top: 0;
}

.consultation .slide-left > :first-child {
  margin-top: 0;
}

/* Les verbatims : un encadré (callout), comme les alertes Markdown. */
.consultation .slide-right {
  margin-top: 1.25rem;
  padding: .875rem 1.125rem;

  border-left: 4px solid var(--epa-edit-heading-color);
  border-radius: var(--epa-radius);

  background: color-mix(in oklab, var(--epa-edit-heading-color) 6%, var(--epa-bg-elev));
}

.consultation ul.verbatim {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2 16rem;
  column-gap: 2rem;
}

.consultation ul.verbatim li {
  break-inside: avoid;
  margin: 0 0 .5rem;
  font-style: italic;
}

.consultation ul.verbatim li::before {
  content: "“";
}

.consultation ul.verbatim li::after {
  content: "”";
}

.consultation ul.verbatim li::before,
.consultation ul.verbatim li::after {
  color: var(--epa-edit-heading-color);
}

/* En lecture : ni contrôles, ni position, ni bouton de fermeture. */
.consultation:not(.is-presenting) :is(.slideshow-controls, .slideshow-position, .slideshow-close) {
  display: none;
}

/* Les ancres ne passent pas sous l’en-tête fixe. */
.consultation .slideshow-slide {
  scroll-margin-top: 6rem;
}

/* Bouton de lancement : on lui garde sa place dans le flux, puis il
   devient rond et se fixe en haut à droite, sous l’en-tête. */
.consultation .slideshow-launch {
  min-height: 2.75rem;
}

.consultation .slideshow-launch .btn.is-floating {
  position: fixed;
  top: 4.75rem;
  right: 1rem;
  z-index: 40;

  width: 2.75rem;
  height: 2.75rem;
  min-height: 0;
  padding: 0;

  border-radius: var(--epa-radius-pill);
  box-shadow: var(--epa-shadow-raised);
}

.consultation .slideshow-launch .btn.is-floating .label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* ----- Scenery et effets : état statique en lecture ----- */

.consultation .slide-scenery {
  display: none;
}

.consultation .slide-effect {
  position: relative;
  padding: 0;
  border-left: 0;
  background: none;
}

.consultation .slide-effect[data-slideshow-effect="stack"],
.consultation .slide-effect[data-slideshow-effect="replace"] {
  aspect-ratio: 4 / 3;
}

/* Pile de photos jetées */
.stack-photo {
  position: absolute;
  width: 38%;
  max-width: 600px;
  height: auto;
  transform: translate(-50%, -50%) rotate(var(--angle, 0deg));
  border: .35em solid #fff;
  background: #fff;
  box-shadow: 0 .15em .6em rgb(0 0 0 / 35%);
}

.stack-photo.is-new {
  animation: stack-drop .45s var(--epa-ease-emphasis) both;
}

@keyframes stack-drop {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) scale(1.4);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) scale(1);
  }
}

/* Image qui en remplace une autre */
.replace-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.replace-image.is-new {
  animation: slideshow-fade-in .6s var(--epa-ease) both;
}

@keyframes slideshow-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Pyramide des âges */
.pyramid {
  --cell: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.pyramid-counter {
  margin-bottom: .4em;
  color: var(--epa-violet);
  font-size: calc(1.1em + 1.9em * var(--progress, 1));
  font-weight: var(--epa-font-weight-strong);
  line-height: 1.1;
  text-align: center;
}

.pyramid-counter .pyramid-unit {
  font-size: .4em;
  font-weight: var(--epa-font-weight-heading);
}

.pyramid-row {
  display: grid;
  grid-template-columns: 1fr calc(var(--cell) * 5) 1fr;
  align-items: center;
  height: var(--cell);
}

.pyramid-side {
  display: flex;
  justify-content: flex-start;
}

.pyramid-f {
  flex-direction: row-reverse;
}

.pyramid-label {
  background: var(--epa-green-dark);
  color: var(--epa-violet-lightest);
  font-size: calc(var(--cell) * .8);
  font-weight: var(--epa-font-weight-strong);
  line-height: var(--cell);
  text-align: center;
}

.pyramid-row:first-child .pyramid-label {
  border-radius: .6em .6em 0 0;
}

.pyramid-row:last-child .pyramid-label {
  border-radius: 0 0 .6em .6em;
}

.pyramid-slot {
  flex: none;
  width: var(--cell);
  height: var(--cell);
}

.pyramid-slot img {
  display: block;
  width: 100%;
  height: 100%;
  transition: opacity .3s var(--epa-ease), transform .3s var(--epa-ease);
}

.pyramid.is-dynamic .pyramid-slot:not(.is-on) img {
  opacity: 0;
  transform: scale(.3);
}
/* ============================================================
   2. PRÉSENTATION
   ------------------------------------------------------------
   La scène occupe toute la fenêtre. La palette est fixe (couleurs
   primitives EPA) : la présentation a le même aspect en thème clair
   et en thème sombre.
   ============================================================ */

.consultation.is-presenting .slideshow-stage {
  --epa-edit-heading-color: var(--epa-green-dark);
  --epa-edit-tx: var(--epa-violet-darkest);

  position: fixed;
  inset: 0;
  z-index: 100;

  background: var(--epa-white);
  overflow: hidden;
  outline: none;
}

.consultation.is-presenting .slideshow-stage.is-idle {
  cursor: none;
}

.consultation.is-presenting .slideshow-slides {
  position: absolute;
  inset: 0;

  display: grid;
  grid-template-rows: minmax(0, 1fr);

  font-size: clamp(.8rem, .55vw + .85vh, 1.35rem);
  font-weight: var(--epa-font-weight-heading);
}

.consultation.is-presenting .slideshow-slide {
  grid-area: 1 / 1;

  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 1em;

  min-width: 0;
  padding: 3.25rem 1rem 6rem;
  border: 0;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity var(--epa-duration-slow) var(--epa-ease),
    visibility 0s linear var(--epa-duration-slow);
}

.consultation.is-presenting .slideshow-slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

/* ----- Panneaux ----- */

.consultation.is-presenting .slide-left {
  --epa-edit-tx: var(--epa-green-darker);

  align-self: start;
  max-height: 100%;
  overflow: auto;

  padding: 1em 1.25em;
  border-radius: 1em;

  background: var(--epa-violet-lightest);
}

.consultation.is-presenting .slide-left:only-child {
  grid-column: 1 / -1;
}

.consultation.is-presenting .slide-right {
  --epa-edit-tx: var(--epa-violet);

  align-self: stretch;
  overflow: auto;

  margin: 0;
  padding: 1em;
  border: 0;
  border-radius: 1em;

  background: var(--epa-green-light);
  box-shadow: inset 0 0 1em var(--epa-green);

  text-align: center;
}

/* ----- Typographie : tout part de la taille de la scène ----- */

.consultation.is-presenting :is(p, li) {
  font-size: 1em;
  line-height: 1.45;
}

.consultation.is-presenting .slide-left h2 {
  margin: 0 0 .4em;
  font-size: 1.9em;
  letter-spacing: -.01em;
}

.consultation.is-presenting .slide-left ul {
  margin-block: 0 .8em;
}

.consultation.is-presenting ul.verbatim {
  columns: auto;
}

.consultation.is-presenting ul.verbatim li {
  margin: 0 0 .45em;
  font-style: normal;
}

.consultation.is-presenting ul.verbatim li::before,
.consultation.is-presenting ul.verbatim li::after {
  color: var(--epa-violet);
  font-size: 1.8em;
  line-height: 0;
  vertical-align: -.2em;
}

/* ----- Bouton de fermeture et position ----- */

.consultation .slideshow-close {
  position: fixed;
  top: .75rem;
  right: .75rem;
  z-index: 110;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  margin: 0;
  padding: 0;

  border: 0;
  border-radius: var(--epa-radius-pill);

  background: var(--epa-green-darkest);
  color: var(--epa-green-lightest);

  cursor: pointer;

  transition:
    opacity var(--epa-duration-fast) var(--epa-ease),
    background var(--epa-duration-fast) var(--epa-ease);
}

.consultation .slideshow-close:hover {
  background: var(--epa-green-darker);
}

.consultation.is-presenting .slideshow-position {
  position: fixed;
  left: 50%;
  bottom: 4rem;
  z-index: 110;
  margin: 0;
  transform: translateX(-50%);

  color: var(--epa-violet);
  font-weight: var(--epa-font-weight-heading);

  transition: opacity var(--epa-duration-fast) var(--epa-ease);
}

.consultation .slideshow-stage.is-idle :is(.slideshow-close, .slideshow-position) {
  opacity: 0;
  pointer-events: none;
}
/* ----- Variantes de mise en page ----- */

.consultation.is-presenting .slideshow-slide {
  position: relative;
  grid-template-columns: var(--slide-columns, 4fr 5fr);
}

.consultation.is-presenting :is(.slide-left, .slide-right) {
  position: relative;
  z-index: 1;
  min-width: 0;
}

/* Panneau de droite sans fond (le décor ou la carte se voit derrière). */
.consultation.is-presenting .right-plain .slide-right {
  background: none;
  box-shadow: none;
}

.consultation.is-presenting .slide-effect {
  padding: .6em;
}

/* ----- Scenery : fond et décor SVG sous les panneaux ----- */

.consultation.is-presenting .slide-scenery {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
}

.consultation.is-presenting .slide-decor {
  position: fixed;
/*  position: absolute;*/
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ----- Layout « cover » : titre à gauche, effet à droite ----- */

.consultation.is-presenting .layout-cover {
  display: block;
  padding: 0;
}

.consultation.is-presenting .layout-cover .slide-left {
  --epa-edit-tx: var(--epa-green-darker);
  position: absolute;
  top: 17%;
  left: 15%;
  width: 36%;
  max-height: none;
  overflow: visible;
  padding: 0;
  background: none;
}

.consultation.is-presenting .layout-cover .slide-left h2 {
  font-size: 2.6em;
  line-height: 1.15;
}

.consultation.is-presenting .layout-cover .slide-right {
  position: absolute;
  top: 16%;
  right: 2%;
  bottom: 6%;
  left: 50%;
  padding: 0;
  overflow: visible;
  background: none;
  box-shadow: none;
}
/* ============================================================
   3. RESPONSIVE
   ------------------------------------------------------------
   Fenêtre étroite ou en portrait : panneaux l’un sous l’autre,
   la diapo défile.
   ============================================================ */

@media (max-width: 800px), (max-aspect-ratio: 1 / 1) {
  .consultation.is-presenting .slideshow-slide {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    align-content: start;
    overflow-y: auto;
  }

  .consultation.is-presenting .slide-left,
  .consultation.is-presenting .slide-right {
    align-self: auto;
    max-height: none;
    overflow: visible;
  }
}
