/**
 * Wisite Parallax Stack
 * https://wisite.co.il/
 *
 * Usage: add the class "wisite-parallax" to any Elementor section.
 *
 * Optional per-section overrides via the section's Custom CSS:
 *   selector { --wisite-parallax-darkness: 0.85; }   (default 0.65, range 0-1)
 *   selector { --wisite-parallax-min-h: 100vh; }     (default 100vh)
 *   selector { --wisite-parallax-start: 1; }         (when darkening begins, 1 = next section starts entering, default 1)
 *   selector { --wisite-parallax-end: 0; }           (when darkening reaches max, 0 = next section fully covers, default 0)
 */

.wisite-parallax {
    position: sticky !important;
    top: 0 !important;
    min-height: var(--wisite-parallax-min-h, 100vh) !important;
    overflow: hidden;
}

.wisite-parallax-overlay {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    /* JS updates opacity inside requestAnimationFrame, no transition needed */
}

/* Mobile: disable the stacking effect entirely.
   Sticky + viewport-height tricks fight with the mobile address bar. */
@media (max-width: 767px) {
    .wisite-parallax {
        position: relative !important;
        top: auto;
        min-height: 0;
        overflow: visible;
    }
    .wisite-parallax-overlay {
        display: none;
    }
}

/* Respect users who asked for less motion */
@media (prefers-reduced-motion: reduce) {
    .wisite-parallax {
        position: relative !important;
        top: auto;
        min-height: 0;
        overflow: visible;
    }
    .wisite-parallax-overlay {
        display: none;
    }
}

/* Convenience modifiers */
.wisite-parallax.wisite-parallax-strong { --wisite-parallax-darkness: 0.85; }
.wisite-parallax.wisite-parallax-soft   { --wisite-parallax-darkness: 0.35; }

/* Earlier start - darkening begins when the next section is still further down */
.wisite-parallax.wisite-parallax-early { --wisite-parallax-start: 1.5; }

.wisite-parallax.wisite-parallax-no-darken .wisite-parallax-overlay {
    display: none;
}
