/* ============================================
   ANIMATIONS D'APPARITION ET PARALLAXE LÉGER
   ============================================ */

/* Keyframes pour les animations d'apparition */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation de parallaxe subtile */
@keyframes parallaxFloat {
    0% {
        transform: translateY(0px);
    }
    100% {
        transform: translateY(5px);
    }
}

/* ============================================
   CLASSES POUR LES ANIMATIONS
   ============================================ */

/* État initial - invisible et décalé */
.content-block {
    opacity: 0;
    transform: translateY(30px);
}

/* Animation au scroll - utilise Intersection Observer */
.content-block.in-view {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Variantes d'animation */
.content-block.animate-left {
    opacity: 0;
    transform: translateX(-30px);
}

.content-block.animate-left.in-view {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.content-block.animate-right {
    opacity: 0;
    transform: translateX(30px);
}

.content-block.animate-right.in-view {
    animation: fadeInRight 0.8s ease-out forwards;
}

.content-block.animate-scale {
    opacity: 0;
    transform: scale(0.95);
}

.content-block.animate-scale.in-view {
    animation: scaleIn 0.8s ease-out forwards;
}

.content-block.animate-fade {
    opacity: 0;
}

.content-block.animate-fade.in-view {
    animation: fadeIn 0.6s ease-out forwards;
}

/* ============================================
   PARALLAXE LÉGER SUR LES BLOCS
   ============================================ */

/* Parallaxe subtile pour les sections */
.content-block.parallax-light {
    transition: transform 0.3s ease-out;
}

/* Délais staggered pour les animations en cascade */
.content-block:nth-child(1) { animation-delay: 0.1s; }
.content-block:nth-child(2) { animation-delay: 0.2s; }
.content-block:nth-child(3) { animation-delay: 0.3s; }
.content-block:nth-child(4) { animation-delay: 0.4s; }
.content-block:nth-child(5) { animation-delay: 0.5s; }

/* Classes spécifiques pour chaque type de bloc */
section.event-focus {
    perspective: 1000px;
}

section.event-focus.in-view {
    animation: fadeInUp 0.8s ease-out forwards;
}

section.event-highlight {
    perspective: 1000px;
}

section.event-highlight.in-view {
    animation: fadeInLeft 0.8s ease-out 0.1s forwards;
}

section.edito-big {
    perspective: 1000px;
}

section.edito-big.in-view {
    animation: fadeInRight 0.8s ease-out 0.1s forwards;
}

section.edito-medium {
    perspective: 1000px;
}

section.edito-medium.in-view {
    animation: fadeInUp 0.8s ease-out forwards;
}

section.edito-small {
    perspective: 1000px;
}

section.edito-small.in-view {
    animation: scaleIn 0.8s ease-out forwards;
}

section.spaces {
    perspective: 1000px;
}

section.spaces.in-view {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Parallaxe léger sur les éléments internes */
.event-focus-img,
.event-highlight-img,
.edito-big-img,
.edito-medium-img,
.spaces-img {
    transition: transform 0.1s ease-out;
}

/* État parallaxé */
.parallax-apply {
    transform: translateY(var(--parallax-offset, 0px)) !important;
}

/* Animation de hover léger pour les blocs */
section:hover .parallax-light {
    transform: translateY(-3px);
}

/* Désactiver les animations sur les appareils avec préférence réduite */
@media (prefers-reduced-motion: reduce) {
    .content-block,
    .content-block.in-view,
    .content-block.animate-left,
    .content-block.animate-right,
    .content-block.animate-scale,
    .content-block.animate-fade,
    section.event-focus.in-view,
    section.event-highlight.in-view,
    section.edito-big.in-view,
    section.edito-medium.in-view,
    section.edito-small.in-view,
    section.spaces.in-view {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================
   ANIMATIONS SUPPLÉMENTAIRES POUR DYNAMISME
   ============================================ */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(10px);
        opacity: 0.5;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 100, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 100, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 100, 0, 0);
    }
}

/* Léger pulsing sur les CTAs */
.btn {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.event-focus .btn:hover,
.event-highlight .btn:hover,
.edito-big .btn:hover,
.edito-medium .btn:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Animation subtile pour les images */
img.lazy {
    transition: opacity 0.3s ease;
}

img.lazy.in-view {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Optimisations pour mobile */
@media (max-width: 768px) {
    .content-block {
        animation-duration: 0.6s !important;
    }

    /* Réduire le parallaxe sur mobile */
    .content-block.parallax-light {
        --parallax-offset: 0px !important;
    }

    /* Moins de délai sur mobile */
    .content-block:nth-child(1) { animation-delay: 0.05s; }
    .content-block:nth-child(2) { animation-delay: 0.1s; }
    .content-block:nth-child(3) { animation-delay: 0.15s; }
    .content-block:nth-child(4) { animation-delay: 0.2s; }
    .content-block:nth-child(5) { animation-delay: 0.25s; }
}

/* ============================================
   ANIMATIONS BONUS POUR ÉLÉMENTS SPÉCIFIQUES
   ============================================ */

/* Animation pour les titres dans les sections */
.event-focus h2,
.event-highlight h2,
.edito-big h2,
.edito-medium h2,
.edito-small h2,
.spaces h2 {
    transition: color 0.3s ease;
}

/* Animation au hover des sections */
.content-block {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* Subtle lift au hover (desktop only) */
@media (hover: hover) {
    .content-block:hover {
        transform: translateY(-2px);
    }
}
