/* =========================================================
   Shared scroll-reveal animation system for all hand-coded templates
   (front-page.php, single.php, and every page template still to come).

   Mirrors what the original Elementor pages did: an element starts
   hidden (Elementor's own `elementor-invisible` class) and Elementor's
   waypoint/intersection-observer code swaps in an animate.css keyframe
   class (slideInUp, zoomIn, slideInLeft, etc.) once it scrolls into
   view. Same idea here, own implementation: mark an element
   `data-animate="slideInUp"` (etc.), it starts hidden via [data-animate],
   and animations.js adds `.is-animated` once it's in view, which runs
   the matching keyframe below.

   Kept to the small set of animations the original pages actually used
   (slideInUp, zoomIn, slideInLeft, slideInRight, fadeIn) - not the full
   animate.css library.
   ========================================= */

/* Visible by default, always. Content must never depend on JS running to
   become visible - if animations.js is blocked, delayed (this site runs
   SpeedyCache, which can delay script execution - the exact bug class
   already hit multiple times this session), or simply errors, every
   [data-animate] element must already be showing. JS opts INTO hiding
   elements it's about to animate, never the other way around: it adds
   .js-animate-active to <html> as its very first action, and only that
   combination is ever hidden. */
.js-animate-active [data-animate] {
    opacity: 0;
}
@media not (prefers-reduced-motion: reduce) {
    .js-animate-active [data-animate].is-animated {
        opacity: 1;
        animation-duration: 0.8s;
        animation-fill-mode: both;
        animation-timing-function: ease-out;
    }
    .js-animate-active [data-animate="slideInUp"].is-animated { animation-name: hec-slideInUp; }
    .js-animate-active [data-animate="slideInLeft"].is-animated { animation-name: hec-slideInLeft; }
    .js-animate-active [data-animate="slideInRight"].is-animated { animation-name: hec-slideInRight; }
    .js-animate-active [data-animate="zoomIn"].is-animated { animation-name: hec-zoomIn; }
    .js-animate-active [data-animate="fadeIn"].is-animated { animation-name: hec-fadeIn; }
}
/* Reduced-motion users: reveal instantly, no keyframe animation, but
   still respect the initial hide/reveal state change (no layout jump). */
@media (prefers-reduced-motion: reduce) {
    .js-animate-active [data-animate].is-animated {
        opacity: 1;
    }
}

@keyframes hec-slideInUp {
    from { opacity: 0; transform: translate3d(0, 40px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes hec-slideInLeft {
    from { opacity: 0; transform: translate3d(-40px, 0, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes hec-slideInRight {
    from { opacity: 0; transform: translate3d(40px, 0, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes hec-zoomIn {
    from { opacity: 0; transform: scale3d(0.9, 0.9, 0.9); }
    to   { opacity: 1; transform: scale3d(1, 1, 1); }
}
@keyframes hec-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
