@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;700&display=swap');

.mns-ticker-wrapper {
    max-width: 1200px;
    width: 100%;
    margin: 20px auto !important; /* Spazio equilibrato sopra e sotto */
    background: #fff;
    height: 55px; /* Un po' più alto per eleganza */
    border-radius: 50px;
    overflow: hidden;
    position: relative;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    display: none; /* Gestito dal JS per evitare "salti" visivi */
}

.mns-ticker-badge {
    position: absolute;
    left: 0; top: 0; height: 100%;
    background: #8f1c03;
    color: #fff;
    font-weight: 700; font-size: 11px;
    display: flex; align-items: center;
    padding: 0 30px 0 20px;
    z-index: 10;
    clip-path: polygon(0 0, 85% 0, 100% 100%, 0% 100%);
    text-transform: uppercase;
}

.mns-ticker-content { 
    margin-left: 110px; 
    height: 100%; 
    display: flex; 
    align-items: center; 
}

/* --- L'ANIMAZIONE CHE FA CAMMINARE LE NEWS --- */
.mns-ticker-scroll {
    display: flex; 
    align-items: center; 
    white-space: nowrap;
    animation: mns-loop 60s linear infinite; /* 60s è una velocità elegante */
}

.mns-ticker-item {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    height: 40px;
    padding: 0 25px !important;
    margin: 0 10px !important;
    background: #fcf6e8;
    border-radius: 30px;
    border: 1px solid #ebebeb;
    flex-shrink: 0;
}

.mns-ticker-thumb {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    margin-right: 12px !important;
    border: 2px solid #fff;
}

.mns-ticker-title {
    color: #222; font-size: 14px; font-weight: 500;
}

/* Pausa al passaggio del mouse */
.mns-ticker-wrapper:hover .mns-ticker-scroll {
    animation-play-state: paused;
}

/* KEYFRAMES PER LO SCORRIMENTO */
@keyframes mns-loop {
    0% { transform: translateX(0); }
    100% { transform: translateX(-33.333%); } /* Funziona con la lista triplicata nel PHP */
}

/* --- ADATTAMENTO MOBILE CORRETTO --- */
@media (max-width: 768px) {
    .mns-ticker-wrapper {
        display: block !important; /* Forza il comportamento a blocco */
        width: 100% !important;    /* Prende tutto lo spazio disponibile */
        max-width: 100vw !important; /* Ma non supera mai la larghezza dello schermo */
        height: 50px;
        margin: 15px auto !important; /* AUTO qui è fondamentale per centrare se il contenitore è più largo */
        border-radius: 50px; /* Ripristiniamo la pillola, ma se preferisci dritto metti 0 */
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        box-sizing: border-box !important;
    }
    
    .mns-ticker-badge {
        font-size: 10px;
        padding-left: 15px;
        padding-right: 20px;
    }
    
    .mns-ticker-content {
        margin-left: 90px;
    }

    .mns-ticker-title {
        font-size: 13px;
    }
}