/**************************************************************/
/* NAVIGATION */
/**************************************************************/
header nav,
footer nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--nav-gap);
    font-family: var(--font-family);
}

header nav a {
    text-decoration: none;
    letter-spacing: var(--nav-link-spacing);
    font-family: inherit;
    font-weight: 400;
    line-height: 1;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

footer nav a {
    text-decoration: none;
    letter-spacing: var(--nav-link-spacing);
    font-family: inherit;
    font-weight: 400;
    line-height: 1;
    padding-bottom: 4px;
    transition: color 0.2s ease, border-color 0.2s ease;

}

header nav a {
    color: var(--text-color);
    font-size: var(--nav-header-link-size);
}

footer nav a {
    color: var(--text-color-dim);
    font-size: var(--nav-footer-link-size);
}

header nav a.active {
    color: var(--text-color-active);
    border-bottom-color: var(--text-color-active);
}

footer nav a.active {
    color: var(--text-color-active);
    border-bottom-color: var(--text-color-active);
}

header nav a.dim {
    color: var(--text-color-dim);
}

header nav .sep {
    color: var(--text-color);
    font-family: var(--font-family);
    font-weight: 400;
    font-size: 34px;
    /* Strich so hoch wie das Zeichen, line-height macht ihn nicht länger */
    line-height: 1;
}

footer nav .sep {
    color: var(--text-color-dim);
    font-family: var(--font-family);
    font-weight: 400;
    font-size: 26px;
    line-height: 1;
}

/* Hauptmenü mit Untermenüs (ul/li): Desktop = Zeile mit Strich-Trennern, Dropdown bei Hover/Fokus */
header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

header nav>ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--nav-gap);
}

header nav>ul>li {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--nav-gap);
    padding: 10px 0;
    /* Hover-Fläche reicht bis zum Dropdown, kein Spalt */
}

header nav>ul>li+li::before {
    content: "|";
    color: var(--text-color);
    font-size: 34px;
    line-height: 1;
}

header nav a:not([href]) {
    cursor: pointer;
}

header nav .sub-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    padding: 10px 0;
    background: rgba(0, 0, 0, 0.96);
    border: 1px solid rgba(var(--button-text-active-rgb), 0.4);
    z-index: 1;
}

header nav li:hover>.sub-nav,
header nav li:focus-within>.sub-nav {
    display: block;
}

header nav .sub-nav a {
    display: block;
    padding: 8px 20px;
    font-size: 20px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 0;
}

header nav .sub-nav a:hover,
header nav .sub-nav a:focus-visible {
    color: var(--text-color-active);
}

/* Inaktive Navigation – überschreibt die normalen a-Styles */
header nav a.nav-ghost,
header nav .nav-ghost,
footer nav a.nav-ghost,
footer nav .nav-ghost {
    color: var(--text-color-ghost);
    border-bottom-color: transparent;
    cursor: default;
    pointer-events: none;
    /* optional, falls es doch ein <a> ist */
    text-decoration: none;
}

/* Falls du weiterhin <a> ohne href nutzt */
header nav a:not([href]) {
    cursor: pointer;
}

footer nav a:not([href]) {
    cursor: default;
    pointer-events: none;
}

/* Optional: Ghost auch im Submenü */
header nav .sub-nav a.nav-ghost,
header nav .sub-nav .nav-ghost {
    color: var(--text-color-ghost);
}

/*****************************************************************************/
/* BURGER MENU (bis 1000px; JS: js/burger-menu.js, Nav braucht id="mainNav") */
/*****************************************************************************/
.burger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 3000;
    background: transparent;
    border: none;
    padding: 0;
}

.burger span {
    width: 28px;
    height: 3px;
    background: var(--text-color-active);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.burger.active span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);

}

/* =============================================================================
   CHROME: Header, Burger, Footer
   ============================================================================= */

@media (min-width: 1024px) and (max-width: 1400px) and (min-height: 680px) and (max-height: 980px) and (orientation: landscape) {
    :root {
        --bar-height: 60px;
    }

    header,
    footer {
        padding-inline: 22px;
    }

    header {
        gap: 10px 18px;
    }

    .logo {
        margin-right: 12px;
    }

    header nav,
    footer nav,
    header nav>ul,
    header nav>ul>li {
        gap: 8px 12px;
    }

    header nav a {
        font-size: 22px;
    }

    footer nav a {
        font-size: 16px;
    }

    header nav .sep,
    header nav>ul>li+li::before {
        font-size: 28px;
    }

    footer nav .sep {
        font-size: 20px;
    }

    footer {
        gap: 2px;
        padding-bottom: 1px;
    }

    footer .copyright {
        font-size: 10px;
        letter-spacing: 0.06em;
    }

    .actionButton {
        min-width: 9rem;
        font-size: 2.05rem;
    }
}

