/* SchoolCMS – Animation helpers
   Generic reveal helper (AOS handles most entrance animation via
   data-aos attributes; .hideme is the lightweight manual variant). */

.hideme {
    opacity:    0;
    top:        30px;
    position:   relative;
    transition: 500ms;

    &.active {
        opacity: 1;
        top:     0;
    }
}

/* Nothing answers the pointer while it is still sliding into place.
   AOS reveals an element by fading it in from 100px away, and its hit
   area travels with it: a cursor resting over a block as it revealed met
   each row in turn as it slid past, so the hovers switched on and off one
   after another – a flicker on the first few hovers after scrolling to
   any block of hover states, gone once the reveals had played (Charlie,
   2026-10-29, found on The Hall School). Until its reveal has played, a
   moving AOS element lets the pointer through; a hover then arrives once,
   where the element settles. 0.7s is AOS.init's duration
   (js/utilities/aos.js) – keep them equal. AOS strips data-aos under
   reduced motion, which leaves this rule nothing to match. */
@keyframes aos-settling {
    from,
    to {
        pointer-events: none;
    }
}

:is([data-aos^="fade-"], [data-aos^="slide-"], [data-aos^="zoom-"], [data-aos^="flip-"]) {
    pointer-events: none;

    &.aos-animate {
        pointer-events: auto;
        animation:      aos-settling 0.7s;
    }
}

/* Nothing waiting to reveal anchors the scroll. Chrome puts a page the
   visitor comes back to (the Back link, the browser's back button) where
   they left it by finding the element that was at the top of the view
   and restoring its offset – and an AOS element that has not played yet
   sits 100px from its place, so a page came back 100px further down than
   it was left (Charlie, 2026-10-29, found on The Hall School). Out of the
   running, an element that does not move anchors instead, and the page
   comes back exactly where it was left. */
[data-aos] {
    overflow-anchor: none;
}
