/* ============================================================
   Effegi Volley School — foglio di stile unico
   Sostituisce gli stili inline duplicati nelle 7 pagine statiche.
   ============================================================ */

:root {
    --navy:        #096a8d;
    --navy-scuro:  #0C1C3A;
    --navy-card:   #1B3A6B;
    --teal:        #1FB6AE;
    --magenta:     #D6318F;
    --sfondo:      #F6F7FA;
    --sfondo-alt:  #EEF1F6;
    --testo:       #16202E;
    --testo-2:     #5B6472;
    --testo-3:     #8A93A6;
    --su-navy:     #C6CEDD;
    --su-navy-2:   #B9C4DA;
    --su-navy-3:   #8B96AE;

    --titolo: 'Poppins', sans-serif;
    --corpo:  'Inter', sans-serif;

    --raggio:    20px;
    --raggio-sm: 14px;
    --pillola:   999px;
    --ombra:     0 8px 24px rgba(20, 43, 87, 0.08);
    --ombra-alta:0 2px 12px rgba(0, 0, 0, 0.15);

    --gutter: 56px;
    --max:    1200px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--corpo);
    background: var(--sfondo);
    color: var(--testo);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: .85; }
img { max-width: 100%; height: auto; display: block; }

.contenitore { max-width: var(--max); margin: 0 auto; padding: 90px var(--gutter); }
.sezione-alt { background: var(--sfondo-alt); }
.sezione-navy { background: var(--navy); }

/* --- Header ------------------------------------------------ */
.nav {
    position: sticky; top: 0; z-index: 100;
    background: var(--navy);
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px; padding: 14px var(--gutter);
    box-shadow: var(--ombra-alta);
}
.nav-brand { display: flex; align-items: center; gap: 14px; }
.nav-brand img {
    width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .25);
}
.nav-brand-nome {
    font-family: var(--titolo); font-weight: 800; color: #fff;
    font-size: 16px; letter-spacing: .3px;
}
.nav-brand-citta {
    font-family: var(--titolo); font-weight: 600; color: var(--teal);
    font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
}
.nav-menu { display: flex; gap: 28px; flex-wrap: wrap; }
.nav-menu a {
    font-family: var(--titolo); font-weight: 600; font-size: 14px; color: var(--su-navy-2);
}
.nav-menu a.attivo { font-weight: 700; color: #fff; }
.nav-cta {
    background: var(--magenta); color: #fff; font-family: var(--titolo);
    font-weight: 700; font-size: 13px; padding: 10px 22px;
    border-radius: var(--pillola); white-space: nowrap;
}
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; }

