/* Comm'une Couleur — Animations au scroll
 *
 * Remplace animate.css (71 KB) + wow.min.js (8 KB) par :
 *   - 5 keyframes (les seules utilisées dans le site)
 *   - une classe .wow d'état initial (invisible)
 *   - une classe .animated qui déclenche l'animation
 *
 * Le déclenchement est géré côté JS par un IntersectionObserver natif
 * (cf. site.js → initScrollAnimations).
 *
 * Les keyframes sont reprises à l'identique d'animate.css 3.x (MIT,
 * Daniel Eden — http://daneden.me/animate).
 */

/* État initial : élément invisible jusqu'à ce qu'il entre dans le viewport */
.wow:not(.animated) {
    opacity: 0;
    visibility: hidden;
}

/* État animé : commun à toutes les variantes */
.animated {
    visibility: visible;
    animation-duration: 1s;
    animation-fill-mode: both;
}

/* --- Keyframes --- */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 100%, 0);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -100%, 0);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-100%, 0, 0);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(100%, 0, 0);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* --- Mappage classe → animation, déclenché par .animated --- */

.fadeIn.animated      { animation-name: fadeIn; }
.fadeInUp.animated    { animation-name: fadeInUp; }
.fadeInDown.animated  { animation-name: fadeInDown; }
.fadeInLeft.animated  { animation-name: fadeInLeft; }
.fadeInRight.animated { animation-name: fadeInRight; }

/* Respect des préférences utilisateur — les animations sont déjà neutralisées
   par le bloc global de sodev-resets.css, mais on rend l'élément visible
   immédiatement pour qu'il ne reste pas masqué. */
@media (prefers-reduced-motion: reduce) {
    .wow:not(.animated),
    .wow.animated {
        opacity: 1;
        visibility: visible;
    }
}
