/* Premium layer: caricato dopo custom.css. Le sezioni sono limitate alla home (body.home). */
:root {
    --gold: #e5c24a;
    --gold-deep: #c4944b;
    --ink: #0a0c10;
    --glass: rgba(18, 21, 28, 0.55);
    --glass-border: rgba(255, 255, 255, 0.09);
    --text-soft: rgba(255, 255, 255, 0.72);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; }
::selection { background: rgba(229, 194, 74, 0.35); color: #fff; }
body::-webkit-scrollbar-thumb { background: linear-gradient(var(--gold), var(--gold-deep)); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ---------- Sfondo ambientale ---------- */
:is(body.home, body.city-page) { background-color: var(--ink); }
:is(body.home, body.city-page)::before {
    content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background:
        radial-gradient(60rem 40rem at 85% -10%, rgba(229, 194, 74, 0.11), transparent 60%),
        radial-gradient(50rem 40rem at -10% 45%, rgba(88, 112, 255, 0.08), transparent 60%),
        radial-gradient(45rem 35rem at 100% 85%, rgba(229, 194, 74, 0.07), transparent 60%);
}

/* ---------- Bottoni ---------- */
a.btn { position: relative; overflow: hidden; isolation: isolate; transition: transform .35s var(--ease), box-shadow .35s var(--ease), color .2s; letter-spacing: 0.04em; }
a.btn::after {
    content: ""; position: absolute; inset: 0; z-index: -1; transform: translateX(-120%) skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); transition: transform .8s var(--ease);
}
a.btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(229, 194, 74, 0.55), 0 14px 34px rgba(229, 194, 74, 0.18); }
a.btn:hover::after { transform: translateX(120%) skewX(-20deg); }
form input[type=submit] { transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s; }
form input[type=submit]:not([disabled]):hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(229, 194, 74, 0.25); }

/* ---------- Header ---------- */
header#masthead .header-navigation ul { font-size: 0.8125rem; letter-spacing: 0.16em; text-transform: uppercase; gap: 0.25rem; align-items: center; }
header#masthead .header-navigation ul li { margin: 0; padding: 0.55rem 1.1rem; border: 1px solid transparent; border-radius: 999px; transition: background .3s, border-color .3s; }
header#masthead .header-navigation ul li:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(229, 194, 74, 0.35); }
/* Header sempre fixed (niente salto absolute→fixed): sfondo, blur, altezza e logo si animano con la stessa curva. */
header#masthead {
    position: fixed; height: 6rem; opacity: 1; will-change: height, background-color;
    background-color: rgba(10, 12, 16, 0); border-bottom: 1px solid rgba(255, 255, 255, 0);
    backdrop-filter: blur(0px) saturate(100%); -webkit-backdrop-filter: blur(0px) saturate(100%);
    transition: height .6s var(--ease), background-color .6s var(--ease), border-color .6s var(--ease), backdrop-filter .6s var(--ease), -webkit-backdrop-filter .6s var(--ease);
}
header#masthead.scrolled { height: 4.25rem; background-color: rgba(10, 12, 16, 0.72); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border-bottom-color: rgba(255, 255, 255, 0.06); box-shadow: none; opacity: 1; }
header#masthead .site-branding img,
header#masthead.hide .site-branding img,
header#masthead.scrolled .site-branding img { transition: width .6s var(--ease), opacity .5s var(--ease); }
.upButton { background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--glass-border); transition: opacity .4s, transform .35s var(--ease), border-color .3s; }
.upButton:hover { transform: translateY(-3px); border-color: rgba(229, 194, 74, 0.6); }

/* ---------- Hero ---------- */
body.home .viewport-shapes__item .shape {
    background: radial-gradient(circle at 35% 35%, rgba(229, 194, 74, 0.16), rgba(229, 194, 74, 0) 65%);
    box-shadow: none; filter: blur(30px); animation: floaty 18s ease-in-out infinite;
}
body.home .viewport-shapes__item.item-1 .shape { background: radial-gradient(circle at 40% 40%, rgba(88, 112, 255, 0.14), rgba(88, 112, 255, 0) 65%); animation-duration: 24s; }
body.home .viewport-shapes__item.item-3 .shape { animation-delay: -9s; }
@keyframes floaty { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(3vw, 2vw, 0) scale(1.06); } }