/* --- Bottoni ----------------------------------------------- */
.btn {
    display: inline-block; font-family: var(--titolo); font-weight: 700;
    font-size: 15px; padding: 15px 28px; border-radius: var(--pillola);
    border: 0; cursor: pointer;
}
.btn-magenta { background: var(--magenta); color: #fff; }
.btn-navy    { background: var(--navy);    color: #fff; }
.btn-bordo   { background: transparent; color: #fff; padding: 13px 28px;
               border: 2px solid rgba(255, 255, 255, .35); }
.btn-bianco  { background: transparent; color: #fff; padding: 13px 30px; border: 2px solid #fff; }
.link-freccia { font-family: var(--titolo); font-weight: 700; font-size: 14px; color: var(--magenta); }
.link-teal    { font-family: var(--titolo); font-weight: 700; font-size: 13px; color: var(--teal); }

/* --- Titoli ------------------------------------------------ */
.occhiello {
    font-family: var(--titolo); font-weight: 700; font-size: 13px;
    letter-spacing: 2px; text-transform: uppercase;
}
.occhiello-teal    { color: var(--teal); }
.occhiello-magenta { color: var(--magenta); }
.occhiello-tenue   { color: var(--testo-3); }
h1.hero-titolo {
    font-family: var(--titolo); font-weight: 800; font-size: 56px;
    line-height: 1.08; margin: 20px 0 24px; text-wrap: pretty;
}
h2.sezione-titolo {
    font-family: var(--titolo); font-weight: 800; font-size: 32px;
    color: var(--navy); margin: 0;
}
.sezione-navy h2.sezione-titolo { color: #fff; }
.sezione-intestazione {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 36px; flex-wrap: wrap; gap: 12px;
}

/* --- Hero -------------------------------------------------- */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-scuro) 100%);
    color: #fff; padding: 96px var(--gutter) 110px;
    display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center;
}
.hero p { font-size: 18px; line-height: 1.6; color: var(--su-navy); max-width: 520px; margin: 0 0 36px; }
.hero-azioni { display: flex; gap: 16px; flex-wrap: wrap; }

/* --- Segnaposto immagine (sostituisce i pattern a righe inline) --- */
.media-slot {
    background: repeating-linear-gradient(45deg, #E7EAF0, #E7EAF0 12px, #EEF0F4 12px, #EEF0F4 24px);
    border-radius: var(--raggio); aspect-ratio: 4 / 3;
    display: flex; align-items: center; justify-content: center;
    color: var(--testo-3); font-family: monospace; font-size: 12px;
}
.media-slot-scuro {
    background: repeating-linear-gradient(45deg, rgba(255,255,255,.06), rgba(255,255,255,.06) 12px,
                rgba(255,255,255,.02) 12px, rgba(255,255,255,.02) 24px);
    border: 1px solid rgba(255, 255, 255, .12); border-radius: 24px; color: #93A3C2;
}

/* --- Card -------------------------------------------------- */
.griglia-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.griglia-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.card {
    background: #fff; border-radius: var(--raggio); padding: 32px; box-shadow: var(--ombra);
}
.card h3 {
    font-family: var(--titolo); font-weight: 700; font-size: 20px;
    color: var(--navy); margin: 0 0 10px;
}
.card p { font-size: 15px; color: var(--testo-2); line-height: 1.6; margin: 0 0 18px; }
.card-pastiglia { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 20px; }
.card-news { background: var(--navy-card); border-radius: 18px; padding: 26px; }
.card-news h3 { font-family: var(--titolo); font-weight: 700; font-size: 18px; color: #fff; margin: 12px 0 10px; }
.card-news p  { font-size: 14px; color: var(--su-navy-2); line-height: 1.6; margin: 0; }
.card-news .etichetta {
    font-family: var(--titolo); font-weight: 600; font-size: 12px;
    letter-spacing: 1px; text-transform: uppercase;
}
.etichetta-comunicato { color: var(--teal); }
.etichetta-risultati  { color: var(--magenta); }
.etichetta-evento     { color: var(--teal); }

/* --- Tabella partite --------------------------------------- */
.tabella-partite { background: #fff; border-radius: var(--raggio); box-shadow: var(--ombra); overflow: hidden; }
.riga-partita {
    display: grid; grid-template-columns: 1.2fr 1.6fr 1fr 1fr;
    padding: 22px 28px; border-bottom: 1px solid var(--sfondo-alt); align-items: center;
}
.riga-partita:last-child { border-bottom: 0; }
.riga-partita .squadra { font-family: var(--titolo); font-weight: 700; font-size: 14px; color: var(--navy); }
.riga-partita .sfida   { font-size: 14px; color: var(--testo-2); }
.riga-partita .meta    { font-size: 13px; color: var(--testo-3); }

/* --- CTA finale -------------------------------------------- */
.cta-gradiente {
    background: linear-gradient(120deg, var(--teal) 0%, var(--magenta) 100%);
    padding: 80px var(--gutter); text-align: center;
}
.cta-gradiente h2 { font-family: var(--titolo); font-weight: 800; font-size: 34px; color: #fff; margin: 0 0 16px; }
.cta-gradiente p  { font-size: 17px; color: rgba(255,255,255,.95); max-width: 560px; margin: 0 auto 32px; line-height: 1.6; }
.cta-azioni { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* --- Footer ------------------------------------------------ */
.footer { background: var(--navy-scuro); color: var(--su-navy); padding: 64px var(--gutter) 32px; }
.footer-griglia {
    display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: 40px;
    max-width: var(--max); margin: 0 auto;
}
.footer-titolo { font-family: var(--titolo); font-weight: 700; font-size: 13px; color: #fff; }
.footer-colonna { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; font-size: 14px; }
.footer-testo { font-size: 14px; line-height: 1.6; color: var(--su-navy-3); max-width: 280px; margin: 0; }
.footer-basso {
    max-width: var(--max); margin: 40px auto 0; padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,.1);
    display: flex; justify-content: space-between; font-size: 12px; color: #5F6B85;
    flex-wrap: wrap; gap: 8px;
}

/* --- Form -------------------------------------------------- */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.campo label { font-family: var(--titolo); font-weight: 600; font-size: 13px; color: var(--navy); }
.campo input, .campo textarea {
    font-family: var(--corpo); font-size: 15px; padding: 13px 16px;
    border: 1px solid #DDE2EB; border-radius: 12px; background: #fff; color: var(--testo);
}
.campo input:focus-visible, .campo textarea:focus-visible {
    outline: 2px solid var(--teal); outline-offset: 2px; border-color: var(--teal);
}
.campo textarea { min-height: 140px; resize: vertical; }
.campo-errore { color: #C0264F; font-size: 13px; }
.campo input[aria-invalid="true"], .campo textarea[aria-invalid="true"] { border-color: #C0264F; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.avviso { border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; font-size: 15px; }
.avviso-successo { background: #E4F6F4; color: #0F5F5A; border: 1px solid #9FDCD7; }
.avviso-errore   { background: #FBE7EE; color: #8C1B3B; border: 1px solid #F0AFC4; }

/* --- Galleria ---------------------------------------------- */
.griglia-galleria {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.galleria-foto {
    border-radius: var(--raggio-sm);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
}
.galleria-slot { border-radius: var(--raggio-sm); }

/* --- Sponsor ----------------------------------------------- */
.sponsor-slot {
    background: repeating-linear-gradient(45deg, #E7EAF0, #E7EAF0 10px, #EEF0F4 10px, #EEF0F4 20px);
    border-radius: var(--raggio-sm); height: 80px;
    display: flex; align-items: center; justify-content: center;
    color: var(--testo-3); font-family: monospace; font-size: 11px;
}
.sponsor-logo {
    background: #fff; border-radius: var(--raggio-sm); height: 80px;
    display: flex; align-items: center; justify-content: center; padding: 12px;
    box-shadow: var(--ombra);
}
.sponsor-logo img { max-height: 100%; width: auto; object-fit: contain; }

/* --- Staff ------------------------------------------------- */
.griglia-staff { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.staff-card { text-align: center; }
.staff-foto {
    width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; margin-bottom: 14px;
}
.staff-slot {
    width: 100%; aspect-ratio: 1; border-radius: 50%; margin-bottom: 14px;
    background: repeating-linear-gradient(45deg, #E7EAF0, #E7EAF0 10px, #EEF0F4 10px, #EEF0F4 20px);
    display: flex; align-items: center; justify-content: center;
    color: var(--testo-3); font-family: monospace; font-size: 11px;
}
.staff-nome { font-family: var(--titolo); font-weight: 700; font-size: 16px; color: var(--navy); }
.staff-ruolo { font-size: 14px; color: var(--testo-3); }

/* --- Valori (Chi Siamo) ------------------------------------ */
.valore h3 { font-family: var(--titolo); font-weight: 700; font-size: 18px; color: var(--navy); margin: 0 0 8px; }
.valore p  { font-size: 15px; color: var(--testo-2); line-height: 1.6; margin: 0; }
.valore-barra { width: 40px; height: 4px; border-radius: 2px; margin-bottom: 16px; }

/* --- Responsive (assente nel sito statico) ------------------ */
@media (max-width: 1024px) {
    :root { --gutter: 32px; }
    .hero { grid-template-columns: 1fr; padding: 64px var(--gutter) 72px; }
    h1.hero-titolo { font-size: 42px; }
    .griglia-3 { grid-template-columns: repeat(2, 1fr); }
    .griglia-5 { grid-template-columns: repeat(3, 1fr); }
    .griglia-staff { grid-template-columns: repeat(2, 1fr); }
    .footer-griglia { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    :root { --gutter: 20px; }
    .contenitore { padding: 56px var(--gutter); }
    .nav { flex-wrap: wrap; }
    .nav-toggle { display: block; }
    .nav-menu {
        display: none; width: 100%; flex-direction: column; gap: 14px; padding: 14px 0 4px;
    }
    .nav-menu.aperto { display: flex; }
    .nav-cta { order: 2; }
    h1.hero-titolo { font-size: 32px; }
    h2.sezione-titolo { font-size: 24px; }
    .griglia-3, .griglia-5 { grid-template-columns: 1fr; }
    .riga-partita { grid-template-columns: 1fr; gap: 4px; }
    .footer-griglia { grid-template-columns: 1fr; }
    .footer-basso { flex-direction: column; }
    .cta-gradiente h2 { font-size: 26px; }
}

/* ============================================================
   Preloader — palla da pallavolo che rimbalza
   ============================================================ */

#preloader {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--navy);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 44px;
    opacity: 1;
    transition: opacity .5s ease;
}
#preloader.preloader-uscita { opacity: 0; }

body.preloader-attivo { overflow: hidden; }

.preloader-scena {
    position: relative; width: 120px; height: 150px;
    display: flex; align-items: flex-start; justify-content: center;
}

.preloader-palla {
    /* Due animazioni indipendenti: il rimbalzo e la rotazione hanno durate diverse,
       così la palla non ritorna mai nella stessa posizione angolare — sembra reale. */
    animation:
        palla-rimbalzo .78s cubic-bezier(.35, 0, .6, 1) infinite alternate,
        palla-rotazione 1.6s linear infinite;
    transform-origin: 50% 50%;
    will-change: transform;
}

.preloader-ombra {
    position: absolute; bottom: 0; left: 50%;
    width: 72px; height: 12px; margin-left: -36px;
    background: rgba(0, 0, 0, .35);
    border-radius: 50%;
    filter: blur(3px);
    animation: ombra-impatto .78s cubic-bezier(.35, 0, .6, 1) infinite alternate;
}

.preloader-testo {
    font-family: var(--titolo); font-weight: 700; font-size: 14px;
    letter-spacing: 3px; text-transform: uppercase; color: var(--teal);
    margin: 0; animation: testo-pulsazione 1.8s ease-in-out infinite;
}

@keyframes palla-rimbalzo {
    /* Da terra verso l'alto. La curva rende la salita più lenta della discesa. */
    from { transform: translateY(52px) scaleY(.92) scaleX(1.06); }
    to   { transform: translateY(0)    scaleY(1)   scaleX(1); }
}

@keyframes palla-rotazione {
    from { rotate: 0deg; }
    to   { rotate: 360deg; }
}

@keyframes ombra-impatto {
    /* L'ombra è larga e scura all'impatto, stretta e tenue quando la palla è in alto. */
    from { transform: scaleX(1);  opacity: .38; }
    to   { transform: scaleX(.55); opacity: .16; }
}

@keyframes testo-pulsazione {
    0%, 100% { opacity: .45; }
    50%      { opacity: 1; }
}

@keyframes contenuto-entrata {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

body.home main > section:first-child.contenuto-entra {
    animation: contenuto-entrata .6s ease both;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    /* Niente rimbalzo per chi ha disturbi vestibolari: la palla resta ferma,
       l'overlay sparisce con una dissolvenza breve. */
    .preloader-palla, .preloader-ombra, .preloader-testo { animation: none !important; }
    .preloader-palla { transform: none; }
    #preloader { transition: opacity .2s linear; }
}
