/* _navigation.css — topnav, logo, nav links, burger menu, mobile nav */
/* =======================
   TOP NAV + BURGER
   ======================= */
.topnav {
    position: fixed;
    top: 6px;
    left: 0;
    right: 0;
    --edge-a: 20deg;
    --edge-b: 156deg;
    --edge-c: 286deg;
    --glow-x: 50%;
    --glow-y: 18%;
    --sheen-x: 34%;
    --sheen-y: 6%;
    --sparkle-x: 68%;
    --sparkle-y: 14%;
    width: min(1120px, calc(100% - 38px));
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
    min-height: 50px;
    z-index: 260;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(191, 240, 231, .34);
    background: linear-gradient(134deg, rgba(42, 160, 144, .72), rgba(28, 125, 113, .7));
    -webkit-backdrop-filter: blur(9px) saturate(124%);
    backdrop-filter: blur(9px) saturate(124%);
    box-shadow: 0 14px 26px rgba(10, 40, 36, .24), inset 0 1px 0 rgba(232, 255, 250, .22), inset 0 -1px 0 rgba(232, 255, 250, .06);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    transition: border-color .28s ease, box-shadow .28s ease;
}

.topnav::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(180deg, rgba(232, 255, 250, .2), rgba(232, 255, 250, .08) 38%, rgba(232, 255, 250, 0) 74%),
        radial-gradient(240px 90px at var(--sheen-x) var(--sheen-y), rgba(232, 255, 250, .18), rgba(232, 255, 250, 0) 72%),
        linear-gradient(118deg, rgba(232, 255, 250, .12), rgba(232, 255, 250, 0) 62%);
    opacity: .68;
    pointer-events: none;
    transition: opacity .3s ease;
}

.topnav::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: .85px;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    background:
        conic-gradient(from var(--edge-a), rgba(255, 255, 255, 0) 0deg, rgba(245, 255, 252, .92) 18deg, rgba(245, 255, 252, .46) 36deg, rgba(245, 255, 252, 0) 58deg, rgba(245, 255, 252, 0) 360deg),
        conic-gradient(from var(--edge-b), rgba(255, 255, 255, 0) 0deg, rgba(228, 255, 248, .84) 16deg, rgba(228, 255, 248, .38) 30deg, rgba(228, 255, 248, 0) 52deg, rgba(228, 255, 248, 0) 360deg),
        conic-gradient(from var(--edge-c), rgba(255, 255, 255, 0) 0deg, rgba(221, 255, 245, .7) 12deg, rgba(221, 255, 245, .32) 24deg, rgba(221, 255, 245, 0) 44deg, rgba(221, 255, 245, 0) 360deg),
        linear-gradient(122deg, rgba(236, 255, 251, .16), rgba(236, 255, 251, 0) 42%);
    opacity: .82;
    pointer-events: none;
    z-index: 2;
    transition: opacity .3s ease;
}

.topnav:hover,
.topnav:focus-within {
    border-color: rgba(206, 248, 239, .42);
    box-shadow: 0 18px 30px rgba(8, 34, 30, .26), inset 0 1px 0 rgba(232, 255, 250, .24), inset 0 -1px 0 rgba(232, 255, 250, .07);
}

#logo {
    float: left;
    margin-left: 14px;
    padding-top: 10px;
    padding-left: env(safe-area-inset-left) !important;
    position: relative;
    z-index: 1;
}

#logo-pic {
    height: 32px !important;
    width: auto;
    display: block;
    max-height: none;
    margin-top: 0;
    margin-left: 0 !important;
}

.topnav a {
    float: right;
    display: block;
    color: #fff;
    text-align: center;
    padding: 12px 11px;
    font-size: 15px;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 28px;
    position: relative;
    z-index: 1;
}

.topnav a.icon {
    display: none;
    color: #fff;
    align-items: center;
    justify-content: center;
}

.topnav a.icon #menu-button {
    display: block;
    width: 28px;
    height: 28px;
    background: center/28px 15.4px no-repeat url("../immagini/line.3.horizontal.svg");
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    transform: none;
}

.topnav.responsive a.icon #menu-button {
    background-image: url("../immagini/xmark.svg");
    background-size: 19px 19px;
}

