/* ============================================================
   chrome.css — header sticky + mega-menu + footer 4-col + newsletter
   Estratto da nuova_home/hero.css (parte chrome) e nuova_home/footer.css.
   Token consumati da tokens.css.
   ============================================================ */

/* ---------- 1. TOP-BAR (sticky header) ---------- */

.top-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    height: 88px;
    padding: 0 clamp(24px, 4.5%, 72px);
    gap: clamp(24px, 4vw, 56px);
    background: rgba(15, 18, 26, 0);
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
    border-bottom: 1px solid rgba(255,255,255,0);
    transition: background .35s ease, backdrop-filter .35s ease, border-color .35s ease, height .3s ease, box-shadow .3s ease;
}

.top-bar.is-scrolled {
    background: rgba(76, 112, 175, 0.78);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border-bottom-color: rgba(255,255,255,.14);
    height: 72px;
    box-shadow: 0 10px 30px rgba(20, 40, 80, .22);
}

/* Static variant (inner pages senza hero slideshow): top-bar solida blu
   high-contrast da subito, indipendente dallo scroll. Match frozen
   nuova_home/acquista.php (rgba(76,112,175,0.92) + blur + shadow). */
.top-bar.top-bar--static {
    background: rgba(76, 112, 175, 0.92);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    height: 72px;
    box-shadow: 0 10px 30px rgba(20, 40, 80, .18);
}
.top-bar--static .btn-stima { border-radius: 6px; }

/* Compensa il fixed header (height 72px desktop) sulle pagine interne, evitando
   che il primo block (page-header-gradient, hero singolo immobile, ecc.) finisca
   sotto la barra. La body class `estia-inner` è aggiunta dal filter in
   functions.php su tutte le pagine NON-transparent (cioè tutto tranne
   front-page e template modello-amministratore). Evita ambiguità tra
   front statica (body.home.page) e /blog/ posts page (body.home.blog). */
body.estia-inner {
    padding-top: 72px;
}
/* Il mobile drawer nasconde nav/scopri sotto 820px: l'header resta alto 72px. */
@media (max-width: 760px) {
    body.estia-inner {
        padding-top: 72px;
    }
}


/* ---------- 2. LOGO + MAIN-NAV + TOP-ACTIONS ---------- */

.logo { display: inline-flex; align-items: center; }
.logo img {
    display: block;
    height: 30px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.25));
}

.logo__text {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--white);
}

.logo__mark {
    color: var(--yellow);
    font-size: 0.625rem;
    font-weight: 700;
    vertical-align: super;
    margin-left: 2px;
}

.main-nav {
    display: flex;
    gap: clamp(20px, 2.4vw, 38px);
    align-items: center;
}

/* wp_nav_menu emette <li> senza <ul> wrapper (items_wrap='%3$s' nel header.php).
   Reset list-style/marker default del browser per evitare pallini visibili. */
.main-nav li {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
}
.main-nav li::marker { content: none; }

.main-nav a {
    position: relative;
    color: var(--nav-color);
    text-transform: uppercase;
    font-weight: 500;
    font-size: 12.5px;
    letter-spacing: 1.6px;
    padding: 26px 2px;
    transition: color .18s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.main-nav a::after {
    content: "";
    position: absolute;
    left: 2px; right: 2px; bottom: 22px;
    height: 1.5px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .22s ease;
}
.main-nav a:hover { color: var(--accent); }
.main-nav a:hover::after { transform: scaleX(1); }

.top-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: clamp(16px, 2vw, 28px);
}

/* divider pill between nav and actions */
.top-actions::before {
    content: "";
    width: 1px; height: 22px;
    background: rgba(255,255,255,.28);
    margin-right: 4px;
}

.scopri {
    color: #fff;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 1.4px;
    padding: 10px 2px;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,.3);
    transition: color .15s ease;
}
.scopri svg { transition: transform .2s ease; }
.scopri[aria-expanded="true"] svg { transform: rotate(180deg); }
.scopri::after {
    content: "";
    position: absolute;
    left: 2px; right: 22px; bottom: 4px;
    height: 1.5px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .22s ease;
}
.scopri:hover::after,
.scopri[aria-expanded="true"]::after { transform: scaleX(1); }
.scopri:hover { color: var(--accent); }

