/* --- 1. CONFIGURAZIONE COLORI --- */
:root {
    --primary: #002e5d; /* Blu scuro del Logo */
    --accent: #b5011b;  /* Rosso accento */
    --secondary: #b5011b; /* Alias accento (usato nella sezione Storia) */
    --dark: #111111;
    --light: #f4f6f8;
    --white: #ffffff;
    --gray: #666;
    --padding-section: 80px 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Roboto', sans-serif;
    color: var(--dark);
    line-height: 1.6;
    background-color: var(--white);
}

h1, h2, h3, h4 { font-family: 'Montserrat', sans-serif; text-transform: uppercase; letter-spacing: 0.5px; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* --- HEADER --- */
header {
    background: var(--primary);
    padding: 10px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 60px; vertical-align: middle; }

.nav-links { display: flex; gap: 25px; align-items: center; }
.nav-links a { color: var(--white); font-weight: 500; font-size: 0.95rem; text-transform: uppercase; }
.nav-links a:hover { color: #ccc; }

.cta-button { 
    background: var(--accent); 
    padding: 10px 25px; 
    border-radius: 4px; 
    font-weight: bold; 
}
.cta-button:hover { background: #d90120; color: white !important; }

/* Mobile Menu */
.burger { display: none; cursor: pointer; margin-left: auto; }
.burger div { width: 25px; height: 3px; background-color: var(--white); margin: 5px; transition: 0.3s; }

/* --- HERO SECTION --- */
#home {
    height: 100vh;
    /* AGGIORNATO: Punta alla cartella img/ */
    background: url('img/background.png') no-repeat center center/cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    margin-top: 60px;
}
.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(0,46,93,0.8), rgba(0,0,0,0.6)); /* Blu traslucido */
}
.hero-content { position: relative; z-index: 2; padding: 0 20px; }
.hero-content h1 { font-size: 3.5rem; margin-bottom: 20px; font-weight: 800; text-shadow: 2px 2px 10px rgba(0,0,0,0.5); }
.hero-content p { font-size: 1.3rem; margin-bottom: 30px; max-width: 700px; margin-left: auto; margin-right: auto; }
.btn-hero { background: var(--accent); color: var(--white); padding: 15px 35px; border-radius: 5px; font-weight: bold; font-size: 1.1rem; }
.btn-hero:hover { background: var(--white); color: var(--accent); }

/* --- SEZIONI COMUNI --- */
section { padding: var(--padding-section); }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 40px; color: var(--primary); position: relative; }
.section-title::after { content: ''; width: 80px; height: 4px; background: var(--accent); position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); }
.sub-title { font-size: 1.5rem; color: var(--primary); margin-bottom: 20px; border-left: 5px solid var(--accent); padding-left: 15px; }

/* --- CHI SIAMO & ORGANIGRAMMA --- */
.about-intro { margin-bottom: 50px; text-align: center; font-size: 1.1rem; max-width: 900px; margin-left: auto; margin-right: auto; }

.organigramma-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    background: var(--light);
    padding: 30px;
    border-radius: 8px;
}
.org-item { border-bottom: 1px solid #ddd; padding: 10px 0; }
.org-item:last-child { border-bottom: 1px solid #ddd; padding: 10px 0; }

/* Staff Grid */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.staff-card { text-align: center; padding: 20px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); border-radius: 10px; transition: 0.3s; }
.staff-card:hover { transform: translateY(-5px); }
.staff-img {
    width: 150px; height: 150px; margin: 0 auto 15px;
    border-radius: 50%; background-size: cover; background-position: center; border: 4px solid var(--primary);
}
.staff-card h4 { color: var(--primary); margin-bottom: 5px; }
.staff-card p { font-size: 0.9rem; color: var(--gray); }

/* Sponsor */
.sponsor-section { margin-top: 60px; text-align: left; }
.sponsor-container { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; align-items: center; }
.sponsor-logo { max-height: 170px; filter: grayscale(100%); transition: 0.3s; }
.sponsor-logo:hover { filter: grayscale(0%); }

/* --- SQUADRE (Griglia) --- */
/* Riduce lo spazio bianco tra i loghi partner e la sezione Squadre */
#chi-siamo { padding-bottom: 30px; }
#squadre { background: var(--white); padding-top: 35px; }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.team-card { 
    position: relative; 
    height: 250px; 
    border-radius: 10px; 
    overflow: hidden; 
    cursor: pointer; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.team-card img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.team-card:hover img { transform: scale(1.1); }
.team-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: rgba(0, 46, 93, 0.9); padding: 15px; text-align: center; color: white;
}
.team-overlay h3 { margin: 0; font-size: 1.2rem; }

