/* --- STILE GENERALE --- */
body { 
    font-family: 'Helvetica', Arial, sans-serif; 
    background: #f4f4f4; 
    margin: 0; 
    padding: 20px; 
}

.container { 
    max-width: 1100px; 
    margin: auto; 
}

/* --- MOSAICO NEWS --- */
.news-mosaic { 
    display: grid; 
    grid-template-columns: 1.5fr 1fr; 
    grid-template-rows: 250px 250px; 
    gap: 15px; 
}

.main-tile { 
    grid-row: span 2; 
    position: relative; 
    background-size: cover; 
    background-position: center; 
    border-radius: 8px; 
    overflow: hidden;
}

.small-tile { 
    position: relative; 
    background-size: cover; 
    background-position: center; 
    border-radius: 8px; 
    overflow: hidden;
}

.overlay { 
    position: absolute; bottom: 0; left: 0; right: 0; 
    background: linear-gradient(transparent, rgba(0,0,0,0.8)); 
    color: white; padding: 20px; 
}

.badge { 
    background: #e63946; 
    padding: 5px 10px; 
    font-size: 12px; 
    text-transform: uppercase; 
    border-radius: 3px; 
    display: inline-block;
}

h2 { margin: 10px 0 5px; font-size: 22px; }

@media (max-width: 768px) {
    .news-mosaic { grid-template-columns: 1fr; grid-template-rows: auto; }
    .main-tile, .small-tile { height: 300px; }
}

/* --- MODALE (POPUP) CENTRATA - FIX DEFINITIVO --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 99999; 
    left: 0; 
    top: 0; 
    width: 100vw; 
    height: 100vh; 
    background-color: rgba(0,0,0,0.85); 
    
    /* Centratura Flexbox */
    align-items: center; 
    justify-content: center;
    border: none;
}

.modal-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh; 
    overflow-y: auto; 
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    /* Rimosso margin-top per evitare lo slittamento */
    margin: 0; 
}

.close {
    position: sticky;
    top: 0;
    float: right;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    line-height: 20px;
    background: white; /* Per coprire il testo sotto quando scorri */
    padding: 5px;
}

#modalTesto {
    white-space: pre-wrap; 
    font-size: 16px;
    margin-top: 20px;
    color: #333;
    line-height: 1.6;
    text-align: left;
}