* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f6f7;
    color: #1f2933;
}

a {
    color: inherit;
}


/* =====================================================
   HEADER
===================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,.97);
    border-bottom: 1px solid #e5e8eb;
    backdrop-filter: blur(10px);
}

.header-interno {
    width: min(1400px, 94%);
    margin: auto;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #202830;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.brand-icon::before,
.brand-icon::after {
    content: "";
    position: absolute;
    border: 2px solid #202830;
    border-left-color: transparent;
    border-bottom-color: transparent;
    border-radius: 50%;
    transform: rotate(45deg);
}

.brand-icon::before {
    width: 44px;
    height: 44px;
}

.brand-icon::after {
    width: 52px;
    height: 52px;
    opacity: .35;
}

.brand-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e53935;
}

.brand-testo {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-testo strong {
    font-size: 22px;
    letter-spacing: -.3px;
}

.brand-testo small {
    margin-top: 4px;
    color: #7b838b;
    font-size: 12px;
}

.menu-principale {
    display: flex;
    align-items: center;
    gap: 5px;
}

.menu-principale > a,
.menu-regione {
    display: block;
    border: 0;
    background: transparent;
    padding: 11px 13px;
    text-decoration: none;
    color: #3c454d;
    font: inherit;
    cursor: pointer;
    border-radius: 9px;
}

.menu-principale > a:hover,
.menu-regione:hover {
    background: #f0f2f4;
    color: #111820;
}

.menu-dropdown {
    position: relative;
}

.freccia {
    margin-left: 4px;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 7px);
    width: 245px;
    max-height: 70vh;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e1e5e8;
    border-radius: 12px;
    box-shadow: 0 14px 38px rgba(0,0,0,.14);
    padding: 7px;
}

.menu-dropdown:hover .dropdown-content,
.menu-dropdown:focus-within .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    border-radius: 8px;
}

.dropdown-content a:hover {
    background: #f0f2f4;
}

.header-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: 8px;
    padding: 8px 11px;
    border-radius: 20px;
    background: #fff3f2;
    color: #b52520;
    font-size: 12px;
    font-weight: 700;
}

.header-live-dot {
    width: 8px;
    height: 8px;
    background: #e53935;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(229,57,53,.10);
}


/* =====================================================
   HERO HOME
===================================================== */

