/* Reset generale */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* Sfondo Immagine principale HOME */
.hero-container {
    position: relative;
    width: 100%;
    min-height: 85vh;
    background: url('images/impianto.jpg') no-repeat center center/cover;
    display: flex;
    flex-direction: column;
}

/* Top bar con contatti, icone social e menu */
.top-bar {
    width: 100%;
    background-color: #0e1722;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 60px;
}

.top-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between; /* Spinge il menu a sinistra e i contatti a destra */
    align-items: center;
}

/* Raggruppa email e social sulla destra */
.top-right-elements {
    display: flex;
    align-items: center;
    gap: 30px;
}

.top-email {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-socials {
    display: flex;
    gap: 20px;
}

.top-socials a {
    color: #ffffff;
    font-size: 15px;
    transition: color 0.3s;
}

.top-socials a:hover, .top-email:hover {
    color: #3b82f6;
}

/* Menu di navigazione dentro la barra blu */
.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 10px;
}

.nav-menu a {
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 6px 14px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.nav-menu a.active, .nav-menu a:hover {
    border: 1px solid #3b82f6;
    border-radius: 25px;
    background-color: rgba(59, 130, 246, 0.1);
}

.hero-content {
    flex: 1;
    padding-bottom: 100px;
}

/* STRUTTURA DEI TRE QUADRATI DI SPEZZATURA */
.cards-container {
    width: 100%;
    background-color: #ffffff;
    padding: 0 40px;
    position: relative;
    z-index: 20;
}

.card-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: -80px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.scheda-box {
    background-color: #f8f9fa;
    padding: 45px 35px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.35s ease-in-out;
    cursor: pointer;
    border-right: 1px solid #eef0f3;
}

.scheda-box:last-child {
    border-right: none;
}

.scheda-icon {
    font-size: 28px;
    color: #121e2d;
    margin-bottom: 15px;
    transition: color 0.35s;
}

.scheda-tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #8c96a0;
    margin-bottom: 10px;
    transition: color 0.35s;
}

.scheda-content h3 {
    font-size: 21px;
    color: #121e2d;
    margin-bottom: 12px;
    font-weight: 600;
    transition: color 0.35s;
}

.scheda-content p {
    font-size: 15px;
    color: #5a6571;
    line-height: 1.6;
    transition: color 0.35s;
}

.scheda-box:hover {
    background-color: #102a43;
}

.scheda-box:hover .scheda-content h3,
.scheda-box:hover .scheda-content p,
.scheda-box:hover .scheda-icon {
    color: #ffffff;
}

.scheda-box:hover .scheda-tag {
    color: #3b82f6;
}

/* Contenuti informativi inferiori */
.main-content {
    max-width: 950px;
    margin: 80px auto;
    padding: 0 25px;
}

.contenuto {
    margin-bottom: 60px;
}

.contenuto h2 {
    color: #121e2d;
    font-size: 26px;
    margin-bottom: 20px;
    border-bottom: 2px solid #121e2d;
    padding-bottom: 8px;
}

.contenuto p, .contenuto ul {
    font-size: 18px;
    color: #3b4249;
    line-height: 1.75;
}

.contenuto ul {
    margin-left: 25px;
}

.contenuto li {
    margin-bottom: 8px;
}

.contenuto a {
    color: #121e2d;
    font-weight: 600;
    text-decoration: none;
}

.contenuto a:hover {
    text-decoration: underline;
}

/* Footer scuro di chiusura */
.footer {
    text-align: center;
    padding: 40px;
    background-color: #0e1722;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #8c96a0;
    font-size: 14px;
}

/* =========================================
   ADATTAMENTO PER SMARTPHONE E TABLET
   ========================================= */
@media (max-width: 768px) {
    /* Riduce i margini della barra in alto e impila gli elementi */
    .top-bar {
        padding: 15px 20px;
    }

    .top-bar-content {
        flex-direction: column;
        gap: 15px;
    }

    /* Fa andare a capo le voci del menu se non ci stanno */
    .nav-menu ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .nav-menu a {
        font-size: 14px;
        padding: 5px 10px;
    }

    .top-right-elements {
        flex-direction: column;
        gap: 10px;
    }

    /* Riduce l'altezza dell'immagine principale */
    .hero-container {
        min-height: 55vh;
    }

    /* Trasforma le 3 schede da 3 colonne a 1 sola colonna verticale */
    .cards-container {
        padding: 0 20px;
    }

    .card-wrapper {
        grid-template-columns: 1fr;
        margin-top: -40px;
    }

    .scheda-box {
        min-height: auto;
        padding: 30px 25px;
        border-right: none;
        border-bottom: 1px solid #eef0f3;
    }

    .scheda-box:last-child {
        border-bottom: none;
    }

    /* Riduce i margini dei contenuti testuali */
    .main-content {
        margin: 50px auto;
        padding: 0 20px;
    }

    .contenuto h2 {
        font-size: 22px;
    }

    .contenuto p, .contenuto ul {
        font-size: 16px;
    }
}


