/* ================================================================
   QSISTEMI CLOUD - NAVIGAZIONE E FOOTER
   File condiviso: assets/css/cloud-layout.css
   Caricato in include/header.php dopo site.css.

   Palette del progetto: #980000, #121212, #1b1b1b.
   Questo file corregge soltanto la navigazione/footer: non ridisegna
   form, hero o pagine informative, che hanno fogli dedicati.
   ================================================================ */

/* Desktop: testo "Contatti" al posto dell'icona busta. */
.nav .nav-contact-button {
    width: auto;
    min-width: 116px;
    height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    gap: 8px;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}
.nav .nav-contact-button .icon { display: none; }
.nav .nav-contact-label { display: inline; }
.nav .nav-contacts { flex-shrink: 0; }

/* Menu: nessun CSS inline o script di apertura duplicato. Il file
   assets/js/site.js preesistente gestisce il pulsante .nav-toggle e
   la classe .is-open nel contenitore #siteMenu. */
.nav .nav-pages { min-width: 0; }
.nav .nav-pages a { white-space: nowrap; }

/* Footer editoriale, in tre colonne ragionate e senza link ridondanti. */
.footer {
    background: #151515;
    border-top: 1px solid rgba(255,255,255,.09);
    color: rgba(255,255,255,.7);
}
.footer .footer-main {
    display: grid;
    grid-template-columns: minmax(0,1.30fr) minmax(0,1fr) minmax(0,.75fr);
    gap: clamp(30px,5vw,78px);
    padding: clamp(35px,4.5vw,62px) 0 38px;
    border-top: 0;
    align-items: start;
}
.footer .footer-about { display: block; }
.footer .footer-identity {
    display: inline-block;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -.02em;
    margin: 0 0 13px;
}
.footer .footer-about p {
    margin: 0;
    max-width: 345px;
    font-size: 13px;
    line-height: 1.8;
}
.footer .footer-col-title {
    display: block;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    margin: 2px 0 17px;
    text-transform: uppercase;
}
.footer .footer-menu,
.footer .footer-company-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 11px;
}
.footer .footer-menu a,
.footer .footer-company-menu a {
    padding: 0;
    border: 0;
    font-size: 13px;
    line-height: 1.6;
    text-decoration: none;
    color: rgba(255,255,255,.75);
    white-space: normal;
    transition: color .2s ease;
}
.footer .footer-menu a:hover,
.footer .footer-company-menu a:hover,
.footer .footer-menu a:focus-visible,
.footer .footer-company-menu a:focus-visible,
.footer .footer-menu a[aria-current="page"] {
    color: #fff;
    border: 0;
}
.footer .footer-company-menu .footer-external {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.footer .footer-company-menu .footer-external .icon {
    width: 13px;
    height: 13px;
}
.footer .footer-bottom {
    border-top: 1px solid rgba(255,255,255,.10);
    padding: 18px 0 23px;
    font-size: 12px;
    gap: 14px;
}
.footer .footer-bottom a { text-decoration: none; }
.footer .footer-bottom a:hover { color: #fff; }
.footer .footer-company { line-height: 1.6; }

/* <= 900px: hamburger DOPO i contatti e fisicamente a destra.
   Si usano order e margini per mantenere gli stessi ID e listener JS. */
@media (max-width: 900px) {
    .nav .wrap { gap: clamp(5px,1.5vw,12px); }
    .nav .logo { order: 1; min-width: 0; margin-right: auto; }
    .nav .nav-contacts { order: 2; margin-left: 0; }
    .nav .nav-toggle {
        order: 3;
        flex: 0 0 42px;
        margin-left: 0;
        display: flex;
    }
    .nav .nav-pages { order: 4; }
    .nav .nav-contact-button {
        width: 44px;
        min-width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 50%;
    }
    .nav .nav-contact-button .icon { display: inline-block; }
    .nav .nav-contact-label { display: none; }
    .footer .footer-main {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 30px 42px;
    }
    .footer .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
    .nav .wrap { gap: 6px; }
    .nav .nav-contacts { gap: 5px; }
    .nav .nav-phone,
    .nav .nav-contact-button {
        width: 39px;
        min-width: 39px;
        height: 39px;
    }
    .nav .nav-toggle { width: 40px; flex-basis: 40px; height: 40px; padding: 9px; }
    .footer .footer-main {
        grid-template-columns: 1fr;
        padding: 33px 0;
        gap: 28px;
    }
    .footer .footer-about { grid-column: auto; }
    .footer .footer-col-title { margin-bottom: 11px; }
    .footer .footer-bottom { align-items: flex-start; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
    .footer .footer-menu a,
    .footer .footer-company-menu a { transition: none; }
}

/* Selezione discreta, coerente tra menu mobile e footer. */
.footer .footer-menu a[aria-current="page"],
.footer .footer-company-menu a[aria-current="page"] {
    color: var(--red);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .35em;
}

@media (max-width: 900px) {
    .nav #siteMenu.is-open {
        gap: .25rem;
    }

    .nav #siteMenu a {
        min-height: 48px;
        padding: .85rem 1rem;
        border: 0;
        border-radius: 0;
        white-space: normal;
        color: var(--white);
    }

    .nav #siteMenu a:hover,
    .nav #siteMenu a:focus-visible,
    .nav #siteMenu a[aria-current="page"] {
        background: transparent;
        color: var(--red);
        text-decoration: underline;
        text-decoration-thickness: 1px;
        text-underline-offset: .35em;
    }
}

/* Testo chiaro sul fondo scuro; il rosso resta nell'indicatore di selezione. */
.nav .nav-pages a:hover,
.nav .nav-pages a:focus-visible,
.nav .nav-pages a[aria-current="page"],
.footer .footer-menu a:hover,
.footer .footer-menu a:focus-visible,
.footer .footer-menu a[aria-current="page"],
.footer .footer-company-menu a:hover,
.footer .footer-company-menu a:focus-visible,
.footer .footer-company-menu a[aria-current="page"] {
    color: var(--white);
    text-decoration-color: var(--red);
}

.nav .nav-pages a[aria-current="page"],
.footer .footer-menu a[aria-current="page"],
.footer .footer-company-menu a[aria-current="page"] {
    font-weight: 600;
}

@media (max-width: 900px) {
    .nav #siteMenu a:hover,
    .nav #siteMenu a:focus-visible,
    .nav #siteMenu a[aria-current="page"] {
        color: var(--white);
        text-decoration-color: var(--red);
    }
}
