/* --- VARIABILI DESIGN --- */
:root {
    --primary-color: #5182BF;
    --primary-hover: #236cc4;
    --dark-color: #1a2a3a;       /* Blu Ardesia */
    --light-bg: #f8fafc;
    --playwrite: "Playwrite NZ Basic", cursive;
    --inter: 'Inter', sans-serif;
}

/* --- RESET E TIPOGRAFIA --- */
body {
    font-family: var(--inter);
    color: #334155;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

/* Brand e Firma */
.navbar-brand {
    font-family: var(--playwrite);
    font-size: 1.4rem;
    color: var(--primary-color) !important;
}

h1, h2, h3, h4 {
    font-family: var(--inter);
    font-weight: 800;
    color: var(--dark-color);
    letter-spacing: -0.02em;
}

.devp-text-white {
    color:#ffffff;
}

/* Accento Handwritten */
.accent, .italic, .handwritten {
    font-family: var(--playwrite);
    font-weight: 400;
    font-style: normal;
    color: var(--primary-color);
    display: inline-block;
}

/* --- NAVIGAZIONE --- */
.nav-link {
    font-weight: 500;
    color: var(--dark-color) !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* --- HERO SECTION --- */
.hero-section {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    padding: 80px 0;
}

.hero-image-container img {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; /* Forma organica a "blob" */
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    object-fit: cover;
    height: 500px;
    width: 100%;
}

/* --- PULSANTI --- */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(92, 141, 137, 0.3);
}

.btn-outline-dark {
    border-radius: 50px;
    padding: 12px 28px;
    font-weight: 600;
}

/* --- CARDS --- */
.card {
    border: none;
    border-radius: 20px;
    background: #ffffff;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

/* --- SEZIONE SERVIZI (DARK) --- */
.bg-dark {
    background-color: #0f172a !important;
}

.bg-dark h2 {
    color: #ffffff;
}

.card.bg-transparent {
    border: 1px solid rgba(255,255,255,0.1) !important;
}

/* --- PAGINA ARTICOLO --- */
.content-text {
    font-size: 1.2rem;
    color: #475569;
    max-width: 800px;
    margin: 0 auto;
}

.content-text p {
    margin-bottom: 2rem;
}

/* --- UTILITY ANIMAZIONI --- */
.transition-hover {
    transition: all 0.3s ease;
}

/* --- RESPONSIVE --- */
@media (max-width: 991px) {
    .hero-image-container img {
        height: 350px;
        margin-bottom: 40px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
}



.cta-minimal i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

/* Stile specifico per il titolo dell'Header (immagine allegata) */
.accent-title {
    font-family: var(--playwrite);
    font-weight: 300; /* Più sottile come nell'immagine */
    color: var(--primary-color);
    font-size: 1.1em;
    padding: 0 5px;
}



/* Fix per i controlli del carosello scuro su sfondo bianco */
.carousel-control-prev, .carousel-control-next {
    width: 5%;
    opacity: 0.8;
}

.carousel-control-prev:hover, .carousel-control-next:hover {
    opacity: 1;
}

/* Stile per il testo degli articoli per massima leggibilità */
article .content-text {
    font-size: 1.15rem;
    line-height: 1.9;
    color: #334155;
}

article .content-text h2, article .content-text h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    font-family: var(--inter);
    font-weight: 700;
}

/* Fix per le card nell'archivio */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08) !important;
}

