/* =====================================================================
   Usine — Premium scroll reveal
   Targets each top-level block (direct child of .entry-content).
   Navbar/footer are outside .entry-content so they are never affected.

   Safety model:
   - Hidden state ONLY applies under html.usine-anim-ready, a flag set by
     JS before paint. No JS / JS error  ->  flag absent  ->  everything
     visible (zero risk of hidden content).
   - prefers-reduced-motion fully disables the effect.
   ===================================================================== */

@media (prefers-reduced-motion: no-preference) {
  html.usine-anim-ready .site-main .entry-content > * {
    opacity: 0;
    transform: translateY(34px) scale(0.985);
    will-change: opacity, transform;
    transition:
      opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: 60ms;
  }

  /* Revealed */
  html.usine-anim-ready .site-main .entry-content > .usine-reveal-in {
    opacity: 1;
    transform: none;
  }

  /* Premium inner cascade: stagger immediate repeated items (cards, columns,
     features, list items, logos) once the parent block is revealed.
     Pure transform/opacity — no layout impact. Delay scales with --usine-i
     set by JS (capped), falling back to 0 if JS didn't tag the element. */
  html.usine-anim-ready .site-main .entry-content > * [class*="__card"],
  html.usine-anim-ready .site-main .entry-content > * [class*="__item"],
  html.usine-anim-ready .site-main .entry-content > * [class*="__feature"],
  html.usine-anim-ready .site-main .entry-content > * [class*="__column"],
  html.usine-anim-ready .site-main .entry-content > * [class*="__logo"],
  html.usine-anim-ready .site-main .entry-content > * [class*="__tile"],
  html.usine-anim-ready .site-main .entry-content > * [class*="__step"] {
    opacity: 0;
    transform: translateY(22px);
    transition:
      opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(120ms + (var(--usine-i, 0) * 70ms));
  }

  html.usine-anim-ready .site-main .entry-content > .usine-reveal-in [class*="__card"],
  html.usine-anim-ready .site-main .entry-content > .usine-reveal-in [class*="__item"],
  html.usine-anim-ready .site-main .entry-content > .usine-reveal-in [class*="__feature"],
  html.usine-anim-ready .site-main .entry-content > .usine-reveal-in [class*="__column"],
  html.usine-anim-ready .site-main .entry-content > .usine-reveal-in [class*="__logo"],
  html.usine-anim-ready .site-main .entry-content > .usine-reveal-in [class*="__tile"],
  html.usine-anim-ready .site-main .entry-content > .usine-reveal-in [class*="__step"] {
    opacity: 1;
    transform: none;
  }
}

/* =====================================================================
   MR-TOITURE-NO-REVEAL : la page Toiture (page-id 4883) empile plusieurs
   blocs bruns qui doivent former UNE seule section continue. On désactive
   le scroll-reveal ici : les blocs s'affichent ensemble (pas un par un) et
   aucun décalage (translateY) ne crée de liseré clair entre eux.
   Scoped à cette page uniquement — les animations des autres pages restent.
   ===================================================================== */
body.page-id-4883 .site-main .entry-content > *,
body.page-id-4883 .site-main .entry-content > * [class*="__card"],
body.page-id-4883 .site-main .entry-content > * [class*="__item"],
body.page-id-4883 .site-main .entry-content > * [class*="__feature"],
body.page-id-4883 .site-main .entry-content > * [class*="__column"],
body.page-id-4883 .site-main .entry-content > * [class*="__logo"],
body.page-id-4883 .site-main .entry-content > * [class*="__tile"],
body.page-id-4883 .site-main .entry-content > * [class*="__step"] {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}
