/* ===========================
   RESET E BASE
=========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f8fb;
    color: #333;
    line-height: 1.6;
}

/* Regola globale per rendere tutte le immagini responsive */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===========================
   MENU LATERALE
=========================== */
.menu-laterale {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.menu-laterale a {
    background: #003b73;
    color: #fff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    transition: .3s;
    box-shadow: 0 3px 10px rgba(0,0,0,.20);
}

.menu-laterale a:hover {
    background: #0099d6;
    transform: translateX(-5px);
}

/* ===========================
   HEADER CON SLIDESHOW
=========================== */
header {
    position: relative;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 180px 20px 80px;
    background: linear-gradient(rgba(0,55,110,.65),rgba(0,55,110,.65)), url("foto1.jpg") center center/cover no-repeat;
    animation: cambioFoto 18s infinite;
}

@keyframes cambioFoto {
    0%, 30% {
        background: linear-gradient(rgba(0,55,110,.65),rgba(0,55,110,.65)), url("foto1.jpg") center center/cover no-repeat;
    }
    33%, 63% {
        background: linear-gradient(rgba(0,55,110,.65),rgba(0,55,110,.65)), url("foto2.jpg") center center/cover no-repeat;
    }
    66%, 96% {
        background: linear-gradient(rgba(0,55,110,.65),rgba(0,55,110,.65)), url("foto3.jpg") center center/cover no-repeat;
    }
    100% {
        background: linear-gradient(rgba(0,55,110,.65),rgba(0,55,110,.65)), url("foto1.jpg") center center/cover no-repeat;
    }
}

.logo {
    position: absolute;
    top: 40px;
    left: 35px;
    width: 330px;
    max-width: 40%;
    height: auto;
}

header h1 {
    font-size: 48px;
    margin-bottom: 18px;
    text-shadow: 2px 2px 8px rgba(0,0,0,.35);
}

header p {
    font-size: 22px;
    max-width: 900px;
    margin: 10px auto;
}

.btn {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 35px;
    background: #00a3e0;
    color: white;
    text-decoration: none;
    border-radius: 40px;
    font-weight: bold;
    transition: .30s;
}

.btn:hover {
    background: #007ab8;
    transform: translateY(-3px);
}

/* ===========================
   SEZIONI E GRIGLIA
=========================== */
section {
    max-width: 1100px;
    margin: auto;
    padding: 70px 20px;
}

h2 {
    text-align: center;
    color: #003b73;
    font-size: 34px;
    margin-bottom: 40px;
}

section p {
    font-size: 18px;
    line-height: 1.8;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.card {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    border: 1px solid #ddd;
    text-align: center;
    box-shadow: 0 5px 18px rgba(0,0,0,.08);
    transition: .3s;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,.15);
}

.card h3 {
    color: #003b73;
    margin-bottom: 15px;
}

ul {
    max-width: 700px;
    margin: auto;
    font-size: 18px;
    line-height: 2;
    padding-left: 25px;
}

.mappa-italia {
    display: block;
    max-width: 700px;
    width: 100%;
    margin: 40px auto;
    border-radius: 12px;
}

.contact {
    max-width: none;
    background: #003b73;
    color: white;
    text-align: center;
}

.contact h2, .contact a {
    color: white;
}

footer {
    background: #021b30;
    color: #ddd;
    text-align: center;
    padding: 25px;
    font-size: 15px;
}

/* ===========================
   GALLERIA REALIZZAZIONI
=========================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    max-width: 1100px;
    margin: 30px auto 0 auto;
}

.gallery-card {
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #ddd;
    box-shadow: 0 5px 18px rgba(0,0,0,.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,.15);
}

.gallery-card img {
    width: 100%;
    height: 220px;
    object-fit: cover; /* Corretto da 'auto' a 'cover' */
    background-color: #f0f4f8;
    display: block;
}

.gallery-info {
    padding: 20px;
    flex: 1;
}

.gallery-info h3 {
    color: #003b73;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.gallery-info p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* ===========================
   RESPONSIVE (SMARTPHONE)
=========================== */
@media(max-width: 900px) {
    .logo { width: 250px; left: 20px; }
    .menu-laterale { display: none; }
    header h1 { font-size: 38px; }
}

@media(max-width: 600px) {
    header { padding: 140px 15px 60px; min-height: 520px; }
    .logo { position: relative; left: auto; top: auto; width: 230px; margin-bottom: 25px; }
    header h1 { font-size: 30px; }
    header p { font-size: 18px; }
    h2 { font-size: 28px; }
    section { padding: 50px 15px; }
}

/* ===========================
   COOKIE BANNER
=========================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 -2px 12px rgba(0,0,0,.20);
    padding: 18px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    z-index: 99999;
}

.cookie-text { font-size: 14px; color: #333; }
.cookie-text a { color: #003b73; text-decoration: underline; }
.cookie-buttons { display: flex; gap: 10px; }

.btn-cookie {
    padding: 8px 16px;
    border: 1px solid #003b73;
    background: transparent;
    color: #003b73;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.btn-cookie:hover { background: #f0f4f8; }
.btn-cookie.btn-primary { background: #003b73; color: #ffffff; }
.btn-cookie.btn-primary:hover { background: #0099d6; border-color: #0099d6; }