/* CTA Minimal Premium */
.cta-minimal {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background-color: transparent;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-minimal:hover {
    background-color: var(--primary-color);
    color: white !important;
}

/* Stili per la pagina Contatti */
.icon-box {
    width: 50px;
    height: 50px;
    background-color: rgba(92, 141, 137, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-control:focus, .form-select:focus {
    background-color: #fff !important;
    border: 1.5px solid var(--primary-color) !important;
    box-shadow: none;
    transition: all 0.3s ease;
}

label.form-label {
    color: var(--dark-color);
    letter-spacing: 0.5px;
}

.vh-50 {
    height: 50vh;
}


/* ==========================================================================
   MEGA MENU CONFIGURATION
   ========================================================================== */

/* 1. Forza la Navbar a essere il punto di riferimento per il menu */
@media (min-width: 992px) {
    .navbar {
        position: relative; /* La navbar diventa il confine del menu */
    }

    /* Rimuove l'ancoraggio del dropdown al singolo link "Servizi" */
    .nav-item.dropdown.position-static {
        position: static !important;
    }

    /* Configurazione del pannello Mega Menu */
    .navbar .dropdown-menu {
        display: none; /* Gestito dall'hover sotto */
        position: absolute;
        width: 100%; /* Prende tutta la larghezza della navbar */
        left: 0 !important;
        right: 0 !important;
        top: 100%;
        margin: 0;
        padding: 40px 0;
        background-color: #ffffff;
        border: none;
        border-top: 1px solid #f1f5f9;
        border-radius: 0;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    /* Mostra il menu con animazione fluida al passaggio del mouse */
    .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        animation: menuAppear 0.3s ease-out;
    }
}

/* 2. Styling degli elementi interni al Mega Menu */
.dropdown-item {
    padding: 15px;
    border-radius: 12px;
    white-space: normal; /* Fondamentale: permette al testo lungo di andare a capo */
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.dropdown-item:hover {
    background-color: #f8fafc !important;
    transform: translateY(-2px);
    border-color: rgba(92, 141, 137, 0.1); /* Colore primario scarico */
}

/* Icona rotonda o boxata simile allo screenshot */
.icon-box-sm {
    width: 42px;
    height: 42px;
    background-color: #f0f7f6; /* Sfondo verde salvia chiarissimo */
    color: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0; /* Impedisce all'icona di rimpicciolirsi se il testo è lungo */
}

/* 3. Animazione di comparsa */
@keyframes menuAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 4. Gestione Mobile (evitiamo che il mega menu faccia danni su smartphone) */
@media (max-width: 991px) {
    .navbar .dropdown-menu {
        border-radius: 15px;
        box-shadow: none;
        padding: 10px;
        border: 1px solid #eee;
        width: 100%;
    }
    
    .icon-box-sm {
        width: 35px;
        height: 35px;
    }
}

/* Fix per evitare che il menu si chiuda durante il movimento del mouse */
@media (min-width: 992px) {
    .nav-item.dropdown {
        padding-bottom: 20px; /* Crea un ponte invisibile */
        margin-bottom: -20px;
    }

    .navbar .dropdown-menu {
        margin-top: 0; /* Attacca il menu alla navbar */
        pointer-events: all;
    }
}



/* Container del carosello */
#heroCarousel {
    position: relative;
    max-height: 500px; /* Regola in base alle tue immagini */
}

#heroCarousel img {
    object-fit: cover;
    height: 500px;
}

/* Box della citazione (stile screenshot) */
.carousel-custom-caption {
    position: absolute;
    top: 15%;
    left: 5%;
    background: rgba(248, 249, 250, 0.9); /* Effetto opaco chiaro */
    padding: 2rem;
    max-width: 80%;
    border-radius: 4px;
    color: #1a2a3a;
}

/* Controlli in basso a sinistra */
.carousel-controls-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    gap: 8px;
}

.carousel-controls-container .btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.carousel-controls-container .btn:hover {
    background: var(--bs-primary);
    color: white;
}


.carousel-custom-caption {
    position: absolute;
    top: 15%;
    left: 8%;
    background: rgba(255, 255, 255, 0.92); /* Bianco quasi solido */
    padding: 2.5rem;
    max-width: 80%;
    border-radius: 2px; /* Angoli meno arrotondati per stile editoriale */
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-left: 5px solid #0d6efd; /* Un richiamo al colore primario */
}

/* Posizionamento controlli */
.carousel-controls-container {
    position: absolute;
    bottom: 25px;
    left: 25px;
    z-index: 10;
    display: flex;
    gap: 10px;
}