/* =========================================================
   TeamElektro Lern-App
   Netzwerkgrundlagen
   navigation.css
   ========================================================= */


/* =========================================================
   1. HEADER
   ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    width: 100%;

    background: rgba(255, 255, 255, 0.97);

    border-bottom: 1px solid var(--border);

    box-shadow:
        0 4px 18px rgba(0, 63, 135, 0.06);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}


/* =========================================================
   2. NAVIGATION CONTAINER
   ========================================================= */

.navigation-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;

    min-height: 76px;
}


/* =========================================================
   3. BRAND / LOGO
   ========================================================= */

.brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;

    color: var(--team-blue);

    transition:
        opacity var(--transition),
        transform var(--transition);
}

.brand:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.brand-logo {
    display: block;

    width: auto;
    max-width: 165px;
    max-height: 52px;

    object-fit: contain;
}


/* =========================================================
   4. MAIN NAVIGATION
   ========================================================= */

.main-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}


/* =========================================================
   5. NAVIGATION LINKS
   ========================================================= */

.nav-link {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 9px 14px;

    color: #425161;

    border-radius: 8px;

    font-size: 0.92rem;
    font-weight: 700;

    transition:
        color var(--transition),
        background-color var(--transition);
}

.nav-link:hover {
    color: var(--team-blue);

    background: var(--team-blue-light);
}


/* =========================================================
   6. ACTIVE NAVIGATION
   ========================================================= */

.nav-link.active {
    color: var(--team-blue);

    background: var(--team-blue-light);
}

.nav-link.active::after {
    content: "";

    position: absolute;
    right: 14px;
    bottom: 4px;
    left: 14px;

    height: 2px;

    background: var(--team-blue-medium);

    border-radius: 999px;
}


/* =========================================================
   7. FOCUS
   ========================================================= */

.nav-link:focus-visible,
.brand:focus-visible,
.navigation-toggle:focus-visible {
    outline: 3px solid rgba(0, 107, 182, 0.28);
    outline-offset: 3px;
}


/* =========================================================
   8. MOBILE NAVIGATION BUTTON
   ========================================================= */

.navigation-toggle {
    display: none;

    width: 46px;
    height: 46px;
    padding: 10px;

    background: transparent;

    border: 1px solid var(--border);
    border-radius: 9px;

    cursor: pointer;

    transition:
        background-color var(--transition),
        border-color var(--transition);
}

.navigation-toggle:hover {
    background: var(--team-blue-light);
    border-color: var(--border-blue);
}

.navigation-toggle span {
    display: block;

    width: 100%;
    height: 2px;

    margin: 5px 0;

    background: var(--team-blue);

    border-radius: 999px;

    transform-origin: center;

    transition:
        transform 0.25s ease,
        opacity 0.2s ease;
}


/* =========================================================
   9. HAMBURGER → CLOSE
   Unterstützt mehrere mögliche JS-Klassen
   ========================================================= */

.navigation-toggle.active span:nth-child(1),
.navigation-toggle.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.navigation-toggle.active span:nth-child(2),
.navigation-toggle.is-active span:nth-child(2) {
    opacity: 0;
}

.navigation-toggle.active span:nth-child(3),
.navigation-toggle.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* =========================================================
   10. SCROLLED HEADER
   Kann später von navigation.js gesetzt werden
   ========================================================= */

.site-header.scrolled {
    box-shadow:
        0 7px 24px rgba(0, 47, 102, 0.11);
}


/* =========================================================
   11. MOBILE NAVIGATION
   Der eigentliche Breakpoint liegt bewusst hier,
   Feinanpassungen folgen zusätzlich in responsive.css.
   ========================================================= */

@media (max-width: 820px) {

    .navigation-container {
        position: relative;

        min-height: 70px;
    }


    .brand-logo {
        max-width: 145px;
        max-height: 46px;
    }


    .navigation-toggle {
        display: block;
        flex-shrink: 0;
    }


    .main-navigation {
        position: absolute;
        top: calc(100% + 1px);
        right: 0;
        left: 0;

        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;

        padding: 12px;

        background: #ffffff;

        border: 1px solid var(--border);
        border-top: 0;

        border-radius:
            0
            0
            var(--radius)
            var(--radius);

        box-shadow:
            0 18px 30px rgba(0, 47, 102, 0.13);
    }


    .main-navigation.active,
    .main-navigation.is-open,
    .main-navigation.open {
        display: flex;
    }


    .nav-link {
        justify-content: flex-start;

        width: 100%;
        min-height: 46px;
        padding: 11px 14px;
    }


    .nav-link.active::after {
        top: 10px;
        right: auto;
        bottom: 10px;
        left: 4px;

        width: 3px;
        height: auto;
    }
}


/* =========================================================
   12. VERY SMALL DISPLAYS
   ========================================================= */

@media (max-width: 420px) {

    .navigation-container {
        width: min(calc(100% - 24px), var(--max-width));
    }

    .brand-logo {
        max-width: 125px;
    }

    .navigation-toggle {
        width: 43px;
        height: 43px;
    }
}


/* =========================================================
   13. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .brand,
    .nav-link,
    .navigation-toggle,
    .navigation-toggle span {
        transition: none;
    }
}


/* =========================================================
   14. PRINT
   ========================================================= */

@media print {

    .site-header {
        display: none !important;
    }
}