/* --- ORARI --- */
.schedule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.schedule-card { 
    background: var(--white); padding: 30px; border-radius: 8px; 
    border-top: 4px solid var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.schedule-card h3 { color: var(--primary); margin-bottom: 5px; }
.schedule-years { display: block; font-size: 0.9rem; color: #777; margin-bottom: 15px; font-weight: bold; }
.schedule-card ul li { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #eee; font-size: 0.95rem; }
.schedule-card ul li:last-child { border: none; }

/* --- FOOTER --- */
footer { background: var(--primary); color: white; padding: 50px 0 20px; }
.footer-top { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 30px; }
.footer-info h4, .footer-docs h4 { color: var(--accent); margin-bottom: 20px; }
.footer-info p { margin-bottom: 10px; font-size: 0.9rem; }
.footer-docs ul li { margin-bottom: 8px; }
.footer-docs ul li a { font-size: 0.9rem; border-bottom: 1px dotted #ccc; }
.footer-docs ul li a:hover { color: var(--accent); border-bottom: 1px solid var(--accent); }
.copyright { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; font-size: 0.8rem; color: #ccc; }

/* --- STILE MODALI (Popup Squadre) --- */
.modal {
    display: none; /* Nascosto di default */
    position: fixed; 
    z-index: 2000; 
    left: 0; top: 0; 
    width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.9); 
    align-items: center; justify-content: center;
    overflow-y: auto;
}
.modal-content {
    background-color: #fff;
    width: 90%; max-width: 800px;
    padding: 30px;
    border-radius: 10px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}
@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.close-btn {
    position: absolute; top: 15px; right: 20px;
    font-size: 30px; font-weight: bold; color: #333; cursor: pointer;
}
.close-btn:hover { color: var(--accent); }
.modal-img { width: 100%; height: 300px; object-fit: cover; border-radius: 5px; margin-bottom: 20px; }
.modal h2 { color: var(--primary); margin-bottom: 20px; border-bottom: 2px solid var(--accent); padding-bottom: 10px; }

.roster-group { margin-bottom: 20px; }
.roster-group h4 { color: var(--accent); font-size: 1.1rem; margin-bottom: 5px; }
.roster-group p { font-size: 0.95rem; line-height: 1.5; }
.coach-box { 
    background: var(--light); padding: 15px; border-radius: 5px; 
    margin-top: 20px; border-left: 4px solid var(--primary); 
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .nav-links {
        position: absolute; right: 0; top: 80px;
        background: var(--primary);
        flex-direction: column; width: 100%; text-align: center;
        padding: 30px 0; transform: translateX(100%); transition: transform 0.3s ease-in;
    }
    .nav-links.nav-active { transform: translateX(0%); }
    .burger { display: block; }
    .toggle .line1 { transform: rotate(-45deg) translate(-5px, 6px); }
    .toggle .line2 { opacity: 0; }
    .toggle .line3 { transform: rotate(45deg) translate(-5px, -6px); }
    
    .hero-content h1 { font-size: 2.2rem; }
    .footer-top { grid-template-columns: 1fr; }
    .modal-content { width: 95%; padding: 20px; }
    .modal-img { height: 200px; }
}

/* Stile Modale Storia */
.history-content {
    max-width: 800px; /* Più largo per leggere meglio */
    width: 90%;
    max-height: 90vh; /* Non supera l'altezza dello schermo */
    display: flex;
    flex-direction: column;
}

.history-text-scroll {
    overflow-y: auto; /* Abilita lo scroll solo per il testo */
    padding-right: 10px;
    text-align: justify;
    line-height: 1.6;
}

.history-text-scroll p {
    margin-bottom: 15px;
}

.history-text-scroll h3 {
    color: var(--primary);
    margin-top: 25px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--secondary);
    display: inline-block;
}

/* Scrollbar personalizzata per la storia */
.history-text-scroll::-webkit-scrollbar {
    width: 8px;
}
.history-text-scroll::-webkit-scrollbar-thumb {
    background-color: var(--secondary);
    border-radius: 4px;
}