/* ── Over-nav top bar ─────────────────────────────────────────────────────── */

.top-bar {
    background: var(--main-color);
    width: 100%;
    position: relative;
    z-index: 999;
}

.top-bar__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0.45rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.top-bar__text {
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
}

.top-bar__sep {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
}

.top-bar__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.top-bar__link:hover {
    opacity: 0.75;
}

.top-bar__link .bi {
    font-size: 0.7rem;
}

@media (max-width: 600px) {
    .top-bar__sep,
    .top-bar__text:first-child {
        display: none;
    }
}

/* ── Site header (top bar) ────────────────────────────────────────────────── */

.site-header {
    position: fixed;
    top: 0; /* sovrascritto da JS al primo paint */
    left: 0;
    width: 100%;
    z-index: 1001;
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease,
                backdrop-filter 0.4s ease;
    /* top non è in transition: il movimento segue lo scroll 1:1, senza lag */
}

/* Scrolled state — added via JS */
.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 3rem;
}

/* ── Navbar logo ───────────────────────────────────────────────────────────── */

.navbar__logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    position: relative;
}

.navbar__logo-img {
    display: block;
    height: 36px;
    width: auto;
    transition: opacity 0.4s ease;
}

/* Default (hero, sfondo scuro): mostra bianco, nasconde scuro */
.navbar__logo-img--white { opacity: 1; }
.navbar__logo-img--dark  { opacity: 0; position: absolute; left: 0; top: 50%; transform: translateY(-50%); }

/* Scrolled (sfondo chiaro): nascondi bianco, mostra scuro */
.site-header.is-scrolled .navbar__logo-img--white { opacity: 0; }
.site-header.is-scrolled .navbar__logo-img--dark  { opacity: 1; }

/* ── Language switcher ─────────────────────────────────────────────────────── */

.lang-switcher {
    position: relative;
    width: 5rem;
    height: 5rem;
    flex-shrink: 0;
}

.lang-switcher__globe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4.2rem;
    color: rgba(255, 255, 255, 0.08);
    pointer-events: none;
    line-height: 1;
    transition: color 0.4s ease;
}

.site-header.is-scrolled .lang-switcher__globe {
    color: rgba(0, 0, 0, 0.06);
}

.lang-switcher__item {
    position: absolute;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1;
    z-index: 1;
    transition: color 0.2s ease;
}

.site-header.is-scrolled .lang-switcher__item {
    color: #888;
}

/* IT — top center */
.lang-switcher__item:nth-child(2) {
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
}
/* DE — left center */
.lang-switcher__item:nth-child(3) {
    top: 50%;
    left: 4%;
    transform: translateY(-50%);
}
/* EN — bottom right */
.lang-switcher__item:nth-child(4) {
    bottom: 7%;
    right: 5%;
}

.lang-switcher__item--active {
    color: #fff;
    font-weight: 700;
}

.site-header.is-scrolled .lang-switcher__item--active {
    color: var(--ink, #0a0a0a);
    font-weight: 700;
}

.lang-switcher__item:hover {
    color: var(--main-color);
}

/* ── Hamburger button ──────────────────────────────────────────────────────── */

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 24px;
    height: 24px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 0;
    transform-origin: center;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity   0.25s ease,
                width     0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Open state → X */
.hamburger.is-open span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}
.hamburger.is-open span:nth-child(2) {
    opacity: 0;
    width: 0;
}
.hamburger.is-open span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ── Bottom control bar ────────────────────────────────────────────────────── */

.control-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(16, 16, 16, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.06);
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: calc(5rem + 50%);
    width: 100%;
}

.control-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    width: 100%;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.45);
    font-size: 1.25rem;
    line-height: 1;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    transition: color 0.2s ease, background 0.2s ease;
}

.control-item:first-child {
    border-left: none;
}

.control-item:hover {
    color: var(--main-color);
    background: rgba(57, 165, 201, 0.08);
}

.control-item a,
.control-item button {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.control-item i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── Navigation overlay (fullscreen) ──────────────────────────────────────── */

.navigation-toggle {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navigation-toggle.is-open {
    opacity: 1;
    pointer-events: auto;
}

.navigation-toggle .navbar__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
}

.navigation-toggle .navbar__item {
    overflow: hidden;
}

.navigation-toggle .navbar__link {
    font-size: clamp(1.6rem, 5vw, 3rem);
    font-weight: 300;
    letter-spacing: 0.08em;
    color: #111;
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    display: block;
    padding: 0.3rem 1rem;
    transition: opacity 0.35s ease,
                transform 0.35s ease,
                color 0.2s ease;
}

.navigation-toggle.is-open .navbar__link {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger per ogni voce */
.navigation-toggle.is-open .navbar__item:nth-child(1) .navbar__link { transition-delay: 0.04s; }
.navigation-toggle.is-open .navbar__item:nth-child(2) .navbar__link { transition-delay: 0.08s; }
.navigation-toggle.is-open .navbar__item:nth-child(3) .navbar__link { transition-delay: 0.12s; }
.navigation-toggle.is-open .navbar__item:nth-child(4) .navbar__link { transition-delay: 0.16s; }
.navigation-toggle.is-open .navbar__item:nth-child(5) .navbar__link { transition-delay: 0.20s; }
.navigation-toggle.is-open .navbar__item:nth-child(6) .navbar__link { transition-delay: 0.24s; }

.navigation-toggle .navbar__link--active {
    color: var(--main-color);
}

.navigation-toggle .navbar__link:hover {
    color: var(--main-color);
}

/* Accento laterale sul link attivo */
.navigation-toggle .navbar__link--active::before {
    content: '—';
    margin-right: 0.6rem;
    font-size: 0.6em;
    letter-spacing: 0.1em;
    color: var(--main-color);
    vertical-align: middle;
}