.topnav a.icon i#menu-button::before,
.topnav a.icon i#menu-button::after {
    content: none !important;
    display: none !important;
}

/* Local fallback icons used in service detail back links */
.back-link i.fas.fa-arrow-left,
.back-link i.fas.fa-th-large {
    display: inline-block;
    width: 13px;
    height: 13px;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size: contain;
            mask-size: contain;
    font-size: 0 !important;
    line-height: 0 !important;
    vertical-align: -1px;
}

.back-link i.fas.fa-arrow-left {
    -webkit-mask-image: url("/immagini/icon-back.svg");
            mask-image: url("/immagini/icon-back.svg");
}

.back-link i.fas.fa-th-large {
    -webkit-mask-image: url("/immagini/icon-grid.svg");
            mask-image: url("/immagini/icon-grid.svg");
}

.topnav a:hover {
    color: #fff;
    text-shadow: 0 1px 12px rgba(221, 255, 246, .72), 0 0 1px rgba(255, 255, 255, .7)
}

.topnav a:not(#logo):not(.icon) {
    border-radius: 11px;
    overflow: visible;
    isolation: isolate;
}

.topnav a:not(#logo):not(.icon):hover,
.topnav a:not(#logo):not(.icon):focus-visible {
    background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .02));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 0 0 1px rgba(225, 255, 248, .18);
}

.active {
    color: #fff;
    box-shadow: none;
}

.topnav a.active,
.topnav a[aria-current="page"] {
    background: linear-gradient(180deg, rgba(228, 255, 249, .18), rgba(228, 255, 249, .06));
    border: 1px solid rgba(198, 241, 232, .34);
    box-shadow: inset 0 1px 0 rgba(232, 255, 250, .26), inset 0 -1px 0 rgba(232, 255, 250, .06), 0 8px 20px -14px rgba(7, 36, 31, .72);
    text-shadow: 0 0 7px rgba(226, 255, 248, .38), 0 0 1px rgba(255, 255, 255, .6);
}

.topnav a.active::before,
.topnav a[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    top: 6px;
    bottom: 6px;
    border-radius: 10px;
    background:
        radial-gradient(72% 100% at 50% 0%, rgba(232, 255, 250, .22), rgba(232, 255, 250, 0) 68%),
        linear-gradient(170deg, rgba(176, 255, 241, .14), rgba(176, 255, 241, .04));
    opacity: .82;
    z-index: -1;
    pointer-events: none;
}

.topnav a.active::after,
.topnav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 1px;
    height: 14px;
    border-radius: 999px;
    background:
        radial-gradient(58% 106% at 50% 94%, rgba(217, 251, 243, .54), rgba(217, 251, 243, 0) 72%),
        radial-gradient(42% 72% at 50% 100%, rgba(152, 234, 215, .3), rgba(152, 234, 215, 0) 76%);
    filter: blur(1.2px);
    box-shadow: 0 10px 18px -12px rgba(152, 234, 215, .26);
    opacity: .78;
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    .topnav {
        border-color: rgba(174, 230, 220, .3);
        background: linear-gradient(134deg, rgba(24, 120, 108, .66), rgba(16, 92, 84, .62));
        box-shadow: 0 16px 28px rgba(5, 18, 16, .44), inset 0 1px 0 rgba(215, 242, 236, .2), inset 0 -1px 0 rgba(215, 242, 236, .05);
    }

    .topnav:hover,
    .topnav:focus-within {
        border-color: rgba(186, 239, 229, .38);
        box-shadow: 0 18px 30px rgba(5, 18, 16, .5), inset 0 1px 0 rgba(215, 242, 236, .24), inset 0 -1px 0 rgba(215, 242, 236, .08);
    }

    .topnav::before {
        opacity: .46;
    }

    .topnav a:not(#logo):not(.icon):hover,
    .topnav a:not(#logo):not(.icon):focus-visible {
        background: linear-gradient(180deg, rgba(215, 255, 246, .08), rgba(215, 255, 246, .02));
        box-shadow: inset 0 1px 0 rgba(215, 255, 246, .16), 0 0 0 1px rgba(145, 214, 202, .18);
    }

    .topnav a.active::after,
    .topnav a[aria-current="page"]::after {
        background:
            radial-gradient(58% 98% at 50% 96%, rgba(188, 255, 240, .76), rgba(188, 255, 240, 0) 72%),
            radial-gradient(42% 66% at 50% 98%, rgba(122, 233, 210, .38), rgba(122, 233, 210, 0) 76%);
        box-shadow: 0 8px 16px -10px rgba(173, 255, 237, .26);
    }

    .topnav a.active,
    .topnav a[aria-current="page"] {
        border-color: rgba(176, 240, 230, .36);
        background: linear-gradient(180deg, rgba(224, 255, 248, .16), rgba(224, 255, 248, .06));
        box-shadow: inset 0 1px 0 rgba(225, 255, 248, .22), inset 0 -1px 0 rgba(225, 255, 248, .05), 0 9px 20px -14px rgba(4, 14, 12, .82);
    }
}