.btn-stima {
    background: var(--accent);
    color: var(--accent-ink);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 1.6px;
    padding: 14px 30px;
    /* 6px sharp: nel frozen `.hero[data-buttons="sharp"] .btn-stima` matchava
       perché .btn-stima era dentro <header> dentro <section class="hero">.
       In WP header.php è sibling del block hero-slideshow (non descendant),
       quindi la regola scoped non si applicherebbe. Default a 6px direttamente. */
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(245, 190, 66, .28), inset 0 1px 0 rgba(255,255,255,.3);
    transition: background .15s ease, transform .15s ease, box-shadow .2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.btn-stima::after {
    content: "→";
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 15px;
    transition: transform .2s ease;
}
.btn-stima:hover {
    background: var(--accent-hover);
    box-shadow: 0 10px 24px rgba(245, 190, 66, .38), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn-stima:hover::after { transform: translateX(3px); }
.btn-stima:active { transform: translateY(1px); }


/* ---------- 3. MEGA-MENU ---------- */

.mega-menu {
    position: fixed;
    z-index: 1999;
    top: 88px;
    left: 50%;
    transform: translate(-50%, -8px);
    width: min(var(--content-max), calc(100% - 80px));
    background: rgba(255,255,255,.96);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(10, 20, 40, .35), 0 0 0 1px rgba(255,255,255,.5) inset;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
}
.mega-menu[hidden] { display: none; }
.mega-menu.is-open {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}
.mega-menu__inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 40px 48px 44px;
    column-gap: 36px;
}
.mega-col { padding: 0 12px 0 0; border-right: 1px solid var(--chrome-divider); }
.mega-col:last-child { border-right: 0; padding-right: 0; }

.col-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.col-heading img { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.col-heading h3 {
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.mega-col ul { display: grid; gap: 12px; }
.mega-col li a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #3a3a3a;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    padding: 4px 0;
    transition: color .15s ease, gap .15s ease;
}
.mega-col li a::before {
    content: "";
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--accent);
    opacity: .6;
    flex-shrink: 0;
    transition: opacity .15s ease;
}
.mega-col li a:hover { color: var(--accent); gap: 14px; }
.mega-col li a:hover::before { opacity: 1; }


/* ---------- 4. FOOTER 4-COL ---------- */

.site-footer {
    background: var(--blue-footer);
    color: var(--white);
    border-top: 4px solid var(--yellow);
    padding: 72px 48px 24px;
    font-family: var(--font-body);
    font-weight: 400;
}

.footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.3fr 1.4fr;
    gap: 64px;
}

.footer-col h4 {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 28px;
}

.footer-brand .brand-logo {
    display: inline-block;
    color: var(--white);
    text-decoration: none;
    margin-bottom: 22px;
}

.footer-brand__logo {
    display: block;
    height: 24px;
    width: auto;
}

.footer-brand .logo__mark {
    color: var(--yellow);
    font-size: 0.625rem;
    font-weight: 700;
    vertical-align: super;
    margin-left: 2px;
}

.footer-brand p {
    color: var(--footer-link);
    font-size: 0.9375rem;
    line-height: 1.55;
    margin: 0 0 26px;
    max-width: 260px;
}