/* Hero: altezza dal contenuto, logo allineato a sinistra con il titolo */
body.home .home-viewport.viewport { height: auto; min-height: 100vh; padding: 8rem 0 7rem; }
body.home .head_logo { max-width: 75%; margin: 0 auto; padding: 0 16px; justify-content: flex-start; }
body.home .head_logo img { width: clamp(88px, 9vw, 150px); height: auto; }
body.home .hero-banner { padding-top: 2.25rem; }
/* Desktop: hero compatta, il titolo scala anche con l'altezza così "parliamone" resta dentro la viewport */
@media (min-width: 769px) {
    body.home .home-viewport.viewport { padding: 6.5rem 0 5rem; }
    body.home .hero-banner { padding-top: 0.75rem; }
    body.home .hero-banner .hero-title { font-size: min(5.5vw, 10vh); }
    body.home .hero-banner .hero-subtitle p { margin-top: 1.5rem; }
    body.home .hero-banner .hero-btn { margin-top: 2rem; }
}
@media (max-width: 768px) {
    body.home .head_logo { max-width: 100%; }
    /* Mobile: 100svh = area realmente visibile (esclude la barra del browser); hero più compatta così il pulsante resta in vista */
    body.home .home-viewport.viewport { min-height: 100vh; min-height: 100svh; padding: 5rem 0 4.5rem; }
    body.home .head_logo img { width: clamp(64px, 18vw, 96px); }
    body.home .hero-banner { padding-top: 0.5rem; }
    body.home .hero-banner .hero-title { font-size: min(9.5vw, 6.5svh); }
    body.home .hero-banner .hero-subtitle p { margin-top: 1rem; font-size: 1.05rem; line-height: 1.5; }
    body.home .hero-banner .hero-btn { margin-top: 1.5rem; }
    body.home .hero-banner .hero-btn a.btn { font-size: 1rem; padding: 0.95rem 2.25rem; }
}
.hero-banner .hero-title { letter-spacing: -0.035em; color: #fff; }
.hero-banner .hero-title .text-color {
    background: linear-gradient(110deg, #f6e08a 0%, #e5c24a 35%, #c4944b 55%, #f6e08a 100%); background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: slideInFromBottom 1s forwards, shimmer 7s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }
.hero-banner .hero-subtitle { color: var(--text-soft); }
.hero-banner .hero-subtitle p { color: var(--text-soft); }

/* ---------- Sezione principale ---------- */
body.home .check-ico { width: 1.5rem; height: 1.5rem; padding: 0.3rem; margin-right: 0.9rem; vertical-align: middle; border-radius: 50%; background-color: rgba(229, 194, 74, 0.12); box-shadow: 0 0 0 1px rgba(229, 194, 74, 0.35); background-origin: content-box; }
@keyframes floaty-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- Contatto ---------- */
:is(body.home, body.city-page) section#contact-cta::before { background-color: rgba(6, 8, 12, 0.82); }
:is(body.home, body.city-page) section#contact-cta .container .caption {
    max-width: 52rem; margin: 0 auto; padding: 3.5rem 3rem; border-radius: 32px;
    background: var(--glass); border: 1px solid var(--glass-border);
    backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
    box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
:is(body.home, body.city-page) section#contact-cta .pre-title { color: var(--gold); letter-spacing: 0.22em; }
:is(body.home, body.city-page) section#contact-cta h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); letter-spacing: -0.035em; }
:is(body.home, body.city-page) section#contact-cta p { color: var(--text-soft); }
/* ---------- Form di contatto ---------- */
.wpcf7 form { margin: 2rem 0 0; text-align: left; }
.wpcf7 form p { margin: 0 0 1.25rem; padding: 0; }
.wpcf7 form .name { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.wpcf7 form .name p { width: auto; }
.wpcf7 label { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-soft); }
.wpcf7 label br { display: none; }
.wpcf7 .wpcf7-form-control-wrap { display: block; margin-top: 0.55rem; }
.wpcf7 form input:not([type=submit]):not([type=checkbox]),
.wpcf7 form textarea {
    width: 100%; padding: 0.95rem 1.1rem; font-size: 1rem; letter-spacing: normal; text-transform: none; color: #fff;
    background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 14px;
    transition: border-color .3s, box-shadow .3s, background .3s;
}
.wpcf7 form textarea { height: auto; min-height: 9rem; resize: vertical; }
.wpcf7 form input:not([type=submit]):not([type=checkbox]):focus,
.wpcf7 form textarea:focus { background: rgba(255, 255, 255, 0.07); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(229, 194, 74, 0.15); }
.wpcf7 form ::placeholder { color: rgba(255, 255, 255, 0.5); opacity: 1; }
.wpcf7 form input[type=checkbox] { width: 1.15rem; height: 1.15rem; margin: 0 0.6rem 0 0; vertical-align: -0.2rem; accent-color: var(--gold); }
.wpcf7 form p:has(.wpcf7-acceptance) .wpcf7-form-control-wrap, .wpcf7 form p:has(.wpcf7-acceptance) .wpcf7-acceptance { display: inline; margin: 0; }
.wpcf7 form .wpcf7-acceptance .wpcf7-list-item { margin: 0; }
.wpcf7 form.init .wpcf7-response-output, .wpcf7 .wpcf7-response-output:empty { display: none; }
.wpcf7 form p:has(.wpcf7-acceptance) { font-size: 0.9rem; line-height: 1.6; color: var(--text-soft); }
.wpcf7 form p:has(.wpcf7-acceptance) a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.wpcf7 form input[type=submit] { width: auto; min-width: 13rem; margin-top: 0.5rem; padding: 1.05rem 2.75rem; cursor: pointer; }
.wpcf7 form input[type=submit]:not([disabled]):hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(229, 194, 74, 0.55), 0 14px 34px rgba(229, 194, 74, 0.2); }
.wpcf7 form .wpcf7-not-valid-tip { margin-top: 0.4rem; font-size: 0.85rem; color: #ff8a80; }
.wpcf7 form .wpcf7-not-valid { border-color: #ff8a80; }
.wpcf7 .wpcf7-response-output { margin: 1.25rem 0 0; padding: 0.9rem 1.1rem; font-size: 0.95rem; color: #ffb4ab; border: 1px solid rgba(255, 138, 128, 0.4); border-radius: 14px; }
.wpcf7 form.sent .wpcf7-response-output { color: #b9f6ca; border-color: rgba(185, 246, 202, 0.4); }

/* ---------- Footer ---------- */
footer { background: linear-gradient(180deg, #0c0e13, #07080b); border-top: 1px solid rgba(255, 255, 255, 0.06); position: relative; }
footer::before { content: ""; position: absolute; top: -1px; left: 50%; width: min(40rem, 70%); height: 1px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .6; }
footer h3 { margin: 0 0 1rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
footer .footer__top { padding: 4.5rem 0 3rem; }
footer .footer__top .row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 0.8fr; gap: 2.5rem; margin: 0; align-items: start; }
footer .footer__top .row .col { max-width: none; width: auto; padding: 0; }
footer .logo img { max-width: 96px; height: auto; }
footer .footer-tag { max-width: 17rem; margin: 1rem 0 0; font-size: 0.95rem; line-height: 1.6; color: var(--text-soft); }
footer .col p, footer .col li { margin: 0.6rem 0 0; font-size: 0.95rem; }
footer .col-social-content a { width: 2.75rem; height: 2.75rem; border-color: rgba(255, 255, 255, 0.14); transition: border-color .3s, transform .35s var(--ease), background .3s; }
footer .col-social-content a:hover { border-color: var(--gold); background: rgba(229, 194, 74, 0.08); transform: translateY(-3px); }
.footer__bottom { padding: 1.75rem 0; font-size: 0.85rem; color: rgba(255, 255, 255, 0.5); border-top: 1px solid rgba(255, 255, 255, 0.07); }
.footer__bottom .row { margin: 0; }

@media (max-width: 992px) {
    footer .footer__top .row { grid-template-columns: 1fr 1fr; gap: 2.5rem 2rem; }
    footer .footer__top .row .col { padding: 0; text-align: left; }
}
@media (max-width: 576px) {
    footer .footer__top { padding: 3.5rem 0 2rem; }
    footer .footer__top .row { grid-template-columns: 1fr; gap: 2.25rem; justify-items: center; text-align: center; }
    footer .footer__top .row .col { width: 100%; padding: 0; text-align: center; }
    footer .col p.footer-tag { margin-left: auto; margin-right: auto; text-align: center; }
    footer .col-social-content { justify-content: center; }
    #menu-menu-footer { align-items: center; }
    .footer__bottom, .footer__bottom .row { justify-content: center; text-align: center; padding-left: 0; padding-right: 0; }
    .footer__bottom .row .col.copy { flex: 0 0 100%; width: 100%; max-width: 100%; padding: 0; text-align: center; }
    .footer__bottom .site-info { text-align: center; }
    /* spazio sotto il copyright: i pulsanti fissi (cookie, torna su) non coprono il testo a fine pagina */
    .footer__bottom { padding-bottom: 6rem; }
}

/* ---------- Rivelazione allo scroll (solo browser che la supportano) ---------- */
@keyframes reveal { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
    :is(body.home, body.city-page) section#contact-cta .caption {
        animation: reveal linear backwards; animation-timeline: view(); animation-range: entry 5% entry 45%;
    }
}

@media (max-width: 768px) {
    :is(body.home, body.city-page) section#contact-cta .container .caption { padding: 2.25rem 1.5rem; border-radius: 24px; }
    header#masthead .header-navigation ul li { padding: 0.45rem 0.7rem; }
    body.home .home-viewport::after { background-size: 44px 44px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 560px) { .wpcf7 form .name { grid-template-columns: 1fr; } .wpcf7 form input[type=submit] { width: 100%; } }

/* ---------- Menu mobile ---------- */
.nav-toggle { display: none; }
@media (max-width: 768px) {
    header#masthead .header-navigation .menu-anchor { display: none; }

    header#masthead.has-toggle .header-navigation .menu-anchor { display: list-item; }
    header#masthead.has-toggle .nav-toggle {
        display: flex; flex-direction: column; justify-content: center; gap: 6px; position: relative; z-index: 1600;
        width: 44px; height: 44px; padding: 0 11px; cursor: pointer; border-radius: 50%;
        background: var(--glass); border: 1px solid var(--glass-border);
    }
    header#masthead.has-toggle .nav-toggle span { display: block; height: 2px; border-radius: 2px; background: var(--gold); transition: transform .35s var(--ease), opacity .2s; }
    header#masthead.has-toggle.nav-open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
    header#masthead.has-toggle.nav-open .nav-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }
    header#masthead.has-toggle .header__bar { display: flex; align-items: center; justify-content: space-between; padding-right: 1rem; }

    header#masthead.has-toggle .header-navigation {
        position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center;
        background: rgba(8, 10, 14, 0.985); opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility .35s;
    }
    header#masthead.has-toggle.nav-open .header-navigation { opacity: 1; visibility: visible; }
    header#masthead.has-toggle .header-navigation ul { flex-direction: column; align-items: center; gap: 0.4rem; font-size: 1.1rem; }
    header#masthead.has-toggle .header-navigation ul li { padding: 0.8rem 2rem; }
    /* backdrop-filter e will-change creano un contenitore per gli elementi fixed */
    header#masthead.has-toggle.nav-open { backdrop-filter: none; -webkit-backdrop-filter: none; will-change: auto; transform: none; }
}

.viewport .bottom_btn svg path { fill: var(--gold); }

/* ---------- Riquadro autore (pagine libri e articoli) ---------- */
.author-box {
    display: flex; gap: 1.5rem; align-items: center; max-width: 52rem; margin: 3rem auto; padding: 1.75rem 2rem;
    border-radius: 24px; border: 1px solid var(--glass-border); background: rgba(18, 21, 28, 0.72); text-align: left;
    width: calc(100% - 3rem);
}
.author-box__photo { flex-shrink: 0; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: center 40%; border: 2px solid rgba(229, 194, 74, 0.55); }
.author-box__label { display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.author-box__name { margin: 0.25rem 0 0.5rem; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.author-box__bio { margin: 0; font-size: 0.95rem; line-height: 1.65; color: var(--text-soft); }
.author-box__links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0.9rem 0 0; font-size: 0.82rem; font-weight: 600; }
.author-box__links a { color: var(--gold) !important; text-decoration: none; }
.author-box__links a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 600px) {
    .author-box { flex-direction: column; align-items: flex-start; padding: 1.5rem; width: calc(100% - 2.5rem); }
}

/* ---------- Pulsante "torna su": cerchio scuro da 44px con freccia a V, in basso a destra (il pulsante cookie sta a sinistra) ---------- */
.upButton {
    right: 1.25rem; bottom: 1.25rem; width: 44px; height: 44px; padding: 0; box-sizing: border-box;
    background: rgba(14, 16, 21, 0.92); border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: none; -webkit-backdrop-filter: none; transition: opacity .4s, transform .35s var(--ease), border-color .3s, background .3s;
}
.upButton svg { display: none; }
.upButton::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 11px;
    border-top: 2px solid var(--gold); border-left: 2px solid var(--gold); border-radius: 2px;
    transform: translate(-50%, -30%) rotate(45deg); transition: border-color .3s;
}
.upButton:hover { transform: translateY(-3px); border-color: var(--gold); background: rgba(229, 194, 74, 0.12); }
.upButton:hover::after { border-color: #fff; }
@media (max-width: 768px) { .upButton { right: .75rem; bottom: .75rem; } }

/* ---------- Sfondo spaziale dell'hero (js/space-bg.js) ----------
   Livelli separati: nebulose, bagliore del cursore e galassia si muovono solo con transform (compositor), le stelle sono una canvas. */
#space-bg {
    position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .6s ease;
    -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent);
}
#space-bg.is-ready { opacity: 1; }
#space-bg canvas, #space-bg .sb-glow { position: absolute; display: block; }
#space-bg .sb-nebula { will-change: transform; }
#space-bg .sb-galaxy { opacity: 0.62; will-change: transform; transform-origin: 50% 50%; }
#space-bg .sb-stars { left: 0; top: 0; width: 100%; height: 100%; }
#space-bg .sb-glow {
    left: 0; top: 0; width: 560px; height: 560px; opacity: 0; will-change: transform, opacity;
    background: radial-gradient(closest-side, rgba(229, 194, 74, 0.13), rgba(88, 112, 255, 0.06) 50%, rgba(88, 112, 255, 0));
}
/* Livello fisso sotto l'hero: stelle rade e bagliore leggero, visibile dove le sezioni sono trasparenti */
#space-fixed { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0; }
#space-fixed .sf-stars { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
#space-fixed .sf-glow {
    position: absolute; left: 0; top: 0; width: 420px; height: 420px; opacity: 0; will-change: transform, opacity;
    background: radial-gradient(closest-side, rgba(229, 194, 74, 0.09), rgba(88, 112, 255, 0.04) 50%, rgba(88, 112, 255, 0));
}

/* ---------- Cursore: anello a inversione automatica (mix-blend-mode: difference), si riempie sui link ---------- */
#mouse-circle {
    left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: transparent; border: 1.5px solid #fff;
    box-shadow: none; opacity: 0; will-change: transform; mix-blend-mode: difference;
    transition: width .25s var(--ease), height .25s var(--ease), background .25s, opacity .3s;
}
#mouse-circle::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%;
    background: #fff; transition: opacity .25s;
}
#mouse-circle.is-visible { opacity: 1; }
#mouse-circle.is-link { width: 62px; height: 62px; background: #fff; }
#mouse-circle.is-link::after { opacity: 0; }
#space-fixed.lite { transition: opacity .8s ease; }


