/* ========================= */
/*      STRUTTURA BASE       */
/* ========================= */

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f4f4;
    color: #222;
}

h1, h2 {
    margin: 0;
    padding: 0;
}

/* ========================= */
/*          HEADER           */
/* ========================= */

.header {
    background: #003366;
    padding: 15px 40px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.nav a {
    color: white;
    margin-left: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
}

.nav a:hover {
    text-decoration: underline;
}

/* ========================= */
/*           HERO            */
/* ========================= */

.hero {
    background: linear-gradient(to bottom right, #0066cc, #003366);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.hero p {
    font-size: 20px;
    opacity: 0.9;
}

/* ========================= */
/*         SEZIONI           */
/* ========================= */

.section {
    background: white;
    margin: 40px auto;
    padding: 40px;
    max-width: 1100px;
    border-radius: 12px;
    box-shadow: 0 0 12px rgba(0,0,0,0.08);
}

/* ========================= */
/*   INTESTAZIONI SEZIONI    */
/* ========================= */

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 26px;
    color: #003366;
}

.section-logo {
    height: 70px;
    width: auto;
    object-fit: contain;
}

/* ========================= */
/*         COORDINATE        */
/* ========================= */

.coords {
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ========================= */
/*          GALLERIA         */
/* ========================= */

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

/* FOTO E VIDEO IDENTICI SU PC */
.gallery img,
.gallery video {
    width: calc(33% - 10px);
    height: 220px;
    border-radius: 10px;
    object-fit: cover;
    background: black;
    display: block;
}

/* PC: video leggermente più alto per allinearsi alle foto */
@media (min-width: 769px) {
    .gallery video {
        height: 220px !important;
    }
}

/* ========================= */
/*           METEO           */
/* ========================= */

.meteo-widget {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #cfe6ff, #ffffff);
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.12);
    border-left: 8px solid #0066cc;
}

.meteo-widget img {
    width: 110px;
    height: 110px;
}

.meteo-info h3 {
    margin: 0;
    font-size: 24px;
    color: #003366;
}

.meteo-info .temp {
    font-size: 40px;
    font-weight: bold;
    margin: 8px 0;
    color: #004a99;
}

.meteo-info p {
    margin: 4px 0;
    font-size: 17px;
}

/* ========================= */
/*           BOTTONI         */
/* ========================= */

.button {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
}

.blue { background: #0066cc; }
.green { background: #009933; }

.button:hover {
    opacity: 0.85;
}

/* ========================= */
/*     PULSANTI CONTATTI     */
/* ========================= */

.mobile-buttons {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.call-btn, .whatsapp-btn, .nav-btn {
    flex: none;
    width: 220px;
    padding: 14px 0;
    text-align: center;
    color: white;
    font-weight: bold;
    border-radius: 10px;
    text-decoration: none;
    font-size: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.2s;
}

.call-btn::before { content: "📞"; font-size: 20px; }
.whatsapp-btn::before { content: "💬"; font-size: 20px; }
.nav-btn::before { content: "📍"; font-size: 20px; }

.call-btn { background: #0077cc; }
.whatsapp-btn { background: #25D366; }
.nav-btn { background: #ff8800; }

.call-btn:hover,
.whatsapp-btn:hover,
.nav-btn:hover {
    opacity: 0.85;
}

/* ========================= */
/*           FOOTER          */
/* ========================= */

.footer {
    background: #003366;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 14px;
}

/* ========================= */
/*     MENU MOBILE           */
/* ========================= */

.mobile-nav {
    display: none;
    background: #003366;
    padding: 15px;
    text-align: center;
}

.mobile-nav a {
    display: block;
    color: white;
    padding: 12px 0;
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.mobile-nav a:last-child {
    border-bottom: none;
}

/* ========================= */
/*         RESPONSIVE        */
/* ========================= */

@media (max-width: 768px) {

    .nav {
        display: none;
    }

    .mobile-nav {
        display: block;
    }

    .section {
        padding: 25px;
        margin: 20px;
    }

    .section-header {
        flex-direction: column;
        text-align: center;
    }

    .section-logo {
        height: 55px;
    }

    /* FOTO E VIDEO IDENTICI SU MOBILE */
    .gallery img,
    .gallery video {
        width: 100%;
        height: 220px;
    }

    /* forza il video a occupare tutta la riga nel flex */
    .gallery video {
        flex: 0 0 100%;
    }

    .meteo-widget {
        flex-direction: column;
        text-align: center;
    }

    .mobile-buttons {
        flex-direction: column;
        width: 100%;
    }

    .call-btn, .whatsapp-btn, .nav-btn {
        width: 100%;
        padding: 16px 0;
        font-size: 19px;
    }
}

/* ========================= */
/*     MENU MOBILE HAMBURGER */
/* ========================= */

.mobile-menu-button {
    display: none;
    background: #003366;
    color: white;
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
    text-align: left;
    cursor: pointer;
}

@media (max-width: 768px) {

    .mobile-menu-button {
        display: block;
    }

    .mobile-nav {
        display: none;
        background: #003366;
        padding: 10px 0;
        text-align: center;
    }

    .mobile-nav a {
        display: block;
        padding: 12px 0;
        color: white;
        text-decoration: none;
        font-weight: bold;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }

    .mobile-nav a:last-child {
        border-bottom: none;
    }
}

/* LANGUAGE SWITCHER */
.header {
    position: relative;
}

.lang-switch {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.lang-switch a {
    font-size: 22px;
    text-decoration: none;
    color: white;
    transition: opacity 0.2s;
}

.lang-switch a:hover {
    opacity: 0.7;
}

.counter-box {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #ffffff;
    opacity: 0.9;
    font-family: "Consolas", "Lucida Console", monospace;
}

.counter-box span {
    font-weight: bold;
    letter-spacing: 1px;
    color: #00ffea;
    text-shadow: 0 0 4px #00ffea;
    font-size: 14px;
}

/* Popup immagine */
#imgPopupOverlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#imgPopupOverlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 20px #000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
