/* ==========================================================================
   1. CONTENITORE ESTERNO (Centra il ticker nella pagina)
   ========================================================================== */
.body-ticker {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 12vh;
    width: 100%;
}

/* ==========================================================================
   2. CORNICE DEL TICKER (Limita la larghezza e nasconde l'overflow)
   ========================================================================== */
.news-ticker-container {
    width: 100%;
    max-width: 1000px;
    background-color: rgb(255, 255, 255);
    color: #0000FF;
    padding: 24px 0; /* Altezza interna del ticker */
    overflow: hidden; /* Fondamentale: nasconde il testo quando esce dai bordi */
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-radius: 5px;
}

/* ==========================================================================
   3. IL NASTRO SCORREVOLE (Contiene il testo e gestisce l'animazione)
   ========================================================================== */
.news-ticker {
    display: inline-block;
    white-space: nowrap;
    /* Aggiunto !important per forzare l'avvio immediato */
    animation: ticker 30s linear infinite !important; 
}

/* ==========================================================================
   4. I SINGOLI ELEMENTI DI TESTO / LINK
   ========================================================================== */
.news-ticker-item {
    display: inline-block;
    margin-right: 60px; /* Spazio tra una notizia e l'altra */
    font-size: 1.3rem;  /* Dimensione del testo leggibile */
}

.news-ticker-item:last-child {
    margin-right: 0; /* Rimuove lo spazio inutile dopo l'ultima notizia */
}

.news-ticker-item a {
    color: #000000;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-ticker-item a:hover {
    color: #66BB6A; /* Diventa verde chiaro al passaggio del mouse */
}

/* ==========================================================================
   5. ANIMAZIONE FLUIDA (Da destra completamente fuori, a sinistra fuori)
   ========================================================================== */
@keyframes ticker {
    0% {
        transform: translateX(60%); /* Inizia fuori schermo a destra */
    }
    100% {
        transform: translateX(-100%); /* Finisce fuori schermo a sinistra */
    }
}

/* ==========================================================================
   6. RESPONSIVITÀ (Ottimizzazioni per tablet e smartphone)
   ========================================================================== */
@media (max-width: 768px) {
    .news-ticker-container {
        padding: 16px 0;
    }
    .news-ticker-item {
        font-size: 1.1rem;
        margin-right: 40px;
    }
    .news-ticker {
        animation-duration: 20s; /* Accorcia il tempo perché lo schermo è più stretto */
    }
}

@media (max-width: 480px) {
    .news-ticker-container {
        padding: 10px 0;
    }
    .news-ticker-item {
        font-size: 0.95rem;
        margin-right: 25px;
    }
    .news-ticker {
        animation-duration: 15s;
    }
}