/* ---------- Menu mobile: apertura a cerchio dal pulsante, link a cascata ----------
   L'header non crea più un contenitore per elementi fixed (niente backdrop-filter/will-change su mobile): il pannello è sempre relativo allo schermo,
   così all'apertura non c'è nessun salto e non si vede il sito attraverso il pannello. */
@media (max-width: 768px) {
    header#masthead { --mm-y: 3rem; }
    header#masthead.scrolled { --mm-y: 2.125rem; }
    header#masthead, header#masthead.scrolled, header#masthead.has-toggle.nav-open {
        backdrop-filter: none; -webkit-backdrop-filter: none; will-change: auto; transform: none;
    }
    header#masthead.scrolled { background: rgba(10, 12, 16, 0.94); }
    header#masthead.has-toggle .header-navigation {
        background:
            radial-gradient(34rem 26rem at 88% -6%, rgba(229, 194, 74, 0.14), transparent 62%),
            radial-gradient(30rem 24rem at -10% 105%, rgba(88, 112, 255, 0.12), transparent 62%),
            #07090d;
        opacity: 1; visibility: hidden;
        clip-path: circle(0 at calc(100% - 2.375rem) var(--mm-y, 3rem)); -webkit-clip-path: circle(0 at calc(100% - 2.375rem) var(--mm-y, 3rem));
        transition: clip-path .65s cubic-bezier(0.76, 0, 0.24, 1), -webkit-clip-path .65s cubic-bezier(0.76, 0, 0.24, 1), visibility 0s linear .65s;
    }
    header#masthead.has-toggle.nav-open .header-navigation {
        visibility: visible; clip-path: circle(130vmax at calc(100% - 2.375rem) var(--mm-y, 3rem)); -webkit-clip-path: circle(130vmax at calc(100% - 2.375rem) var(--mm-y, 3rem));
        transition: clip-path .9s cubic-bezier(0.76, 0, 0.24, 1), -webkit-clip-path .9s cubic-bezier(0.76, 0, 0.24, 1), visibility 0s;
    }
    header#masthead.has-toggle .header-navigation ul li {
        opacity: 0; transform: translateY(26px); transition: opacity .25s ease, transform .25s ease, background .3s, border-color .3s;
    }
    header#masthead.has-toggle.nav-open .header-navigation ul li {
        opacity: 1; transform: none;
        transition: opacity .6s var(--ease) calc(.38s + var(--i, 0) * .07s), transform .8s var(--ease) calc(.38s + var(--i, 0) * .07s), background .3s, border-color .3s;
    }
    header#masthead.has-toggle .header-navigation ul li:nth-child(1) { --i: 0; }
    header#masthead.has-toggle .header-navigation ul li:nth-child(2) { --i: 1; }
    header#masthead.has-toggle .header-navigation ul li:nth-child(3) { --i: 2; }
    header#masthead.has-toggle .header-navigation ul li:nth-child(4) { --i: 3; }
    header#masthead.has-toggle .header-navigation ul li:nth-child(5) { --i: 4; }
    header#masthead.has-toggle .header-navigation ul li:nth-child(6) { --i: 5; }
    header#masthead.has-toggle .header-navigation ul li:nth-child(7) { --i: 6; }
    header#masthead.has-toggle .header-navigation ul li:nth-child(8) { --i: 7; }
    header#masthead.has-toggle .header-navigation ul { font-size: 1.6rem; gap: 0.5rem; }
    header#masthead.has-toggle .header-navigation ul li { padding: 0.65rem 2rem; }
}

