/* ========================================================================== */
/* Révélations au défilement                                                  */
/* ========================================================================== */
/* app.js pose `active-trigger` (et `active`) sur `.gs_reveal`, `.animate` et
   `.animateChilds` quand ils entrent dans la vue (85 % de la hauteur). Les
   classes se posent dans l'éditeur (Avancé → Classes CSS supplémentaires).

     gs_reveal / animate   l'élément apparaît en fondu
     animateChilds         ses enfants directs apparaissent en cascade
     fromBottom / fromLeft / fromRight   sens d'arrivée (à combiner)

   Chargé sur le site public seulement : dans l'éditeur, tout reste visible
   (css/editeur.css). Mouvement réduit : tout est révélé d'emblée (app.js). */

.gs_reveal,
.animate {
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.43, 0.195, 0.02, 1),
    transform 0.5s cubic-bezier(0.43, 0.195, 0.02, 1);
}
.gs_reveal.active-trigger,
.animate.active {
  opacity: 1;
  transform: none;
}

.fromBottom { transform: translateY(100px); }
.fromLeft   { transform: translateX(-100px); }
.fromRight  { transform: translateX(100px); }

/* Cascade. Les couches de FOND d'un bloc Cover (teinte + image) ne sont PAS
   du contenu à révéler : les inclure force l'overlay à opacity:1 (sa couleur
   opaque au lieu de sa teinte) et l'image disparaît derrière. :where() pèse
   zéro en spécificité, l'exclusion ne renverse donc aucune cascade. */
.animateChilds > *:not(:where(.wp-block-cover__background, .wp-block-cover__image-background)) {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.animateChilds.fromLeft > *:not(:where(.wp-block-cover__background, .wp-block-cover__image-background))  { transform: translateX(-100px); }
.animateChilds.fromRight > *:not(:where(.wp-block-cover__background, .wp-block-cover__image-background)) { transform: translateX(100px); }
/* L'animateChilds lui-même ne bouge pas : seuls ses enfants arrivent. */
.animateChilds.fromBottom,
.animateChilds.fromLeft,
.animateChilds.fromRight { transform: none; }

.animateChilds.active-trigger > *:not(:where(.wp-block-cover__background, .wp-block-cover__image-background)) {
  opacity: 1;
  transform: none;
}

.animateChilds > *:nth-child(1)  { transition-delay: 0.1s; }
.animateChilds > *:nth-child(2)  { transition-delay: 0.2s; }
.animateChilds > *:nth-child(3)  { transition-delay: 0.3s; }
.animateChilds > *:nth-child(4)  { transition-delay: 0.4s; }
.animateChilds > *:nth-child(5)  { transition-delay: 0.5s; }
.animateChilds > *:nth-child(6)  { transition-delay: 0.6s; }
.animateChilds > *:nth-child(7)  { transition-delay: 0.7s; }
.animateChilds > *:nth-child(8)  { transition-delay: 0.8s; }
.animateChilds > *:nth-child(9)  { transition-delay: 0.9s; }
.animateChilds > *:nth-child(10) { transition-delay: 1s; }
.animateChilds > *:nth-child(11) { transition-delay: 1.1s; }
/* Délai plafonné, jamais remis à 0 s (sinon les suivants apparaîtraient
   avant leurs prédécesseurs). */
.animateChilds > *:nth-child(n+12) { transition-delay: 1.2s; }

@media (prefers-reduced-motion: reduce) {
  .gs_reveal,
  .animate,
  .animateChilds > * {
    transition: none !important;
  }
}