@media (max-width: 1000px) {
    header {
        justify-content: flex-start;
        padding-left: 54px;
    }

    .burger {
        display: flex;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    header nav {
        display: none;
    }

    header nav.open {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: center;
        gap: 18px;
        padding: 24px 20px 28px;
        background: rgba(0, 0, 0, 0.96);
        border-bottom: 1px solid rgba(var(--color-button-text-active-rgb), 0.4);
        max-height: calc(100dvh - var(--bar-height));
        overflow-y: auto;
    }

    header nav>ul {
        flex-direction: column;
        gap: 4px;
    }

    header nav>ul>li {
        flex-direction: column;
        gap: 0;
        padding: 6px 0;
    }

    header nav>ul>li+li::before {
        display: none;
    }

    header nav .sub-nav,
    header nav li:hover>.sub-nav,
    header nav li:focus-within>.sub-nav {
        display: none;
        position: static;
        transform: none;
        min-width: 0;
        padding: 4px 0 0;
        background: none;
        border: 0;
    }

    header nav li.show-submenu>.sub-nav {
        display: block;
    }

    header nav .sub-nav a {
        text-align: center;
        padding: 6px 12px;
    }
}

@media (max-width: 900px) {

    header,
    footer {
        padding-inline: 20px;
    }

    .logo {
        margin-right: 0;
    }

    header nav,
    footer nav {
        gap: 10px 14px;
    }

    header nav .sep,
    footer nav .sep {
        display: none;
    }

    main:has(.carousel) .quote {
        margin: 0 0 calc(var(--footer-reserved-height) + 1.5rem);
        font-size: clamp(0.85rem, 3.4vw, 1.1rem);
    }

    footer {
        justify-content: center;
        height: var(--footer-reserved-height);
        min-height: var(--footer-reserved-height);
        padding-bottom: calc(2px + var(--footer-safe-area));
    }

    .footer-mudd-layer,
    .footer-shroud-layer {
        bottom: var(--footer-reserved-height);
    }
}

@media (max-width: 480px) {
    footer nav {
        gap: 8px 12px;
    }

    footer nav a {
        font-size: 16px;
    }
}

@media (max-width: 340px) {
    footer nav a {
        font-size: 14px;
        letter-spacing: 0.06em;
    }
}

@media (max-width: 1024px) and (orientation: portrait) {
    main:has(.carousel) .quote {
        display: block;
        width: min(30rem, calc(100vw - 48px));
        margin: 0 0 calc(var(--footer-reserved-height) + 1.25rem);
        font-size: clamp(1.15rem, 3.8vw, 1.65rem);
        line-height: 1.14;
        letter-spacing: 0.03em;
    }
}

@media (max-width: 649px) and (orientation: portrait) {
    main:has(.carousel) .quote {
        width: min(22rem, calc(100vw - 36px));
        font-size: clamp(1.25rem, 5.1vw, 1.55rem);
        line-height: 1.12;
    }
}

@media (max-width: 540px) and (orientation: portrait) {
    main:has(.carousel) .quote {
        width: min(20rem, calc(100vw - 28px));
        font-size: clamp(1.2rem, 5.3vw, 1.45rem);
    }
}

@media (max-width: 400px) and (orientation: portrait) {
    main:has(.carousel) .quote {
        width: min(18.5rem, calc(100vw - 24px));
        font-size: clamp(1.1rem, 5.6vw, 1.35rem);
    }
}

@media (min-width: 820px) and (max-width: 1024px) and (min-height: 1050px) and (orientation: portrait) {
    :root {
        --bar-height: 64px;
    }

    header,
    footer {
        padding-inline: 20px;
    }

    header {
        padding-left: 40px;
    }

    header nav.open {
        gap: 22px;
        padding: 28px 28px 36px;
    }

    .logo {
        width: 48px;
        height: 50px;
    }

    footer nav {
        gap: 6px 12px;
    }

    footer nav a {
        font-size: 16px;
    }

    footer {
        gap: 2px;
        padding-bottom: 1px;
    }

    footer .copyright {
        font-size: 10px;
        letter-spacing: 0.06em;
    }

    .actionButton {
        min-width: 9.4rem;
        font-size: 2.15rem;
    }

    .actionButton--badge {
        width: 7.6rem;
        min-width: 7.6rem;
        padding-bottom: 1.2rem;
    }
}