/* =================================================================== */
/* NUOVO WRAPPER PER IL BOX COMING SOON (REVISIONATO) */
/* =================================================================== */

.coming-soon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2; /* Sta sopra le immagini */
    margin: 0;
}

/* DESKTOP: La larghezza guida le dimensioni, mantenendo un aspect-ratio fisso */
@media (min-width: 769px) {
    .coming-soon-wrapper {
        width: 90%;
        max-width: 1200px;
        max-height: 90%;
        aspect-ratio: 16 / 9;
    }
}

/* MOBILE: Il box viene ridotto in altezza e spinto verso il basso */
@media (max-width: 768px) {
    .coming-soon-wrapper {
        width: 90%; /* Ridotto da 90% per avere più spazio ai lati */
        
        /* 
         * MODIFICA: Rendiamo il contenitore più alto che largo
         * Usiamo vh per l'altezza e manteniamo una larghezza percentuale
         */
        height: auto; /* Rimuoviamo l'altezza fissa in % */
        min-height: 70vh; /* Altezza minima in vh per occupare più spazio verticale */
        aspect-ratio: 3/4; /* Aspect ratio più verticale (3:4 invece di 16:9) */
        
        top: 5vh; /* Manteniamo lo spostamento verso il basso */
        margin-bottom: 10vh; /* Aggiungiamo margine inferiore per spingere il footer */
    }
}

/* =================================================================== */
/* STILI SVG E ANIMAZIONE */
/* =================================================================== */

#Coming_Soon {
    width: 100%;
    height: 100%;
    padding: 30px;
    display: block;
    position: relative;
    z-index: 3;
}

/* 1. FORZA TUTTO BIANCO */
#Coming_Soon path,
#Coming_Soon polygon,
#Coming_Soon .cls-1, 
#Coming_Soon .cls-2,
#Coming_Soon .cls-3 {
    fill: white !important;
    stroke: white !important;
    stroke-width: 0 !important;
}

/* 2. DEFINIZIONE ANIMAZIONE PER TUTTI I GRUPPI */
#Coming_Soon g {
    animation-name: wave-animation;
    animation-duration: 20s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-play-state: running;
    transform-origin: center;
    transform-box: fill-box;
    animation-fill-mode: both;
}

/* 3. KEYFRAME PER L'ANIMAZIONE ONDA */
@keyframes wave-animation {
    0%, 87.5% { transform: translateY(0px); }
    88.75% { transform: translateY(-15px); }
    90% { transform: translateY(0px); }
    91.25% { transform: translateY(8px); }
    92.5%, 100% { transform: translateY(0px); }
}

/* 4. RITARDI PER OGNI LETTERA */
#letter-c  { animation-delay: 0.0s; }
#letter-o1 { animation-delay: 0.1s; }
#letter-m  { animation-delay: 0.2s; }
#letter-i  { animation-delay: 0.3s; }
#letter-n1 { animation-delay: 0.4s; }
#letter-g  { animation-delay: 0.5s; }
#letter-s  { animation-delay: 0.8s; }
#logo      { animation-delay: 0.9s; }
#letter-o3 { animation-delay: 1.0s; }
#letter-n2 { animation-delay: 1.1s; }
#letter-dot1 { animation-delay: 1.5s; }
#letter-dot2 { animation-delay: 1.6s; }
#letter-dot3 { animation-delay: 1.7s; }

/* 5. MEDIA QUERIES PER ADATTARE IL PADDING */
@media (max-width: 768px) { #Coming_Soon { padding: 20px; } }
@media (max-width: 480px) { #Coming_Soon { padding: 15px; } }
@media (min-width: 769px) { #Coming_Soon { padding: 40px; } }
@media (min-width: 1200px) { #Coming_Soon { padding: 50px; } }

/* =================================================================== */
/* GESTIONE IMMAGINI FLUTTUANTI LOCALI (REVISIONATO) */
/* =================================================================== */

/* La section diventa il contenitore di riferimento e usa l'altezza calcolata via JS */
section#eventi:not(:has(.swiper-container-wrapper)) {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    overflow: hidden;
    
    /* Usa l'altezza calcolata da JS */
    /* Il valore di fallback viene usato se JS non è ancora partito */
    height: var(--main-area-height, calc(100vh - 180px)); 
}

/* Il container delle immagini si adatta alla section genitore */
.floating-images-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* =================================================================== */
/* STILI IMMAGINI E ANIMAZIONI */
/* =================================================================== */

.floating-image {
    position: absolute;
    width: 120px;
    height: 158px; /* Mantiene proporzioni 380x500 */
    pointer-events: none;
    z-index: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

@media (min-width: 769px) { .floating-image { width: 150px; height: 197px; } }
@media (min-width: 1200px) { .floating-image { width: 180px; height: 237px; } }
@media (min-width: 1200px) and (min-height: 900px) { .floating-image { width: 200px; height: 263px; } }
@media (max-width: 768px) { .floating-image { width: 100px; height: 132px; } }
@media (max-width: 480px) { .floating-image { width: 90px; height: 118px; } }

/* Animazione di fluttuazione continua */
@keyframes gentleFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(1deg); }
}

/* Ritardi e rotazioni per desincronizzare le animazioni */
.floating-image:nth-child(1) { animation-delay: 0s; transform: rotate(-3deg); }
.floating-image:nth-child(2) { animation-delay: 1s; transform: rotate(2deg); }
.floating-image:nth-child(3) { animation-delay: 2s; transform: rotate(-1deg); }
.floating-image:nth-child(4) { animation-delay: 3s; transform: rotate(4deg); }
.floating-image:nth-child(5) { animation-delay: 4s; transform: rotate(-2deg); }
.floating-image:nth-child(6) { animation-delay: 1.5s; transform: rotate(1deg); }
.floating-image:nth-child(7) { animation-delay: 2.5s; transform: rotate(-4deg); }

/* Stato di base: invisibile */
.floating-image {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

/* Quando l'immagine è visibile, l'opacità è 100% */
.floating-image.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    animation: gentleFloat 6s ease-in-out infinite;
}

.floating-image:hover {
    transform: scale(1.05); /* Mantiene solo l'ingrandimento al passaggio del mouse */
}