.hero {
    background:
        radial-gradient(circle at 50% 0%, #34414c 0%, #202830 62%);
    color: #ffffff;
    padding: 72px 20px 80px;
    text-align: center;
}

.hero h1 {
    margin: 0 0 14px;
    font-size: clamp(36px, 5vw, 58px);
    letter-spacing: -1px;
}

.hero p {
    max-width: 760px;
    margin: 0 auto;
    color: #d7dde2;
    font-size: 19px;
    line-height: 1.55;
}


/* =====================================================
   STATISTICHE
===================================================== */

.statistiche {
    width: min(900px, 92%);
    margin: -29px auto 54px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow: hidden;
}

.stat {
    padding: 22px;
    text-align: center;
}

.stat + .stat {
    border-left: 1px solid #eceff1;
}

.numero {
    display: block;
    font-size: 31px;
    font-weight: 700;
}

.etichetta {
    display: block;
    color: #757d85;
    margin-top: 5px;
}


/* =====================================================
   CONTENUTO
===================================================== */

.contenitore {
    width: min(1400px, 94%);
    margin: auto;
    padding-bottom: 72px;
}

.sezione {
    margin-bottom: 56px;
}

.titolo-sezione {
    margin-bottom: 23px;
}

.titolo-sezione h2 {
    margin: 0 0 7px;
    font-size: 28px;
    letter-spacing: -.4px;
}

.titolo-sezione p {
    margin: 0;
    color: #727b83;
}


/* =====================================================
   REGIONE
===================================================== */

.regione-hero {
    background: #202830;
    color: #ffffff;
    padding: 42px 20px 46px;
}

.regione-hero-interno {
    width: min(1400px, 94%);
    margin: auto;
}

.regione-hero h1 {
    margin: 12px 0 7px;
    font-size: 38px;
    letter-spacing: -.5px;
}

.regione-hero p {
    margin: 0;
    color: #cfd5da;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: #7c858d;
    font-size: 14px;
}

.regione-hero .breadcrumb {
    color: #bfc6cc;
}

.breadcrumb a {
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.elenco-citta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.voce-citta {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 15px;
    background: #ffffff;
    border: 1px solid #e2e6e9;
    border-radius: 11px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(0,0,0,.035);
    transition: transform .15s ease, box-shadow .15s ease;
}

.voce-citta:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 20px rgba(0,0,0,.075);
}

.voce-citta-freccia {
    color: #9aa1a7;
}


/* =====================================================
   PAGINA CITTÀ
===================================================== */

.citta-contenuto {
    padding-top: 38px;
}

.citta-testata {
    margin-bottom: 25px;
}

.citta-testata h1 {
    margin: 11px 0 5px;
    font-size: 32px;
    letter-spacing: -.5px;
}

.citta-testata p {
    margin: 0;
    color: #747d85;
}


/* =====================================================
   WEBCAM
===================================================== */

.griglia-webcam {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.webcam {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e7eaed;
    box-shadow: 0 5px 19px rgba(0,0,0,.065);
}

.webcam-header {
    padding: 15px 17px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.webcam-header h3 {
    margin: 0;
    font-size: 19px;
}

.webcam-meta {
    margin-top: 5px;
    color: #7b838a;
    font-size: 13px;
}

.live {
    background: #e53935;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.video {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #111111;
}

.video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.messaggio-vuoto {
    padding: 28px;
    background: #ffffff;
    border: 1px solid #e4e7ea;
    border-radius: 12px;
    color: #68717a;
}


/* =====================================================
   FOOTER
===================================================== */

.site-footer {
    background: #182027;
    color: #c0c7cd;
    border-top: 1px solid #26313a;
}

.footer-interno {
    width: min(1400px, 94%);
    margin: auto;
    padding: 42px 0 34px;
    display: grid;
    grid-template-columns: 1.5fr .7fr 1.2fr;
    gap: 55px;
}

.footer-marchio {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #ffffff;
    font-size: 20px;
}

.brand-icon-footer {
    width: 30px;
    height: 30px;
    border-color: #ffffff;
}

.brand-icon-footer::before,
.brand-icon-footer::after {
    border-color: #ffffff;
    border-left-color: transparent;
    border-bottom-color: transparent;
}

.footer-brand p {
    max-width: 430px;
    margin: 15px 0 0;
    color: #9fa8af;
    line-height: 1.55;
}

.footer-colonna {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-colonna strong {
    color: #ffffff;
    margin-bottom: 3px;
}

.footer-colonna a {
    color: #b9c1c7;
    text-decoration: none;
}

.footer-colonna a:hover {
    color: #ffffff;
}

.footer-info span {
    color: #9fa8af;
    font-size: 14px;
    line-height: 1.5;
}

.footer-bottom {
    width: min(1400px, 94%);
    margin: auto;
    min-height: 58px;
    border-top: 1px solid #2b353e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    color: #89939b;
    font-size: 13px;
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 950px) {

    .elenco-citta {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-interno {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 800px) {

    .header-interno {
        min-height: auto;
        padding: 14px 0;
        align-items: flex-start;
        flex-direction: column;
    }

    .menu-principale {
        width: 100%;
        flex-wrap: wrap;
    }

    .dropdown-content {
        left: 0;
        right: auto;
        width: min(300px, 90vw);
    }

    .header-live {
        margin-left: 0;
    }

    .griglia-webcam {
        grid-template-columns: 1fr;
    }

    .statistiche {
        grid-template-columns: 1fr;
    }

    .stat + .stat {
        border-left: 0;
        border-top: 1px solid #eeeeee;
    }

    .elenco-citta {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-interno {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-brand {
        grid-column: auto;
    }

    .footer-bottom {
        padding: 18px 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }
}

@media (max-width: 520px) {

    .brand-testo small {
        display: none;
    }

    .elenco-citta {
        grid-template-columns: 1fr;
    }

    .menu-principale > a,
    .menu-regione {
        padding: 9px 10px;
    }
}


/* =====================================================
   MENU ITALIA - FIX DEFINITIVO
   ===================================================== */

@media (min-width: 801px) {

    .menu-principale .menu-dropdown {
        position: relative !important;
    }

    .menu-principale .menu-dropdown .dropdown-content {
        position: absolute !important;

        /* parte dal lato sinistro di "Italia" */
        left: 0 !important;
        right: auto !important;

        /* nessuno spostamento laterale */
        transform: none !important;

        /* attaccato al pulsante, niente spazio che chiude l'hover */
        top: 100% !important;
        margin: 0 !important;

        width: 250px !important;

        z-index: 99999 !important;
    }

    /* ponte invisibile fra pulsante e tendina */
    .menu-principale .menu-dropdown::after {
        content: "";
        position: absolute;
        left: 0;
        top: calc(100% - 2px);
        width: 250px;
        height: 12px;
        z-index: 99998;
    }
}

@media (max-width: 800px) {

    .menu-principale .menu-dropdown .dropdown-content {
        left: 0 !important;
        right: auto !important;
        transform: none !important;
        top: 100% !important;
        margin: 0 !important;
    }
}


/* =====================================================
   WEBCAM OK - PULSANTE SCHERMO INTERO
   ===================================================== */

.video {
    position: relative;
}

.webcam-fullscreen-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;

    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 9px;

    background: rgba(18, 24, 30, .78);
    color: #ffffff;

    font-size: 22px;
    line-height: 1;
    cursor: pointer;

    box-shadow: 0 3px 12px rgba(0,0,0,.22);
    backdrop-filter: blur(5px);

    transition:
        background .15s ease,
        transform .15s ease;
}

.webcam-fullscreen-btn:hover {
    background: rgba(18, 24, 30, .96);
    transform: scale(1.04);
}

.webcam-fullscreen-btn:focus-visible {
    outline: 3px solid rgba(255,255,255,.9);
    outline-offset: 2px;
}


/*
 * Quando il contenitore video entra a schermo intero,
 * eliminiamo il rapporto 16:9 basato sul padding
 * e facciamo occupare tutto lo schermo.
 */
.video:fullscreen,
.video:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    padding-top: 0 !important;
    background: #000000;
}

.video:fullscreen iframe,
.video:-webkit-full-screen iframe {
    position: absolute !important;
    inset: 0 !important;

    width: 100% !important;
    height: 100% !important;

    object-fit: contain;
}

.video:fullscreen .webcam-fullscreen-btn,
.video:-webkit-full-screen .webcam-fullscreen-btn {
    top: 18px;
    right: 18px;
}


/* Mobile */
@media (max-width: 600px) {

    .webcam-fullscreen-btn {
        width: 38px;
        height: 38px;
        top: 9px;
        right: 9px;
        font-size: 20px;
    }
}
