/*
 * Scroll-reveal. Defined ONCE here and enqueued globally.
 * Never redefine these keyframes inside a block's style.css.
 *
 * Two patterns — do NOT combine them on the same wrapper/children pair, the
 * translateY would compound:
 *   .rain-fade-up            on a section wrapper (whole section reveals)
 *   .rain-fade-up-stagger    on a parent, .rain-fade-up-item on children
 */

/* Scoped to .rain-js, set by the inline snippet in header.php. Without
   JavaScript nothing here applies and the content is simply visible — the
   reveal is an enhancement, not a precondition for reading the page. */
.rain-js .rain-fade-up,
.rain-js .rain-fade-up-item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--rain-ease), transform .7s var(--rain-ease);
  will-change: opacity, transform;
}

.rain-fade-up.is-visible,
.rain-fade-up-item.is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger children in sequence. */
.rain-fade-up-stagger .rain-fade-up-item:nth-child(1) { transition-delay: 0ms; }
.rain-fade-up-stagger .rain-fade-up-item:nth-child(2) { transition-delay: 90ms; }
.rain-fade-up-stagger .rain-fade-up-item:nth-child(3) { transition-delay: 180ms; }
.rain-fade-up-stagger .rain-fade-up-item:nth-child(4) { transition-delay: 270ms; }
.rain-fade-up-stagger .rain-fade-up-item:nth-child(5) { transition-delay: 360ms; }
.rain-fade-up-stagger .rain-fade-up-item:nth-child(6) { transition-delay: 450ms; }

/* In the block editor there is no IntersectionObserver run — show everything. */
.block-editor-block-list__layout .rain-fade-up,
.block-editor-block-list__layout .rain-fade-up-item {
  opacity: 1;
  transform: none;
}

/* Must carry .rain-js too. The hiding rule above is (0,2,0); a bare
   .rain-fade-up here is (0,1,0) and would silently stop winning, which would
   turn the reduced-motion CSS reveal — the one path that never needed
   JavaScript — into a permanently blank page. Same specificity, later in the
   file, so it wins on source order. */
@media (prefers-reduced-motion: reduce) {
  .rain-js .rain-fade-up,
  .rain-js .rain-fade-up-item {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