/* ---------- Menu mobile premium: logo in testa, elenco numerato, LinkedIn in fondo ---------- */
.header-navigation .mm-head, .header-navigation .mm-foot { display: none; }
@media (max-width: 768px) {
    header#masthead.has-toggle .header-navigation {
        flex-direction: column; align-items: stretch; justify-content: flex-start; overflow-y: auto; overscroll-behavior: contain;
        padding: 0 1.5rem 1.5rem 1.5rem;
    }
    header#masthead.has-toggle .header-navigation::before {
        content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
        background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.4px), radial-gradient(rgba(229,194,74,.6) 1px, transparent 1.4px);
        background-size: 90px 90px, 140px 140px; background-position: 0 0, 40px 60px;
        -webkit-mask-image: linear-gradient(#000, transparent 70%); mask-image: linear-gradient(#000, transparent 70%);
    }
    .header-navigation .mm-head, .header-navigation .mm-foot { display: block; position: relative; flex: none; }

    /* testata */
    .header-navigation .mm-head { height: 4rem; margin-top: calc(var(--mm-y, 3rem) - 2rem); padding-right: 4rem; }
    .header-navigation .mm-brand { display: flex; align-items: center; gap: .85rem; height: 100%; text-decoration: none; color: #fff; }
    .header-navigation .mm-brand img { width: auto; height: 3.5rem; object-fit: contain; filter: drop-shadow(0 6px 16px rgba(229,194,74,.28)); }
    .header-navigation .mm-brand-txt { display: flex; flex-direction: column; gap: .15rem; line-height: 1.15; text-align: left; }
    .header-navigation .mm-brand-txt strong { font-size: 1.05rem; font-weight: 700; letter-spacing: .01em; text-transform: none; }
    .header-navigation .mm-brand-txt em { font-style: normal; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }

    /* elenco */
    header#masthead.has-toggle .header-navigation ul {
        position: relative; flex: 1 0 auto; justify-content: center; align-items: stretch; gap: 0; margin: 1.5rem 0; padding: 0; counter-reset: mm;
        font-size: 1.55rem; letter-spacing: .02em; text-transform: none;
    }
    header#masthead.has-toggle .header-navigation ul li {
        counter-increment: mm; padding: 0; border: 0; border-radius: 0; border-bottom: 1px solid rgba(255,255,255,.08); text-align: left; background: none;
    }
    header#masthead.has-toggle .header-navigation ul li:first-child { border-top: 1px solid rgba(255,255,255,.08); }
    header#masthead.has-toggle .header-navigation ul li:hover { background: none; border-color: rgba(255,255,255,.08); }
    header#masthead.has-toggle .header-navigation ul li a {
        display: flex; align-items: center; gap: 1rem; padding: 1.05rem .25rem; background: none; -webkit-text-fill-color: #fff; color: #fff; font-weight: 600; text-decoration: none;
        transition: color .3s, padding-left .35s var(--ease);
    }
    header#masthead.has-toggle .header-navigation ul li a::before {
        content: "0" counter(mm); font-size: .72rem; font-weight: 600; letter-spacing: .14em; color: var(--gold); -webkit-text-fill-color: var(--gold) !important; min-width: 1.6rem; opacity: .9;
    }
    header#masthead.has-toggle .header-navigation ul li a::after {
        content: ""; margin-left: auto; width: 1.1rem; height: 1.1rem; opacity: .35; transition: opacity .3s, transform .35s var(--ease);
        background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5c24a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
    }
    header#masthead.has-toggle .header-navigation ul li a:active, header#masthead.has-toggle .header-navigation ul li a:focus-visible { padding-left: .75rem; -webkit-text-fill-color: var(--gold); color: var(--gold); }
    header#masthead.has-toggle .header-navigation ul li a:active::after { opacity: 1; transform: translateX(4px); }
    header#masthead.has-toggle .header-navigation ul li.current-menu-item a, header#masthead.has-toggle .header-navigation ul li.current_page_item a { -webkit-text-fill-color: var(--gold); color: var(--gold); }

    /* piede */
    .header-navigation .mm-foot { margin-bottom: 4.5rem; text-align: center; opacity: 0; transform: translateY(18px); transition: opacity .25s ease, transform .25s ease; }
    header#masthead.has-toggle.nav-open .header-navigation .mm-foot { opacity: 1; transform: none; transition: opacity .7s var(--ease) .75s, transform .8s var(--ease) .75s; }
    .header-navigation .mm-head { opacity: 0; transform: translateY(-12px); transition: opacity .25s ease, transform .25s ease; }
    header#masthead.has-toggle.nav-open .header-navigation .mm-head { opacity: 1; transform: none; transition: opacity .7s var(--ease) .3s, transform .8s var(--ease) .3s; }
    .header-navigation .mm-linkedin {
        display: flex; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem; margin: 0 auto; border-radius: 50%; text-decoration: none;
        color: var(--gold) !important; -webkit-text-fill-color: var(--gold) !important; background: rgba(229,194,74,.08); border: 1px solid rgba(229,194,74,.45);
        box-shadow: 0 10px 30px -12px rgba(229,194,74,.5); transition: background .3s, transform .3s var(--ease);
    }
    .header-navigation .mm-linkedin:active { transform: scale(.94); background: rgba(229,194,74,.2); }
    .header-navigation .mm-sign { margin: 1.1rem 0 0; font-size: .7rem; letter-spacing: .28em; text-transform: uppercase; color: rgba(255,255,255,.38); }
}
@media (max-width: 768px) and (max-height: 620px) {
    header#masthead.has-toggle .header-navigation ul { font-size: 1.25rem; margin: .75rem 0; }
    header#masthead.has-toggle .header-navigation ul li a { padding: .7rem .25rem; }
}

