/* ============================================================
   ANIMATIONS — Séjours and Co — V3 Chaleureux
   Scroll reveals, hover effects, hero motion, lightbox
   ============================================================ */

/* ============================================================
   1. KEYFRAMES
   ============================================================ */

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

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

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

@keyframes bounceScroll {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-12px);
    }
    60% {
        transform: translateX(-50%) translateY(-6px);
    }
}

@keyframes heroReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroBgZoom {
    from {
        transform: scale(1.08);
    }
    to {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(107, 143, 94, 0.3);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(107, 143, 94, 0);
    }
}

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

/* ============================================================
   2. HERO ANIMATIONS
   ============================================================ */

.hero-bg {
    animation: heroBgZoom 12s ease-out forwards;
}

.hero-tagline {
    animation: heroReveal 0.8s ease-out 0.2s both;
}

.hero-title {
    animation: heroReveal 0.8s ease-out 0.4s both;
}

.hero-subtitle {
    animation: heroReveal 0.8s ease-out 0.6s both;
}

.hero-ctas {
    animation: heroReveal 0.8s ease-out 0.8s both;
}

/* ============================================================
   3. SCROLL-TRIGGERED REVEALS
   ============================================================ */

/* État initial — éléments invisibles avant le scroll */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.reveal-up {
    transform: translateY(30px);
}

.reveal-left {
    transform: translateX(-40px);
}

.reveal-right {
    transform: translateX(40px);
}

/* État visible — activé par Intersection Observer */
.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible {
    opacity: 1;
    transform: translate(0);
}

/* Délai progressif pour les grilles — équipements (12 cards) */
.equipment-card.reveal-up:nth-child(1) { transition-delay: 0s; }
.equipment-card.reveal-up:nth-child(2) { transition-delay: 0.06s; }
.equipment-card.reveal-up:nth-child(3) { transition-delay: 0.12s; }
.equipment-card.reveal-up:nth-child(4) { transition-delay: 0.18s; }
.equipment-card.reveal-up:nth-child(5) { transition-delay: 0.24s; }
.equipment-card.reveal-up:nth-child(6) { transition-delay: 0.30s; }
.equipment-card.reveal-up:nth-child(7) { transition-delay: 0.36s; }
.equipment-card.reveal-up:nth-child(8) { transition-delay: 0.42s; }
.equipment-card.reveal-up:nth-child(9) { transition-delay: 0.48s; }
.equipment-card.reveal-up:nth-child(10) { transition-delay: 0.54s; }
.equipment-card.reveal-up:nth-child(11) { transition-delay: 0.60s; }
.equipment-card.reveal-up:nth-child(12) { transition-delay: 0.66s; }

/* Délai progressif pour les activités (5 cards) */
.activity-card.reveal-up:nth-child(1) { transition-delay: 0s; }
.activity-card.reveal-up:nth-child(2) { transition-delay: 0.1s; }
.activity-card.reveal-up:nth-child(3) { transition-delay: 0.2s; }
.activity-card.reveal-up:nth-child(4) { transition-delay: 0.3s; }
.activity-card.reveal-up:nth-child(5) { transition-delay: 0.4s; }

/* Délai progressif pour les chambres (6 cards) */
.chambre-card.reveal-up:nth-child(1) { transition-delay: 0s; }
.chambre-card.reveal-up:nth-child(2) { transition-delay: 0.08s; }
.chambre-card.reveal-up:nth-child(3) { transition-delay: 0.16s; }
.chambre-card.reveal-up:nth-child(4) { transition-delay: 0.24s; }
.chambre-card.reveal-up:nth-child(5) { transition-delay: 0.32s; }
.chambre-card.reveal-up:nth-child(6) { transition-delay: 0.40s; }

/* ============================================================
   4. SECTION DIVIDERS
   ============================================================ */

.section::before {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-fresh), var(--color-accent));
    margin-bottom: var(--space-2xl);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.6s ease, width 0.6s ease;
}

.section.in-view::before {
    opacity: 1;
    width: 80px;
}

/* Pas de divider pour hero et section-alt */
.hero::before,
.section-alt::before,
.interstitial::before {
    display: none;
}

/* ============================================================
   5. HOVER MICRO-INTERACTIONS — V3
   ============================================================ */

/* Boutons — effet de reflet lumineux */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn:hover::after {
    transform: translateX(100%);
}

/* Cards — effet de reflet subtil haut */
.equipment-card::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.equipment-card:hover::after {
    opacity: 0.1;
}

/* FAQ — highlight au survol (déplacé dans style.css @media hover:hover) */

/* Lightbox — animation d'entrée */
.lightbox.active .lightbox-content img {
    animation: lightboxFadeIn 0.3s ease-out;
}

/* ============================================================
   6. LOADING STATES
   ============================================================ */

/* Skeleton shimmer pour le calendrier Smoobu */
.calendar-wrapper iframe {
    background: linear-gradient(
        90deg,
        var(--color-bg-section) 25%,
        var(--color-accent-lighter) 50%,
        var(--color-bg-section) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ============================================================
   7. PARALLAX SUBTIL (CSS only)
   ============================================================ */

@supports (background-attachment: fixed) {
    .hero-bg {
        background-attachment: fixed;
    }
}

/* Fix iOS parallax */
@supports (-webkit-touch-callout: none) {
    .hero-bg {
        background-attachment: scroll;
    }
}

/* ============================================================
   8. GALLERY FILTER ANIMATION
   ============================================================ */

.gallery-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-item.hidden {
    opacity: 0;
    transform: scale(0.95);
    position: absolute;
    pointer-events: none;
}
