/* ============================================
   BIOKOHLE LADBERGEN — NAVIGATION CSS
   minMenues/05-topbar-minimal adapted
   Sticky, backdrop-blur, hamburger mobile
   ============================================ */

@layer nav {

    /* ------------------------------------------
       SITE HEADER
       ------------------------------------------ */
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        height: var(--nav-height);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-bottom: 1px solid transparent;
        transition:
            height 0.3s ease,
            border-color 0.3s ease,
            background-color 0.3s ease;
        will-change: height;
    }

    .site-header.is-scrolled {
        height: var(--nav-height-scrolled);
        border-bottom-color: rgba(88, 79, 72, 0.1);
    }

    .site-header__inner {
        max-width: var(--container-max);
        margin-inline: auto;
        padding-inline: var(--container-pad);
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 2rem;
    }

    /* ------------------------------------------
       LOGO
       ------------------------------------------ */
    .site-header__logo {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        min-width: 160px;
    }

    .site-header__logo img {
        height: 150px;
        width: auto;
        object-fit: contain;
        transition: height 0.3s ease;
    }

    .site-header.is-scrolled .site-header__logo img {
        height: 40px;
    }

    /* ------------------------------------------
       DESKTOP NAVIGATION
       ------------------------------------------ */
    .site-nav {
        display: none;
    }

    @media (min-width: 768px) {
        .site-nav {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
    }

    .site-nav__list {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        list-style: none;
    }

    .site-nav__item {}

    .site-nav__link {
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 0.875rem;
        font-family: var(--font-primary);
        font-size: var(--type-small);
        font-weight: 400;
        color: var(--bk-text);
        text-decoration: none;
        border-radius: var(--radius-full);
        transition: color 0.2s ease, background-color 0.2s ease;
        white-space: nowrap;
    }

    .site-nav__link:hover {
        color: var(--bk-green-dark);
        background-color: rgba(58, 128, 55, 0.07);
    }

    .site-nav__link:focus-visible {
        outline: 3px solid var(--bk-green-dark);
        outline-offset: 2px;
    }

    /* Active state */
    .site-nav__link.is-active {
        color: var(--bk-brown);
        font-weight: 500;
    }

    /* ------------------------------------------
       CTA BUTTON in header
       ------------------------------------------ */
    .site-header__cta {
        display: none;
        margin-left: 1rem;
    }

    @media (min-width: 768px) {
        .site-header__cta {
            display: inline-flex;
        }
    }

    /* ------------------------------------------
       HAMBURGER BUTTON (mobile)
       ------------------------------------------ */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: var(--radius-sm);
        transition: background-color 0.2s ease;
    }

    .nav-toggle:hover {
        background-color: rgba(26, 23, 20, 0.06);
    }

    .nav-toggle:focus-visible {
        outline: 3px solid var(--bk-green-dark);
        outline-offset: 2px;
    }

    @media (min-width: 768px) {
        .nav-toggle {
            display: none;
        }
    }

    .nav-toggle__bar {
        display: block;
        width: 22px;
        height: 2px;
        background-color: var(--bk-text);
        border-radius: 2px;
        transform-origin: center;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    /* Hamburger → X animation */
    .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* ------------------------------------------
       MOBILE OVERLAY MENU
       ------------------------------------------ */
    .nav-overlay {
        position: fixed;
        inset: 0;
        z-index: 999;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        display: flex;
        flex-direction: column;
        padding-top: var(--nav-height);
        padding-inline: var(--container-pad);
        padding-bottom: 2rem;

        /* Hidden by default */
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .nav-overlay.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    @media (min-width: 768px) {
        .nav-overlay {
            display: none;
        }
    }

    .nav-overlay__list {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        list-style: none;
        padding-top: 2rem;
        flex: 1;
    }

    .nav-overlay__item {}

    .nav-overlay__link {
        display: block;
        font-family: var(--font-primary);
        font-size: var(--type-h3);
        font-weight: 500;
        color: var(--bk-brown);
        text-decoration: none;
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(61, 43, 31, 0.08);
        transition: color 0.2s ease;
    }

    .nav-overlay__link:hover {
        color: var(--bk-green-dark);
    }

    .nav-overlay__link:focus-visible {
        outline: 3px solid var(--bk-green-dark);
        outline-offset: 3px;
    }

    .nav-overlay__link.is-active {
        color: var(--bk-green-dark);
    }

    .nav-overlay__cta {
        margin-top: 2rem;
        width: 100%;
        justify-content: center;
    }

    /* Body lock when overlay open */
    body.nav-is-open {
        overflow: hidden;
    }
}
