/* ==========================================================================
   Big Top — motion layer
   Rule: the resting state of every element is VISIBLE. Motion is decoration.

   There is exactly ONE reveal mechanism: IntersectionObserver, driven by
   motion.js. There is deliberately NO scroll-driven CSS path — an
   animation-timeline rule hides content with pure CSS, and every recovery
   mechanism available to us needs JavaScript, so a stalled timeline could
   strand content with no rescue. One path is slightly less smooth and
   completely predictable.

   Every rule below that hides content is keyed to .bt-observed, a class only
   motion.js applies, and only at the moment it has registered both an observer
   and a failsafe for that element. No JavaScript, a failed script load, or an
   element the script never reached all mean the same thing: the element is
   simply visible.
   ========================================================================== */

.bt-observed:not(.is-revealed) {
  opacity: 0;
  transform: translateY(24px);
}

.bt-observed.is-revealed {
  opacity: 1;
  transform: none;
  transition:
    opacity 500ms var(--btm-ease-standard, cubic-bezier(0.4, 0, 0.2, 1)),
    transform 500ms var(--btm-ease-standard, cubic-bezier(0.4, 0, 0.2, 1));
}

/* Stagger children by index. Capped at six; anything beyond reveals with the
   sixth so a long list never waits noticeably. */
[data-motion='stagger'] > .bt-observed:nth-child(1),
.bt-motion-stagger > .bt-observed:nth-child(1) { transition-delay: 0ms; }
[data-motion='stagger'] > .bt-observed:nth-child(2),
.bt-motion-stagger > .bt-observed:nth-child(2) { transition-delay: 70ms; }
[data-motion='stagger'] > .bt-observed:nth-child(3),
.bt-motion-stagger > .bt-observed:nth-child(3) { transition-delay: 140ms; }
[data-motion='stagger'] > .bt-observed:nth-child(4),
.bt-motion-stagger > .bt-observed:nth-child(4) { transition-delay: 210ms; }
[data-motion='stagger'] > .bt-observed:nth-child(5),
.bt-motion-stagger > .bt-observed:nth-child(5) { transition-delay: 280ms; }
[data-motion='stagger'] > .bt-observed:nth-child(n + 6),
.bt-motion-stagger > .bt-observed:nth-child(n + 6) { transition-delay: 350ms; }

/* --- Failsafe ------------------------------------------------------------- */
/* motion.js applies this to any claimed element still computing to opacity 0
   after its batch's failsafe delay. Content wins over motion, always. */
.bt-force-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* --- The guard ------------------------------------------------------------ */
/* Nothing in GeneratePress, GP Premium or GenerateBlocks does this. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .bt-observed,
  .bt-motion-fade-up,
  .bt-motion-stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