/* Contact Form 7 (il suo foglio di stile non viene caricato): testo per lettori di schermo e indicatore di invio */
.wpcf7 .screen-reader-response { position: absolute; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; word-wrap: normal; }
.wpcf7 .wpcf7-spinner { display: none; width: 1.2rem; height: 1.2rem; margin: 0 0 0 .9rem; vertical-align: middle; border: 2px solid rgba(229, 194, 74, .25); border-top-color: var(--gold); border-radius: 50%; background: none; visibility: visible; animation: rf-spin .8s linear infinite; }
.wpcf7 form.submitting .wpcf7-spinner { display: inline-block; }
.wpcf7 form.submitting input[type=submit] { opacity: .7; cursor: progress; }
.wpcf7 form.sent .wpcf7-form-control-wrap, .wpcf7 form.sent p:has(.wpcf7-acceptance) { opacity: .55; }
@keyframes rf-spin { to { transform: rotate(360deg); } }

/* Bersaglio del link "Vai al contenuto": nessun contorno attorno a tutta la pagina */
#main-content:focus { outline: none; }

/* H1 dell'hero: stesso aspetto del vecchio blocco (il titolo ora è un vero <h1>, con righe a blocco) */
.hero-banner h1.hero-title { margin: 0; }
.hero-banner .hero-title .overflow-hidden, .hero-banner .hero-title .split__line { display: block; }
.hero-banner .hero-eyebrow { margin: 0 0 1.6rem; }

/* Pagine normali: l'article non deve ereditare la larghezza delle schede del blog; le pagine di servizio hanno una colonna di lettura centrata */
body main.generic article.type-page { width: 100%; }
main.generic .container:has(.rf-landing) { max-width: 54rem; }
main.generic .entry-header { margin: 0 0 1.4rem; }
main.generic .entry-title { margin: 0; font-size: clamp(2rem, 4.8vw, 3.3rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; }

/* Footer con la colonna «Servizi e zone»: 5 colonne, elenco su due colonne, allineato alle altre */
footer .footer__top .row:has(.services-nav) { grid-template-columns: 1.1fr 1fr .9fr 2.2fr .8fr; }
footer .services-nav .footer-navigation ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 2rem; }
footer .services-nav .footer-navigation li { margin: .6rem 0 0; padding: 0; break-inside: avoid; }
@media (max-width: 1024px) { footer .footer__top .row:has(.services-nav) { grid-template-columns: 1fr 1fr; } footer .services-nav { grid-column: 1 / -1; } footer .services-nav .footer-navigation ul { max-width: 28rem; } }
@media (max-width: 640px) { footer .services-nav .footer-navigation ul { columns: 1; } }
