/* =========================================
   1. RESET E IMPOSTAZIONI DI BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f9f9f9;
    color: #222;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
}

/* =========================================
   2. HEADER E NAVIGAZIONE
   ========================================= */
header {
    background-color: #004d40;
    padding: 20px 0;
    color: white;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-weight: 700;
    letter-spacing: 1.2px;
}

.menu {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
}

.menu li a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 6px 12px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.menu li a:hover,
.menu li a[aria-current="page"] {
    background-color: rgba(255, 255, 255, 0.1);
    font-weight: bold;
    border-bottom: 2px solid #ffffff;
}

/* =========================================
   3. ELEMENTI COMUNI (Titoli, Testi)
   ========================================= */
h2 {
    color: #00796b;
    border-bottom: 3px solid #004d40;
    padding-bottom: 6px;
    margin-bottom: 20px;
}

p {
    margin-bottom: 15px;
}

/* =========================================
   4. CARD E LINK DELLA HOME PAGE
   ========================================= */
/* Box grandi nella Home (Strutture e News) */
.campi-link, 
.news-link {
    display: block;
    background-color: #e0f2f1;
    border: 2px solid #004d40;
    border-radius: 8px;
    padding: 20px;
    color: #004d40;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 20px;
    width: 100%; /* Forza la larghezza piena */
}

.campi-link:hover, 
.news-link:hover {
    background-color: #b2dfdb;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

/* Toglie i puntini dalla lista delle news in Home e rimuove margini strani */
#news ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

#news li {
    width: 100%;
}

.campi-link p,
.news-link p,
.news-link small {
    color: #004d40;
    margin-bottom: 5px;
}

/* =========================================
   5. SEZIONI IN FONDO ALLA HOME (Contatti, Indirizzo, Social)
   ========================================= */
/* Questo raggruppa le sezioni finali per renderle ordinate come "card" bianche */
#contatti, #indirizzo, #social {
    background-color: #ffffff;
    border-left: 5px solid #004d40; /* Linea verde a sinistra */
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#contatti h2, #indirizzo h2, #social h2 {
    font-size: 1.5rem;
    border-bottom: none; /* Toglie la linea sotto al titolo in queste sezioni */
    margin-bottom: 10px;
    color: #004d40;
}

.maps-link {
    display: inline-block;
    margin-top: 10px;
    font-weight: bold;
    color: #1e62d0;
    text-decoration: none;
}

.maps-link:hover {
    text-decoration: underline;
}

/* Icone social */
#social i {
    transition: transform 0.3s ease;
    margin-right: 15px; /* Spazio tra le icone */
}

#social i:hover {
    transform: scale(1.2);
}

/* =========================================
   6. SEZIONE CAMPI (Pagina Campi.html)
   ========================================= */
#campi {
    margin-bottom: 60px;
}

.campo {
    background-color: #e0f2f1;
    border: 2px solid #004d40;
    border-radius: 10px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.campo h2 {
    color: #004d40;
    font-size: 1.8rem;
    border-bottom: none; 
}

/* Galleria Immagini */
.galleria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.galleria img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.galleria img:hover {
    transform: scale(1.05);
}

/* =========================================
   7. SEZIONE NEWS (Pagina News.html)
   ========================================= */
/* Nota: ho rimosso la max-width specifica qui per uniformare con la home */
section#news article {
    background-color: white;
    padding: 25px 30px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-left: 5px solid #004d40;
}

section#news article h2 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    border-bottom: none;
}

section#news article h2 a {
    color: #1e62d0;
    text-decoration: none;
}

section#news article h2 a:hover {
    text-decoration: underline;
}

section#news article small {
    display: block;
    color: #888;
    font-size: 0.9rem;
    margin-top: 10px;
    font-style: italic;
}

/* Stile pagina articolo singolo */
.articolo-singolo {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

/* =========================================
   8. SEZIONE MAESTRI (FIX FOTO)
   ========================================= */
.maestri-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.maestro-card {
    flex: 1 1 300px;
    max-width: 400px;
    background-color: #e0f2f1;
    border: 2px solid #004d40;
    border-radius: 8px;
    padding: 20px;
    color: #004d40;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    display: block;
}

.maestro-card:hover {
    background-color: #b2dfdb;
    transform: translateY(-5px);
}

.maestro-card img {
    border-radius: 50%;
    width: 150px;
    height: 150px;
    
    /* QUESTE DUE RIGHE SISTEMANO LA FOTO TAGLIATA */
    object-fit: cover; 
    object-position: top; /* <--- Questo fa vedere la testa e non la pancia! */

    margin-bottom: 15px;
    border: 3px solid #004d40;
    background-color: white; /* Utile se l'immagine ha trasparenza o carica male */
}

/* =========================================
   9. FOOTER E MODAL
   ========================================= */
footer {
    background-color: #004d40;
    color: white;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
    margin-top: auto;
    width: 100%;
}

footer a {
    color: #e0f2f1;
    text-decoration: underline;
}

#modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#modal img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

#modal .close {
    position: fixed;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu {
        flex-direction: column;
        gap: 10px;
        padding-bottom: 10px;
    }

    .maestri-list {
        flex-direction: column;
        align-items: center;
    }
    
    .container, main {
        width: 95%;
    }
}

/* =========================================
   10. STILE TABELLA PREZZI (Pagina Campi)
   ========================================= */
#tariffe {
    margin-top: 40px;
    margin-bottom: 60px;
}

.tabella-container {
    overflow-x: auto; /* Permette di scorrere su cellulari piccoli */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* Ombra elegante */
}

table {
    width: 100%;
    border-collapse: collapse; /* Toglie gli spazi tra le celle */
    background-color: white;
    min-width: 300px;
}

/* Intestazione verde scuro */
thead th {
    background-color: #004d40;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Celle della tabella */
tbody td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    color: #333;
    font-size: 1.05rem;
}

/* Colora le righe pari in grigio chiaro per leggere meglio */
tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Effetto al passaggio del mouse */
tbody tr:hover {
    background-color: #b2dfdb; /* Diventa verde chiaro quando passi sopra */
    transition: background-color 0.2s ease;
}

/* Evidenzia la prima colonna (Orario) */
tbody td:first-child {
    color: #004d40;
    font-weight: bold;
    text-align: left;
    padding-left: 20px;
}