body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    color: white;
    background-color: black; /* Evita flash bianchi durante il caricamento */
}

body * {
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    font-family: inherit;
    box-sizing: border-box; /* Aiuta a gestire meglio i margini e i padding */
}

a {
    text-decoration: none;
    color: cyan;
    transition: color 0.2s ease;
}

a:hover {
    color: #00a2ff;
    text-decoration: underline;
}

/* HEADER */
.header {
    background-color: rgba(0, 0, 0, 0.95);
    position: sticky;
    top: 0;
    height: 10vh;
    min-height: 80px; /* Impedisce che sparisca su schermi troppo piccoli */
    display: flex;
    align-items: center;
    border-bottom: 1px solid white;
    justify-content: center;
    z-index: 1000;
}

.logo {
    height: 90%; /* Si adatta proporzionalmente all'header */
    transition: transform 0.2s ease-in-out;
    aspect-ratio: 16/9;
}

.logo:hover {
    transform: scale(1.05);
}

.logoImg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* MAIN CONTENT */
.main {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: 60px;
    min-height: 85vh;
    background: linear-gradient(to top, black, #000a61);
    padding: 40px 20px;
}

.sezione {
    max-width: 600px;
}

.maintitle {
    color: white;
    margin: 0 0 20px 0;
    font-size: clamp(40px, 5vw, 75px);
    transition: background 0.3s ease;
}

.maintitle:hover {
    background: linear-gradient(to right, cyan, #0055ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: white;
    margin: 0 0 40px 0;
    font-size: clamp(20px, 2vw, 28px);
    line-height: 1.4;
}

/* GALLERIA */
.gallery-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; 
    max-width: 450px;
    width: 100%;
}

.mainimage {
    width: 100%;
    height: 337px; /* Altezza fissa coerente con il rapporto di aspetto 4:3 su larghezza 450px */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.4);
    background-color: #000; /* Evita flash di sfondo */
}

.mainimage img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    opacity: 0; /* Di base è invisibile */
    transition: opacity 0.3s ease-in-out; /* Effetto dissolvenza */
}

/* Classe per mostrare l'immagine attiva */
.mainimage img.active {
    opacity: 1;
}

.gallery-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.buttonChange {
    background: linear-gradient(to right, cyan, #0055ff);
    border: none;
    border-radius: 10px;
    padding: 10px 25px;
    font-weight: bold;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.3s ease;
}

.buttonChange:hover {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.button {
    background: linear-gradient(to right, cyan, #0055ff, cyan);
    background-size: 300% auto; 
    transition: 0.5s ease;
    border: none;
    border-radius: 10px;
    padding: 15px 35px;
    font-weight: bold;
    color: white;
    font-size: 20px;
    cursor: pointer;
}
.pdfbutton {
    background: transparent;
    border: none;
    padding: 5px 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.pdfbutton img {
    height: 50px;
    width: auto;
}

.pdfbutton:hover {
    transform: scale(1.08);
}

.button:hover {
    background-position: right center;
    text-shadow: 0px 0px 10px cyan;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.7);
}

.footer {
    background-color: black;
    border-top: 1px solid white;
    padding: 30px 20px 10px 20px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}
.footer-info {
    flex: 1 1 300px;
}
.footerTesto {
    color: white;
    margin: 6px 0;
    font-size: 0.95rem;
}

.informativa {
    font-size: 0.8rem;
    opacity: 0.8;
}

.footer-map {
    flex: 0 0 250px;
}

.mapouter {
    position: relative;
    width: 250px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
}

.gmap_canvas {
    overflow: hidden;
    background: none !important;
    width: 100%;
    height: 100%;
}

.gmap_canvas iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

#copyright {
    text-align: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #aaa;
}

#copyright{
    font-style: italic;
    text-align: center;
    font-style: normal;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .main {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }
    .mainimage {
        max-width: 97%;
        height: auto;
        aspect-ratio: 4/3;
    }
    .sezione {
        max-width: 100%;
    }
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-map {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}