/*
 * Honours the "reduce motion" accessibility setting (WCAG 2.3.3): animations and transitions
 * finish at once instead of moving. Loaded last in _Layout so it applies everywhere and wins
 * over Font Awesome's own reduced-motion rule.
 *
 * A 0.01ms duration rather than none, so code waiting for animationend / transitionend (e.g.
 * the page loader) still gets the event. Loading spinners are left spinning: they are the only
 * sign something is still happening, which WCAG treats as essential motion.
 */

@media (prefers-reduced-motion: reduce) {
    *:not(.fa-spin):not(.fa-spin-pulse):not(.main-body-loader-spinner),
    *:not(.encounter-card--updating)::before,
    *:not(.encounter-card--updating)::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }

    /* Font Awesome stops these when motion is reduced; put them back for loading indicators */
    .fa-spin {
        animation-delay: 0s;
        animation-duration: var(--fa-animation-duration, 2s);
        animation-iteration-count: var(--fa-animation-iteration-count, infinite);
    }

    .fa-spin-pulse {
        animation-delay: 0s;
        animation-duration: var(--fa-animation-duration, 1s);
        animation-iteration-count: var(--fa-animation-iteration-count, infinite);
    }
}