.footer-brand .socials {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: row;
    gap: 18px;
}
.footer-brand .socials a {
    color: var(--footer-link);
    transition: color 200ms, transform 200ms;
    display: inline-flex;
}
.footer-brand .socials a:hover {
    color: var(--white);
    transform: translateY(-2px);
}
.footer-brand .socials svg {
    width: 22px;
    height: 22px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.footer-col ul a {
    color: var(--footer-link);
    font-size: 0.9375rem;
    font-weight: 400;
    text-decoration: none;
    transition: color 200ms;
}
.footer-col ul a:hover {
    color: var(--white);
}

.newsletter p {
    color: var(--footer-link);
    font-size: 0.9375rem;
    line-height: 1.55;
    margin: 0 0 20px;
}
/* Solo l'input email riceve styling full-width: il selettore generico
   `.newsletter input` matcherebbe anche il checkbox del consenso (gonfiandolo
   a width:100% e facendo overflow del label) e gli hidden action/nonce. */
.newsletter input[type="email"] {
    width: 100%;
    background: var(--input-dark);
    border: 0;
    padding: 14px 18px;
    color: var(--white);
    font-size: 0.9375rem;
    border-radius: 4px;
    font-family: inherit;
}
.newsletter input[type="email"]::placeholder {
    color: var(--footer-muted);
}
.newsletter button {
    width: 100%;
    margin-top: 14px;
    background: var(--yellow);
    color: var(--blue-dark);
    padding: 14px;
    border: 0;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: inherit;
    cursor: pointer;
    transition: background 200ms;
}
.newsletter button:hover {
    background: var(--yellow-hover);
}

/* ----- bottom bar ----- */
.footer-bottom {
    max-width: var(--container-max);
    margin: 40px auto 0;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--footer-muted);
}
.footer-copy { margin: 0; }
.footer-legal {
    display: flex;
    gap: 24px;
    /* Audit F-27: il fallback emette <a> nudi, ma wp_nav_menu con
       items_wrap '%3$s' emette <li> direttamente dentro <nav>. Il
       container flex sopra applica gap, ma senza reset di list-style
       il browser mostra marker (•) e padding indent. */
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-legal li {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-legal a {
    color: var(--footer-muted);
    text-decoration: none;
    transition: color 200ms;
}
.footer-legal a:hover {
    color: var(--white);
}

/* sr-only helper scoped al footer (l'input label newsletter) */
.site-footer .u-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .mega-menu__inner { grid-template-columns: 1fr 1fr; }
    .mega-col:nth-child(2) { border-right: 0; }
    .mega-col:nth-child(1), .mega-col:nth-child(2) {
        border-bottom: 1px solid var(--chrome-divider);
        padding-bottom: 18px;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 48px 40px;
    }
}

@media (max-width: 820px) {
    .site-footer { padding: 56px 24px 24px; }
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-top: 32px;
    }
}

/* Hamburger drawer attivo da <1100px (tablet landscape iPad incluso fino a
   mobile). Nasconde main-nav/scopri qui; .mobile-toggle viene mostrato in
   una @media SEPARATA dopo la sua base rule (vedi sezione 5) per non essere
   sovrascritto dal display:none base (CSS cascade order). Sotto 820 si
   attiva la sticky bottom CTA bar (.mobile-cta-bar) e si nasconde
   .btn-stima dall'header. CLAUDE.md §7 / §4. */
@media (max-width: 1100px) {
    .main-nav { display: none; }
    .scopri   { display: none; }
    .top-actions::before { display: none; }
}

/* Btn-stima header: visibile su tablet (820-1100), nascosto su mobile
   (<820) dove e' sostituito dalla sticky bottom bar. */
@media (max-width: 820px) {
    .btn-stima { display: none; }
}

@media (max-width: 760px) {
    .top-bar { padding: 14px 18px; }
}

@media (max-width: 520px) {
    .footer-legal { flex-wrap: wrap; gap: 12px; }
}

/* ---------- 5. MOBILE TOGGLE (hamburger) + DRAWER ---------- */

/* Hamburger trigger: trasparente con icona giallo brand. Yellow su
   qualsiasi stato (hero transparent, top-bar solido blu) garantisce
   contrasto. No border per look minimale. */
