/* ========================================
   MSM HERO EFFECTS - PARALLAX + KEN BURNS
   Per pagine interne
   ======================================== */

/* 
   ISTRUZIONI:
   Aggiungi la classe CSS "msm-hero-parallax" al blocco Cover/Container 
   dell'hero nella pagina che vuoi animare
*/

.msm-hero-parallax {
    position: relative;
    overflow: hidden;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Parallax: l'immagine di sfondo si muove più lentamente */
.msm-hero-parallax .wp-block-cover__image-background,
.msm-hero-parallax .wp-block-cover__video-background,
.msm-hero-parallax img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform;
    transform: translateZ(0);
    /* Inizia leggermente scalata per Ken Burns */
    transform: scale(1.1) translateY(0);
}

/* Ken Burns: zoom + movimento lento */
@keyframes kenBurns {
    0% {
        transform: scale(1.1) translateY(0);
    }
    100% {
        transform: scale(1.2) translateY(-20px);
    }
}

.msm-hero-parallax .wp-block-cover__image-background,
.msm-hero-parallax .wp-block-cover__video-background,
.msm-hero-parallax img {
    animation: kenBurns 20s ease-in-out infinite alternate;
}

/* Overlay del blocco Cover */
.msm-hero-parallax .wp-block-cover__background {
    opacity: 0.5 !important;
}

/* Contenuto interno (testo) */
.msm-hero-parallax .wp-block-cover__inner-container {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* Fade in del testo */
.msm-hero-parallax .wp-block-cover__inner-container h1,
.msm-hero-parallax .wp-block-cover__inner-container h2,
.msm-hero-parallax .wp-block-cover__inner-container p {
    opacity: 0;
    animation: fadeInUp 1.2s ease-out 0.3s forwards;
}

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

/* Responsive: riduce movimento su mobile */
@media (max-width: 768px) {
    .msm-hero-parallax {
        min-height: 50vh;
    }
    
    @keyframes kenBurns {
        0% {
            transform: scale(1.05) translateY(0);
        }
        100% {
            transform: scale(1.1) translateY(-10px);
        }
    }
}

/* ========================================
   VARIANTI OPZIONALI
   ======================================== */

/* Variante: Ken Burns più veloce */
.msm-hero-parallax.fast-animation .wp-block-cover__image-background,
.msm-hero-parallax.fast-animation img {
    animation-duration: 10s;
}

/* Variante: Ken Burns più lento */
.msm-hero-parallax.slow-animation .wp-block-cover__image-background,
.msm-hero-parallax.slow-animation img {
    animation-duration: 30s;
}

/* Variante: overlay più scuro */
.msm-hero-parallax.dark-overlay .wp-block-cover__background {
    opacity: 0.7 !important;
}

/* Variante: nessun overlay */
.msm-hero-parallax.no-overlay .wp-block-cover__background {
    opacity: 0 !important;
}
