/* ============================================================
   STILE MODERNO (Mobile‑First)
   ============================================================ */

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    margin: 0;
    line-height: 1.6;
    max-width: 100%;
    overflow-x: clip; /* Consente il clipping orizzontale senza bloccare position: sticky */
    padding: 10px;
}

@media (min-width: 768px) {
    body { padding: 20px 40px; }
}

/* HEADER DEF */
.header-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Logo principale (Sinistra) */
.header-logo-left img {
    max-height: 100px;
    width: auto;
    height: auto;
    display: block;
}

/* Logo secondario (Destra) */
.header-logo-right img {
    max-height: 70px;
    width: auto;
    height: auto;
    display: block;
}

.header-logo a {
    display: inline-block;
    text-decoration: none;
}

/* Testo a bandiera affiancato al primo logo */
.header-text {
    margin-right: auto;
}

.header-text h1 {
    margin: 0;
    font-size: 2.1rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    text-align: left;
}

.header-text h3 {
    margin: 4px 0 0 0;
    font-style: normal;
    color: #64748b;
    font-weight: 400;
    text-align: left;
}

/* VERSIONE MOBILE (< 600px) */
@media (max-width: 600px) {
    .header-block {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 2px;
        padding: 10px 0;
    }

    .header-logo-left { order: 1; }
    .header-logo-right { order: 2; }

    .header-text {
        order: 3;
        width: 100%;
        margin-right: 0;
        margin-top: -2px;
        text-align: center;
    }

    .header-text h1 { margin-top: 0; }
    .header-text h1, .header-text h3 { text-align: center; }

    .header-block.no-logo2 { justify-content: center; }
    .header-block.no-logo2 .header-logo-left {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .header-logo-left img { max-height: 105px; }
    .header-logo-right img { max-height: 70px; }
}

/* ============================================================
   TOPNAV / LINKBAR (STICKY + SOTTILE)
   ============================================================ */

.topnav {
    position: -webkit-sticky; /* Supporto Safari */
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #0f172a;
    border-radius: 8px;
    padding: 6px 15px; /* Spessore ridotto sottile */
    margin-top: 10px;
    margin-bottom: 10px; /* Ridotto da 25px per avvicinare il carosello */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.topnav-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.topnav a, 
.dropbtn {
    display: inline-flex;
    align-items: center;
    height: 1.15rem; /* Riconfermata altezza compatta */
    padding: 4px 6px;
    color: #f8fafc;
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s ease;
    border-radius: 4px;
}

.topnav a:hover, 
.dropbtn:hover {
    color: #38bdf8;
}

/* DROPDOWN */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1e293b;
    min-width: 200px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    border-radius: 6px;
    padding: 6px 0;
}

.dropdown-content a {
    color: #f8fafc;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    border-bottom: 1px solid #334155;
    height: auto;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #334155;
    color: #38bdf8;
}

.dropdown.open .dropdown-content {
    display: block;
}

/* PULSANTE HAMBURGER MOBILE */
.topnav-toggle {
    display: none;
}

@media (max-width: 768px) {
    .topnav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 26px;
        height: 18px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        margin: 4px 0;
    }

    .hamburger-bar {
        width: 100%;
        height: 3px;
        background-color: #f8fafc;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .topnav-toggle.active .hamburger-bar:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
    }
    .topnav-toggle.active .hamburger-bar:nth-child(2) {
        opacity: 0;
    }
    .topnav-toggle.active .hamburger-bar:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
    }

    .topnav-menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-top: 10px;
        border-top: 1px solid #334155;
        padding-top: 10px;
        gap: 4px;
    }

    .topnav-menu.active {
        display: flex;
    }

    .topnav a, 
    .dropbtn,
    .dropdown {
        width: 100%;
        text-align: left;
        justify-content: flex-start;
        box-sizing: border-box;
        height: auto;
        padding: 8px 6px;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        padding-left: 15px;
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 4px;
        margin-top: 4px;
    }
}

/* TESTI E DISTANZE PAGE */
.home-text-block { 
    margin: 12px 0 !important; /* Ridotto da 25px per compatta re con il carosello sopra */
    text-align: justify; 
    line-height: 1.6; 
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 20px 0 10px 0;
    color: #0f172a;
    text-align: left;
}

