/* ============================================================
   SCROLL FX — "pop-up" reveal classes + smooth-wrapper fixes
   ============================================================ */

/* ------------------------------------------------------------
   POP REVEAL — vertical rise + fade on scroll
   Usage:
     .pop-reveal         any single element (container, image,
                         heading, widget)
     .pop-reveal-stagger direct children pop one after another
     .pop-reveal-grid    on a JetEngine Listing Grid widget; each
                         .jet-listing-grid__item pops in sequence
   GSAP sets final state; these rules only hide pre-JS to avoid FOUC
   and provide a no-JS / reduced-motion fallback.
   ------------------------------------------------------------ */

.pop-reveal:not(.is-fx-ready),
.pop-reveal-stagger > *:not(.is-fx-ready),
.pop-reveal-stagger.is-fx-ready > *,
.pop-reveal-grid .jet-listing-grid__item:not(.is-fx-ready) {
  opacity: 0;
  transform: translateY(40px);
}

/* once animated, clear our static styles so GSAP owns the element */
.pop-reveal.is-fx-ready,
.pop-reveal-stagger.is-fx-ready,
.pop-reveal-grid.is-fx-ready .jet-listing-grid__item {
  opacity: initial;
  transform: initial;
}

/* no-JS fallback: show everything */
.no-peerali-fx .pop-reveal:not(.is-fx-ready),
.no-peerali-fx .pop-reveal-stagger > *,
.no-peerali-fx .pop-reveal-grid .jet-listing-grid__item {
  opacity: 1;
  transform: none;
}

/* reduced motion: show final state immediately */
@media (prefers-reduced-motion: reduce) {
  .pop-reveal,
  .pop-reveal-stagger > *,
  .pop-reveal-grid .jet-listing-grid__item {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ------------------------------------------------------------
   SMOOTH WRAPPER FIXES
   position:fixed elements must live OUTSIDE #smooth-content;
   JS re-parents them. These rules keep them above the content.
   ------------------------------------------------------------ */
/* Smooth-wrapper styles are DESKTOP-ONLY: ScrollSmoother initializes
   on >=1025px (gsap-init), and a fixed wrapper on mobile would kill
   native scrolling entirely. */
@media (min-width: 1025px) {
  #smooth-wrapper {
    /* overflow:clip (not hidden!) — hidden would create a scroll
       container, which breaks position:sticky children; clip clips
       visually without becoming a scrollport. The hidden line is a
       fallback for Safari <= 15 which lacks clip support. */
    overflow: hidden !important;
    overflow: clip !important;
    position: fixed;
    inset: 0;
    height: 100%;
  }
  #smooth-content {
    overflow: visible;
    width: 100%;
  }
}
@media (max-width: 1024px) {
  #smooth-wrapper,
  #smooth-content {
    position: static !important;
    height: auto !important;
    overflow: visible !important;
    transform: none !important;
  }
}