.mobile-toggle {
    display: none;                     /* visibile <1100px via @media sopra */
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--yellow, #F5BE42);     /* svg currentColor = yellow brand */
    padding: 8px 10px;
    cursor: pointer;
    transition: background .15s ease;
}
.mobile-toggle:hover  { background: rgba(255,255,255,.10); }
.mobile-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Show hamburger trigger <1100px. Questa @media DEVE stare DOPO la base
   .mobile-toggle{display:none} per vincere il CSS cascade (stessa
   specificita', ordine successivo vince). Spostarla sopra romperebbe
   l'override e il trigger resterebbe sempre nascosto. */
@media (max-width: 1100px) {
    .mobile-toggle { display: inline-flex; }
}

/* Drawer: dark blue brand background + white text (sostituisce il vecchio
   bg #fff + testo nero). Allineato al brand Estia (vedi footer) e al
   trigger hamburger per continuita' visiva. */
.mobile-menu {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(360px, 84vw);
    z-index: 2100;                     /* sopra mega-menu (1999) */
    background: var(--blue-hero, #243E6A);
    color: #fff;
    box-shadow: -8px 0 36px rgba(0,0,0,.32);
    transform: translateX(100%);
    transition: transform .28s ease;
    overflow-y: auto;
}
.mobile-menu.is-open { transform: translateX(0); }
.mobile-menu[hidden] { display: none; }

.mobile-menu__inner {
    padding: 60px 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100%;
}

.mobile-menu__close {
    position: absolute;
    top: 14px; right: 14px;
    width: 36px; height: 36px;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}
.mobile-menu__close:hover { background: rgba(255,255,255,.10); }
.mobile-menu__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mobile-menu__list,
.mobile-menu nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mobile-menu__list li,
.mobile-menu nav ul li { display: block; }
.mobile-menu__list a,
.mobile-menu nav ul li a {
    display: block;
    padding: 14px 12px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    transition: color .15s ease, background .15s ease;
}
.mobile-menu__list a:hover,
.mobile-menu nav ul li a:hover {
    color: var(--accent, #F5BE42);
    background: rgba(255,255,255,.06);
}

/* Submenu accordion (depth=2): voci con .menu-item-has-children mostrano
   un chevron via ::after. Tap toggle is-expanded sul <li> + aria-expanded
   sul <a>. Default chiuso. Solo dentro mobile-menu (no scope leak). */
.mobile-menu__list .sub-menu,
.mobile-menu nav ul .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .28s ease;
}
.mobile-menu__list .menu-item-has-children.is-expanded > .sub-menu,
.mobile-menu nav ul .menu-item-has-children.is-expanded > .sub-menu {
    max-height: 600px;
}
.mobile-menu__list .sub-menu li a,
.mobile-menu nav ul .sub-menu li a {
    padding-left: 28px;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,.78);   /* leggermente dimmed per gerarchia visiva su bg blu */
    border-bottom-color: rgba(255,255,255,.05);
}
.mobile-menu__list .menu-item-has-children > a::after,
.mobile-menu nav ul .menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 8px; height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 8px;
    transition: transform .2s ease;
    vertical-align: middle;
}
.mobile-menu__list .menu-item-has-children.is-expanded > a::after,
.mobile-menu nav ul .menu-item-has-children.is-expanded > a::after {
    transform: rotate(-135deg);
}

.mobile-menu__backdrop {
    position: fixed;
    inset: 0;
    z-index: 2050;                     /* sotto drawer (2100), sopra mega-menu */
    background: rgba(15, 25, 50, .55);
    opacity: 0;
    transition: opacity .24s ease;
}
.mobile-menu__backdrop.is-open { opacity: 1; }
.mobile-menu__backdrop[hidden] { display: none; }

body.mobile-menu-open { overflow: hidden; }

/* ---------- 6. STICKY MOBILE CTA BAR (<820px only) ---------- */

/* Default: hidden. Mostrato solo da media query mobile sotto.
   z-index 2000 = sotto drawer (2100) e backdrop (2050) ma sopra contenuto. */
.mobile-cta-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: var(--blue-header, #4C70AF);
    padding: 12px 20px;
    box-shadow: 0 -2px 12px rgba(0,0,0,.18);
}
.mobile-cta-bar__btn {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--yellow, #F5BE42);
    color: var(--blue-dark, #1F3A6D);
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 8px;
    transition: background .15s ease;
}
.mobile-cta-bar__btn:hover { background: var(--yellow-hover, #E8AE30); }
.mobile-cta-bar__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Variant solo homepage: scroll-aware. Hidden off-screen di default,
   slide-up quando body ha .is-cta-visible (toggled da chrome.js su
   scroll-down). Sulle altre pagine il modifier non c'è → sempre visibile. */
.mobile-cta-bar--scroll-aware {
    transform: translateY(100%);
    transition: transform .25s ease;
}
body.is-cta-visible .mobile-cta-bar--scroll-aware {
    transform: translateY(0);
}

@media (max-width: 820px) {
    .mobile-cta-bar { display: block; }
    body { padding-bottom: 76px; }
}

/* ---------- Newsletter consent + status ---------- */
.newsletter-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0;
    font-size: 0.75rem;
    color: var(--footer-link, #A8B5CE);
    line-height: 1.4;
}
.newsletter-consent input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}
.newsletter-consent a {
    color: var(--yellow, #F5BE42);
    text-decoration: underline;
}
.newsletter-status {
    min-height: 1.2em;
    margin-top: 8px;
    font-size: 0.8125rem;
    color: var(--footer-link, #A8B5CE);
}
.newsletter-status.is-success { color: #6EE7B7; }
.newsletter-status.is-error   { color: #FCA5A5; }

/* Home SEO H1: stile spostato in blocks/home-seo-h1/style.css (block dedicato). */