/* GALLERY HOMEPAGE */
.gallery-container { display: flex; flex-direction: column; gap: 20px; padding: 15px; width: 100%; box-sizing: border-box; }
.gallery-item { position: relative; width: 100%; overflow: hidden; border-radius: 8px; border: 1px solid #e2e8f0; }
.gallery-item img { width: 100%; display: block; border-radius: 8px; cursor: pointer; }

.gallery-caption-home {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 12px;
    background: rgba(15, 23, 42, 0.8); color: #fff !important; font-size: 0.95rem; line-height: 1.4;
    border-radius: 0 0 8px 8px; box-sizing: border-box;
}

@media (max-width: 480px) { .gallery-caption-home { font-size: 1rem; padding: 14px; } }
@media (min-width: 768px) {
    .gallery-container { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .gallery-item { width: 30%; }
}

/* ATTIVITA */
.attivita-container { display: grid; grid-template-columns: 1fr; gap: 25px; margin-top: 20px; }
@media (min-width: 600px) { .attivita-container { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .attivita-container { grid-template-columns: 1fr 1fr 1fr; } }

.attivita-card { display: flex; flex-direction: column; gap: 12px; background: #fff; padding: 16px; border-radius: 8px; border: 1px solid #e2e8f0; }
.attivita-media { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: 6px; }
.attivita-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.attivita-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; background: #f1f5f9; display: flex; justify-content: center; align-items: center; }
.attivita-placeholder img { width: 100%; height: 100%; object-fit: cover; opacity: 0.25; }
.attivita-media::after { content: ""; position: absolute; inset: 0; background: rgba(37, 99, 235, 0.4); z-index: 2; transition: background 0.3s ease; }
.attivita-media:hover::after { background: rgba(37, 99, 235, 0.1); }
.attivita-title { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; color: #fff; font-weight: 600; font-size: 1.3rem; text-align: center; padding: 10px; z-index: 3; pointer-events: none; }
.attivita-content { display: flex; flex-direction: column; gap: 8px; }
.attivita-desc { text-align: justify; line-height: 1.5; color: #475569; }

.caption { margin-top: 8px; font-size: 0.9rem; color: #64748b; text-align: center; }
.back-link { display: inline-block; margin-top: 20px; font-size: 0.95rem; color: #2563eb; text-decoration: none; font-weight: 500; }
.back-link:hover { text-decoration: underline; }

/* PROGETTI */
.progetti-container { display: grid; grid-template-columns: 1fr; gap: 25px; margin-top: 20px; }
@media (min-width: 700px) { .progetti-container { grid-template-columns: 1fr 1fr; } }
.progetto-card { background: #ffffff; border-radius: 8px; border: 1px solid #e2e8f0; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.progetto-title { font-size: 1.35rem; font-weight: 600; color: #0f172a; }
.progetto-desc { text-align: justify; line-height: 1.5; color: #475569; }

/* SERVIZI */
.servizi-container { display: grid; grid-template-columns: 1fr; gap: 25px; margin-top: 20px; }
@media (min-width: 700px) { .servizi-container { grid-template-columns: 1fr 1fr; } }
.servizio-card { background: #ffffff; border-radius: 8px; border: 1px solid #e2e8f0; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.servizio-title { font-size: 1.35rem; font-weight: 600; color: #0f172a; }
.servizio-desc { text-align: justify; line-height: 1.5; color: #475569; }

/* LIGHTBOX */
.lightbox.hidden { display: none; }
.lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.9); display: flex; justify-content: center; align-items: center; z-index: 9999; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-content { text-align: center; max-width: 90%; max-height: 80%; }
.lightbox img { max-width: 100%; max-height: 70vh; border-radius: 8px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3); }
.lightbox-caption { margin-top: 10px; color: #fff; font-size: 1rem; text-align: center; }
.lightbox-close { position: absolute; top: 20px; right: 30px; font-size: 2.5rem; color: #fff; cursor: pointer; }
.lightbox-nav .nav-btn { position: absolute; top: 50%; font-size: 3rem; color: #fff; cursor: pointer; padding: 10px; }
#lightbox-prev { left: 30px; }
#lightbox-next { right: 30px; }
.lightbox-nav .nav-btn:hover { color: #38bdf8; }

.lightbox-caption a { color: #38bdf8; text-decoration: underline; }
.lightbox-caption a:hover { color: #ffffff; }

.gallery-caption-home a, .gallery-caption-home a:visited { color: #38bdf8 !important; text-decoration: underline; }
.gallery-caption-home a:hover { color: #ffffff !important; }

/* FOOTER */
.footer-block { 
    margin-top: 35px; /* Distanza superiore dal testo "Contattaci per..." */
    background-color: #0f172a; 
    color: #f8fafc; 
    display: flex; 
    flex-wrap: wrap; /* Permette alla riga credits di andare a capo */
    justify-content: space-between; 
    align-items: flex-start; 
    gap: 40px; 
    padding: 30px 20px; 
    box-sizing: border-box; 
    border-radius: 8px; 
}
.footer-column { flex: 1; min-width: 250px; display: flex; flex-direction: column; gap: 12px; }
.footer-item div { margin-bottom: 5px; font-size: 0.95rem; line-height: 1.4; color: #94a3b8; }
.footer-link { color: #f8fafc; text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.footer-link:hover { color: #38bdf8; }
.footer-link + .footer-link { margin-top: 6px; }
.footer-doc-info { cursor: pointer; margin-left: 6px; color: #38bdf8; font-size: 0.95rem; }
.footer-separator { margin-top: 15px; border-top: 1px solid #334155; padding-top: 10px; }

@media (max-width: 600px) {
    .footer-block { flex-direction: column; }
    .footer-column { min-width: 100%; }
}

/* NEWS */
.news-container { display: flex; flex-direction: column; gap: 35px; margin-top: 20px; }
.news-card { padding: 16px 0; border-bottom: 1px solid #e2e8f0; }
.news-title { font-size: 1.5rem; font-weight: 600; color: #0f172a; margin: 0 0 5px 0; }
.news-subtitle { font-size: 1.05rem; font-style: italic; color: #64748b; margin-bottom: 8px; }
.news-date { font-size: 0.85rem; color: #94a3b8; margin-bottom: 10px; }
.news-category a { font-size: 0.9rem; color: #2563eb; font-weight: 500; text-decoration: none; margin-bottom: 10px; display: inline-block; }
.news-text { text-align: justify; line-height: 1.6; color: #334155; margin-bottom: 12px; }
.news-image img { max-width: 100%; border-radius: 6px; }
.news-caption { font-size: 0.85rem; color: #64748b; margin-top: 5px; text-align: center; }

/* GRIGLIE GENERATIVE */
.gallery-page-container, .staff-container, .contatti-container, .documenti-container, .vision-container, .mission-container, .storia-container {
    display: grid; grid-template-columns: 1fr; gap: 30px; margin-top: 25px; padding: 10px;
}
@media (min-width: 700px) {
    .gallery-page-container, .staff-container, .contatti-container, .documenti-container { grid-template-columns: 1fr 1fr; }
}
/* MODIFICA SOLUZIONE 1: Mantiene Vision, Mission e Storia a colonna singola centrale su desktop */
@media (min-width: 900px) {
    .vision-container, .mission-container, .storia-container { 
        grid-template-columns: 1fr; 
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
    }
}
@media (min-width: 1100px) {
    .gallery-page-container, .staff-container, .contatti-container, .documenti-container { grid-template-columns: 1fr 1fr 1fr; }
}

.gallery-page-item { display: flex; flex-direction: column; gap: 12px; }
.gallery-page-media { width: 100%; border-radius: 8px; overflow: hidden; position: relative; }
.gallery-page-media img { width: 100%; height: auto; display: block; cursor: pointer; border-radius: 8px; }
.gallery-page-caption { font-size: 0.95rem; line-height: 1.5; color: #334155; text-align: justify; padding: 5px 2px; }

.staff-card, .contatti-card, .documenti-card, .vision-card, .mission-card, .storia-card {
    background: #ffffff; border-radius: 8px; border: 1px solid #e2e8f0; padding: 20px; display: flex; flex-direction: column; gap: 15px;
}
.staff-photo img { width: 100%; max-width: 260px; border-radius: 6px; display: block; }
.staff-name, .contatti-nome, .documenti-titolo, .vision-titolo, .mission-titolo, .storia-titolo { font-size: 1.4rem; font-weight: 600; color: #0f172a; }
.vision-sottotitolo, .mission-sottotitolo, .storia-sottotitolo { font-size: 1.1rem; color: #64748b; font-style: italic; }
.staff-presentazione, .contatti-descrizione, .documenti-descrizione, .vision-testo, .mission-testo, .storia-testo { text-align: justify; line-height: 1.6; color: #334155; }
.staff-allegato a, .documenti-link { color: #2563eb; text-decoration: underline; font-size: 0.95rem; }
.staff-contatto, .contatti-item, .contatti-note { font-size: 0.95rem; color: #334155; line-height: 1.4; }
.staff-contatto { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 6px; }
.vision-media img, .mission-media img, .storia-media img { width: 100%; border-radius: 6px; display: block; }
.vision-caption, .mission-caption, .storia-caption { font-size: 0.85rem; color: #64748b; text-align: center; margin-top: 5px; }

/* DESKTOP GRID & CAROUSEL */
@media (min-width: 768px) {
    .gallery-container.gallery-desktop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(30%, 1fr)); gap: 20px; }
    .gallery-container.gallery-desktop-grid .gallery-item { width: 100%; }
    .gallery-container.gallery-carousel { display: flex; flex-direction: row; flex-wrap: nowrap !important; justify-content: flex-start !important; overflow-x: hidden; scroll-behavior: smooth; margin: 0 !important; padding: 0 !important; scrollbar-width: none; }
    .gallery-container.gallery-carousel::-webkit-scrollbar { display: none; }
    .gallery-container.gallery-carousel .gallery-item { flex: 0 0 calc(33.333% - 0.5px); width: auto !important; margin: 0 !important; padding: 0 !important; box-sizing: border-box; }
    .gallery-container.gallery-carousel .gallery-item img { width: 100%; height: auto; object-fit: cover; display: block; }
    .gallery-dots { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
    .gallery-dot { width: 12px; height: 12px; background: #cbd5e1; border-radius: 50%; cursor: pointer; }
    .gallery-dot.active { background: #2563eb; }
}

/* FORM CONTATTACI */
.contattaci-container { max-width: 650px; margin: 30px auto; padding: 0 15px; box-sizing: border-box; }
.contattaci-form { display: flex; flex-direction: column; gap: 20px; background: #ffffff; padding: 25px; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.contattaci-form .form-group { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.contattaci-form label { font-weight: 600; color: #0f172a; font-size: 0.95rem; }
.contattaci-form input[type="text"], .contattaci-form input[type="email"], .contattaci-form input[type="number"], .contattaci-form textarea, .contattaci-form select {
    width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 1rem; font-family: inherit; box-sizing: border-box; transition: border-color 0.2s ease;
}
.contattaci-form input[type="file"] { padding: 8px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 6px; font-size: 0.95rem; box-sizing: border-box; width: 100%; }
.contattaci-form input:focus, .contattaci-form textarea:focus, .contattaci-form select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.contattaci-form textarea { resize: vertical; min-height: 100px; }
.campo-honeypot { display: none !important; visibility: hidden !important; }
.contattaci-form .form-actions { margin-top: 10px; }
.contattaci-form button.btn-submit { width: 100%; background: #2563eb; color: #ffffff; padding: 12px 20px; border: none; border-radius: 6px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.2s ease; }
.contattaci-form button.btn-submit:hover { background: #1d4ed8; }
.contattaci-conferma { background: #f0fdf4; border: 1px solid #bbf7d0; padding: 20px; border-radius: 6px; color: #166534; font-size: 1.05rem; text-align: center; }
.contattaci-errore { background: #fef2f2; border: 1px solid #fecaca; padding: 15px 20px; border-radius: 6px; color: #991b1b; font-size: 1rem; margin-bottom: 20px; }
.contattaci-errore, .box-dettaglio, .dettaglio-allegati-box { display: none; }
.contattaci-errore.is-visible, .box-dettaglio.is-visible, .dettaglio-allegati-box.is-visible { display: block; }
.box-dettaglio { background: #f8fafc; padding: 15px; border-radius: 6px; margin-bottom: 20px; border: 1px solid #e2e8f0; }
.dettaglio-titolo { margin-top: 0; margin-bottom: 12px; color: #0f172a; }
.dettaglio-section { margin-bottom: 10px; }
.dettaglio-allegati-box { margin-top: 15px; padding-top: 10px; border-top: 1px dashed #cbd5e1; }
.dettaglio-allegati-lista { margin-top: 5px; padding-left: 20px; }

/* ============================================================
   SEZIONE PARTNERS (AGGIORNATA & RESPONSIVE MOBILE)
   ============================================================ */
.partners-container, 
.partners-wrapper { 
    max-width: 1000px; 
    margin: 40px auto; 
    padding: 0 15px; 
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

.partners-header, 
.partners-intro { 
    text-align: center; 
    margin-bottom: 35px; 
}

.partners-title, 
.partners-page-title { 
    font-size: 2.2rem; 
    color: #0f172a; 
    margin-bottom: 8px; 
    font-weight: 700; 
}

.partners-subtitle, 
.partners-page-description { 
    font-size: 1.05rem; 
    color: #64748b; 
    margin: 0; 
}

.partners-grid, 
.partners-list { 
    display: flex; 
    flex-direction: column; 
    gap: 30px; 
    width: 100%;
}

.partner-card { 
    background-color: #ffffff; 
    border: 1px solid #e2e8f0; 
    border-left: 4px solid #2563eb; 
    border-radius: 8px; 
    padding: 25px; 
    transition: transform 0.2s ease, box-shadow 0.2s ease; 
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.partner-card:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05); 
}

.partner-card-header { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
    padding-bottom: 15px; 
    border-bottom: 1px solid #f1f5f9; 
    margin-bottom: 20px; 
}

.partner-logo-wrapper, 
.partner-logo-box { 
    width: 110px; 
    height: 70px; 
    flex-shrink: 0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background-color: #f8fafc; 
    border: 1px solid #e2e8f0; 
    border-radius: 6px; 
    padding: 6px; 
    box-sizing: border-box;
}

.partner-logo, 
.partner-logo-img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
}

.partner-name { 
    font-size: 1.35rem; 
    color: #0f172a; 
    margin: 0; 
    font-weight: 600; 
}

.partner-body, 
.partner-content { 
    margin-bottom: 20px; 
}

.partner-presentazione, 
.partner-text { 
    font-size: 0.98rem; 
    line-height: 1.6; 
    color: #334155; 
    margin: 0; 
    text-align: justify;
}

/* REGOLA ANTI-OVERFLOW IMMAGINI PARTNER */
.partner-figure, 
.partner-media { 
    margin: 20px 0; 
    text-align: center; 
    width: 100%; 
    max-width: 100%; 
    box-sizing: border-box; 
}

.partner-image, 
.partner-media-img { 
    width: 100%; 
    max-width: 100%; 
    height: auto; 
    max-height: 400px; 
    object-fit: contain; 
    background-color: #f8fafc; 
    border-radius: 6px; 
    border: 1px solid #e2e8f0; 
    box-sizing: border-box; 
    display: block;
    margin: 0 auto; 
}

.partner-figcaption, 
.partner-media-caption { 
    font-size: 0.85rem; 
    color: #64748b; 
    margin-top: 6px; 
    text-align: center;
}

.partner-card-footer { 
    margin-top: 20px; 
    padding: 15px; 
    background-color: #f8fafc; 
    border-radius: 6px; 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-between; 
    align-items: center; 
    gap: 15px; 
}

.partner-external-link, 
.partner-btn-link { 
    display: inline-block; 
    padding: 8px 18px; 
    background-color: #2563eb; 
    color: #ffffff; 
    text-decoration: none; 
    border-radius: 6px; 
    font-size: 0.9rem; 
    font-weight: 600; 
    transition: background-color 0.2s ease; 
}

.partner-external-link:hover, 
.partner-btn-link:hover { 
    background-color: #1d4ed8; 
    color: #ffffff; 
}

.partner-allegati-box, 
.partner-attachments { 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
}

.partner-allegati-title, 
.partner-attachments-heading { 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    font-weight: 700; 
    color: #64748b; 
    letter-spacing: 0.5px; 
}

.partner-allegati-list, 
.partner-attachments-list { 
    list-style: none; 
    margin: 0; 
    padding: 0; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 12px; 
}

.partner-file-link, 
.partner-file-anchor { 
    font-size: 0.9rem; 
    color: #2563eb; 
    text-decoration: none; 
    font-weight: 500; 
}

.partner-file-link:hover, 
.partner-file-anchor:hover { 
    text-decoration: underline; 
}

@media (max-width: 640px) {
    .partners-container, 
    .partners-wrapper { 
        padding: 0 10px; 
        margin: 20px auto; 
    }

    .partner-card { 
        padding: 15px; 
    }

    .partner-card-header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 12px; 
    }

    .partner-card-footer { 
        flex-direction: column; 
        align-items: stretch; 
    }

    .partner-external-link, 
    .partner-btn-link { 
        text-align: center; 
    }
}

/* ============================================================
   CUSTOM OVERRIDE PER COOKIECONSENT CMP (COMPLETO)
   ============================================================ */
#cc-main {
    --cc-font-family: inherit;
    --cc-bg: #0f172a;
    --cc-text: #f8fafc;
    --cc-primary-color: #f8fafc !important;      /* Titoli principali e sottotitoli */
    --cc-secondary-color: #cbd5e1 !important;    /* Testi descrittivi */
    --cc-cookie-category-block-bg: #1e293b;       /* Sfondo dei blocchi fisso dark */
    --cc-cookie-category-block-border: #334155;   /* Bordo dei blocchi */
    --cc-separator-border-color: #334155;
    --cc-btn-primary-bg: #2563eb;
    --cc-btn-primary-text: #ffffff;
    --cc-btn-primary-hover-bg: #1d4ed8;
    --cc-btn-secondary-bg: #334155;
    --cc-btn-secondary-text: #ffffff !important; /* Testo pulsante Personalizza */
    --cc-btn-secondary-hover-bg: #475569;
    --cc-modal-border-radius: 8px;
    --cc-overlay-bg: rgba(15, 23, 42, 0.7);
}

/* Link all'interno del banner */
#cc-main a {
    color: #38bdf8 !important;
    text-decoration: underline;
}

#cc-main a:hover {
    color: #ffffff !important;
}

/* Titolo e testi del banner principale */
#cc-main .cm__title,
#cc-main .cm__desc,
#cc-main .cm__desc h1, 
#cc-main .cm__desc h2, 
#cc-main .cm__desc h3, 
#cc-main .cm__desc h4, 
#cc-main .cm__desc p,
#cc-main .cm__desc strong {
    color: #f8fafc !important;
}

/* Pulsanti banner principale e modale */
#cc-main .cm__btn,
#cc-main .pm__btn {
    border-radius: 6px;
    font-weight: 600;
}

/* Pulsante "Personalizza" (Pulsante secondario/terziario del banner) */
#cc-main .cm__btn[data-role="show"] {
    color: #ffffff !important;
    background-color: #334155 !important;
    border: 1px solid #475569 !important;
}

#cc-main .cm__btn[data-role="show"]:hover {
    background-color: #475569 !important;
    color: #ffffff !important;
}

/* Titoli modale preferenze */
#cc-main .pm__title, 
#cc-main .pm__section-title,
#cc-main .pm__section-title-wrapper {
    color: #f8fafc !important;
}

/* Testo descrittivo nei paragrafi modale */
#cc-main .pm__section-desc {
    color: #cbd5e1 !important;
}

/* Pulsante di chiusura (X) */
#cc-main .pm__close-btn {
    fill: #94a3b8 !important;
    border-color: #334155 !important;
}

#cc-main .pm__close-btn:hover {
    fill: #ffffff !important;
    background-color: #334155 !important;
}

/* Pulsante "Salva preferenze" */
#cc-main .pm__btn[data-role="save"] {
    color: #ffffff !important;
    background-color: #334155 !important;
    border: 1px solid #475569 !important;
}

#cc-main .pm__btn[data-role="save"]:hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

/* ============================================================
   STILI PER PAGINE POLICY (PRIVACY E COOKIE)
   ============================================================ */
.content-wrapper {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.content-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 25px;
    color: #334155;
    line-height: 1.7;
    text-align: justify;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.content-box h1, 
.content-box h2, 
.content-box h3 {
    color: #0f172a;
    margin-top: 20px;
    margin-bottom: 10px;
}

.content-box p {
    margin-bottom: 15px;
}

.content-box ul, 
.content-box ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

/* ============================================================
   STILI LOGHI FOOTER
============================================================ */
.footer-loghi-wrapper {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-loghi-categoria {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-loghi-cat-title {
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.footer-cat-link {
    color: inherit;
    text-decoration: underline;
}

.footer-cat-link:hover {
    opacity: 0.8;
}

.footer-loghi-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.footer-logo-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    transition: opacity 0.2s ease;
}

.footer-logo-item.clickable {
    cursor: pointer;
}

.footer-logo-item.clickable:hover {
    opacity: 0.75;
}

.footer-logo-icon {
    width: auto;
    height: 35px;
    vertical-align: middle;
}

.footer-logo-text {
    vertical-align: middle;
}

/* ============================================================
   MODALE DEDICATA PER TESTO ESTESO LOGHI
============================================================ */
.footer-logo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo-modal.hidden {
    display: none;
}

.footer-logo-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
}

.footer-logo-modal-content {
    position: relative;
    z-index: 1;
    background: #ffffff;
    color: #333333;
    padding: 30px 25px 25px 25px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.footer-logo-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    color: #666;
}

.footer-logo-modal-close:hover {
    color: #000;
}

.footer-logo-modal-body {
    all: revert;
}

/* Riga Credits occupante il 100% di larghezza sotto le colonne */
.footer-credits-row {
    width: 100%;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    text-align: center;
}

.footer-credits-item.clickable {
    cursor: pointer;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.footer-credits-item.clickable:hover {
    opacity: 0.8;
}

.footer-credits-separator {
    opacity: 0.5;
}

/* Pulsante Flottante Torna in Alto */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    width: 45px;
    height: 45px;
    background-color: #0f172a;
    color: #ffffff;
    border: 1px solid #334155;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
    
    /* FIX PER MOBILE */
    touch-action: manipulation; /* Rimuove il ritardo di 300ms del doppio tap su mobile */
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Hover attivo SOLO su desktop / mouse */
@media (hover: hover) and (pointer: fine) {
    .back-to-top:hover {
        background-color: #2563eb;
        color: #ffffff;
        transform: translateY(-3px);
    }
}

/* Reattività immediata al tocco su mobile */
.back-to-top:active {
    background-color: #1d4ed8;
    transform: scale(0.92);
}

/* ============================================================
   CAROUSEL (OVERRIDE SPECIFICO TEMA MODERNO)
   ============================================================ */
.hp-carousel-wrapper {
    margin-top: 5px;
    margin-bottom: 5px;
}

.hp-carousel-simple {
    border-radius: 8px;
    margin: 0;
}

.hp-slide-img {
    max-height: 520px;
}

/* Styling Estetico Frecce di Navigazione */
#heroCarousel .carousel-control-prev,
#heroCarousel .carousel-control-next {
    background: none;
    opacity: 0.7;
    transition: opacity 0.25s ease, background-color 0.25s ease;
}

#heroCarousel .carousel-control-prev:hover,
#heroCarousel .carousel-control-next:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.2);
}

/* Icone Vettoriali delle Frecce */
#heroCarousel .carousel-control-prev-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
    filter: drop-shadow(0px 1px 3px rgba(0,0,0,0.6));
}

#heroCarousel .carousel-control-next-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    filter: drop-shadow(0px 1px 3px rgba(0,0,0,0.6));
}

/* Styling Estetico Puntini/Indicatori */
#heroCarousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    border-radius: 50%;
    opacity: 0.5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#heroCarousel .carousel-indicators button.active {
    opacity: 1;
    transform: scale(1.25);
    background-color: #ffffff;
}