/* Mobile: burger sempre visibile; voci in colonna quando aperto */
@media (max-width: 800px) {
    .topnav {
        left: 0;
        right: 0;
        width: calc(100% - 20px);
        min-height: 50px;
        border-radius: 16px;
    }

    .topnav a {
        display: none !important;
        float: none;
    }

    .topnav a#logo {
        display: block !important;
        float: none;
        padding-top: 10px;
    }

    .topnav a.icon {
        display: flex !important;
        position: absolute;
        right: 0;
        top: 0;
        width: 56px;
        height: 50px;
        text-align: center;
        font-size: 0;
        line-height: 0;
        padding: 0;
        align-items: center;
        justify-content: center;
    }

    html[dir="rtl"] .topnav a.icon {
        right: auto;
        left: 0;
    }

    .topnav.responsive {
        height: auto;
        padding-bottom: 8px;
    }

    .topnav.responsive a {
        display: block !important;
        width: 100%;
        float: none !important;
        clear: both;
        text-align: center;
        border-top: 1px solid rgba(255, 255, 255, .18);
        padding: 11px 10px;
    }

    .topnav.responsive a#logo {
        border-top: 0;
        text-align: left;
        padding-right: 56px;
    }

    .topnav.responsive a.icon {
        position: absolute;
        right: 0;
        top: 0;
        border: 0;
        width: 56px;
        height: 50px;
        padding: 0;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    html[dir="rtl"] .topnav.responsive a.icon {
        right: auto;
        left: 0;
    }

    html[dir="rtl"] .topnav a#logo,
    html[dir="rtl"] .topnav.responsive a#logo {
        text-align: right;
        padding-left: 56px;
        padding-right: 10px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .topnav {
        box-shadow: 0 10px 18px rgba(7, 28, 24, .2), inset 0 1px 0 rgba(232, 255, 250, .2), inset 0 -1px 0 rgba(232, 255, 250, .06);
    }

    .topnav::after {
        opacity: .68;
    }
}

/* iOS Safari: blur mantenuto con impostazioni conservative per ridurre artefatti di compositing */
@supports (-webkit-touch-callout: none) {
    @media (hover: none) and (pointer: coarse) {
        .topnav {
            position: sticky;
            top: 6px;
            -webkit-backdrop-filter: blur(7px) saturate(116%);
            backdrop-filter: blur(7px) saturate(116%);
            background: linear-gradient(134deg, rgba(42, 160, 144, .78), rgba(28, 125, 113, .76));
            box-shadow: 0 8px 14px rgba(7, 28, 24, .18), inset 0 1px 0 rgba(232, 255, 250, .18), inset 0 -1px 0 rgba(232, 255, 250, .05);
            transform: translateZ(0);
            will-change: transform;
        }

        .topnav::before {
            opacity: .28;
        }

        .topnav::after {
            opacity: .64;
        }

        .hero {
            margin-top: 20px;
        }

        .hero--home {
            margin-top: 24px;
        }
    }
}

@supports (-webkit-touch-callout: none) {
    @media (hover: none) and (pointer: coarse) and (max-width: 640px) {
        .hero--home {
            margin-top: 20px;
        }
    }
}

