/* ==========================================================================
   Natur- & Wanderhotel Mühle – Fullscreen Overlay Navigation v3
   ========================================================================== */

:root {
    --nav-brand:          #be8365;
    --nav-brand-dark:     #a86d51;
    --nav-panel-bg:       rgba(18, 14, 10, 0.55);   /* reduziert, mehr Bild sichtbar */
    --nav-panel-bg-solid: #0e0b09;
    --nav-text:           rgba(255, 255, 255, 0.92);
    --nav-text-muted:     rgba(255, 255, 255, 0.52);
    --nav-divider:        rgba(255, 255, 255, 0.10);
    --nav-height:         80px;
    --nav-panel-width:    70%;
    --nav-transition:     0.38s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-font:           'Outfit', sans-serif;
}

.site-header *, .nav-overlay * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.nav-open { overflow: hidden; }
body { padding-top: var(--nav-height); }

/* --------------------------------------------------------------------------
   Header Topbar
   -------------------------------------------------------------------------- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1001;
    font-family: var(--nav-font);
    pointer-events: none;
}
.site-header > * { pointer-events: auto; }

.site-header__topbar {
    display: flex;
    align-items: center;
    height: var(--nav-height);
    padding: 0 28px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 100%);
    transition: background var(--nav-transition);
    position: relative;
}

/* Wenn Menü offen: linke 70% Topbar bekommt Panel-Farbe (überschreibt Gradient) */
.nav-open .site-header__topbar::before {
    content: '';
    position: absolute;
    inset: 0;
    width: var(--nav-panel-width);
    background: var(--nav-panel-bg-solid);
    z-index: -1;
}


/* Logo – position:fixed damit es über dem Overlay-Stacking-Context liegt */
.site-header__logo-wrap {
    position: fixed;
    left: 50%;
    top: calc(var(--nav-height) / 2 + 20px); /* Topbar-Mitte + 20px Versatz */
    transform: translateX(-50%) translateY(-50%);
    z-index: 1002;
    pointer-events: auto;
    transition: opacity 0.15s ease, top 0s; /* nur opacity animieren */
}
.site-header__logo-wrap a { display: block; line-height: 0; }

/* Nicht gescrollt: Logo groß */
.site-header__logo-img {
    display: block;
    width: auto;
    height: 80px;
    filter: brightness(0) invert(1);
    transition: none; /* kein height-animate – JS übernimmt das fade */
}

/* Kurz ausblenden beim Zustandswechsel (JS setzt/entfernt diese Klasse) */
.site-header__logo-wrap.is-transitioning {
    opacity: 0;
    pointer-events: none;
}

/* Gescrollt: Logo kleiner, ohne Versatz */
.is-scrolled .site-header__logo-wrap {
    top: calc(var(--nav-height) / 2);
}
.is-scrolled .site-header__logo-img { height: 36px; }

/* Logo im Overlay-Panel nicht benötigt (Topbar liegt drüber) */
.nav-panel__logo { display: none; }

/* Hamburger-Toggle */
.nav-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    font-family: var(--nav-font);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 8px 0;
    transition: color 0.2s;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.nav-toggle:hover { color: var(--nav-brand); }

.nav-toggle__icon {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 28px;
    flex-shrink: 0;
}
.nav-toggle__icon span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform var(--nav-transition), opacity var(--nav-transition);
    transform-origin: center;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__icon span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }


/* Rechte Aktionen – Telefon + Anfragen-Button
   position: fixed damit sie IMMER über dem Overlay sichtbar bleiben
   z-index: 1002 = über Overlay (1000) und über Header (1001) */
.site-header__actions {
    position: fixed;
    top: 0;
    right: 28px;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1002;
    pointer-events: auto;
}

.site-header__phone {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    transition: color 0.2s;
}
.site-header__phone:hover { color: var(--nav-brand); }
.site-header__phone svg { flex-shrink: 0; width: 20px; height: 20px; }

.site-header__book-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 22px;
    background: var(--nav-brand);
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 2px;
    transition: background 0.2s;
    white-space: nowrap;
}
.site-header__book-btn:hover { background: var(--nav-brand-dark); color: #fff; }

/* --------------------------------------------------------------------------
   Schließen-Button:
   position:fixed, exakt an der Stelle des Hamburger-Buttons (links, vertikal zentriert)
   Sitzt ÜBER dem Overlay (z-index: 1002), damit er immer klickbar ist
   -------------------------------------------------------------------------- */
.nav-overlay__close {
    position: fixed;
    top: 0;
    left: 28px;
    height: var(--nav-height);
    display: none; /* standardmäßig ausgeblendet */
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.88);
    font-family: var(--nav-font);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0;
    z-index: 1002;
    transition: color 0.2s;
    text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}
.nav-overlay__close:hover { color: var(--nav-brand); }

/* Nur wenn Overlay offen: Schließen-Button einblenden, Hamburger ausblenden */
.nav-open .nav-overlay__close { display: flex; }
.nav-open .nav-toggle { visibility: hidden; pointer-events: none; }

/* --------------------------------------------------------------------------
   Overlay – Fullscreen
   -------------------------------------------------------------------------- */
.nav-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    font-family: var(--nav-font);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--nav-transition), visibility var(--nav-transition);
}
.nav-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Linkes Panel (70%)
   Wichtig: explizit height:100vh damit Flex-Children korrekt skalieren
   -------------------------------------------------------------------------- */
.nav-panel {
    position: relative;
    width: var(--nav-panel-width);
    height: 100vh;          /* explizit – verhindert overflow durch padding-top auf body */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Hintergrundbild */
.nav-panel__bg { position: absolute; inset: 0; z-index: 0; }
.nav-panel__bg img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: center;
    filter: saturate(0.8) brightness(0.72); /* heller als vorher */
}

/* Dunkel-Overlay – reduziert, mehr Bild sichtbar */
.nav-panel__overlay {
    position: absolute; inset: 0; z-index: 1;
    background: var(--nav-panel-bg); /* 0.55 Deckkraft */
}

/* Content-Wrapper */
.nav-panel__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-top: var(--nav-height);
}

/* --------------------------------------------------------------------------
   Logo – zentriert auf GESAMTEN Bildschirm (nicht nur im 70%-Panel)
/* --------------------------------------------------------------------------
   Menübereich: zweispaltig
   min-height: 0 ist KRITISCH – verhindert dass Grid-Content über Flex-Item wächst
   -------------------------------------------------------------------------- */
.nav-panel__menus {
    flex: 1;
    min-height: 0;       /* WICHTIG für Flex+Grid Kombination */
    display: grid;
    grid-template-columns: 1fr 2fr; /* primary 1/3, secondary 2/3 */
}

/* Linke Spalte: Hauptpunkte – großes Padding links, responsive */
.nav-panel__primary {
    padding: 0 24px 24px clamp(48px, 8vw, 150px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

/* Rechte Spalte: Untermenü – nah an primary heran */
.nav-panel__secondary {
    padding: 0 40px 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

/* Footer */
.nav-panel__footer {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 14px 48px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.22);
}
.nav-panel__footer a {
    display: flex; align-items: center; gap: 8px;
    color: var(--nav-text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.2s;
}
.nav-panel__footer a:hover { color: var(--nav-brand); }
.nav-panel__footer svg { flex-shrink: 0; }

/* --------------------------------------------------------------------------
   Rechter Bereich (30%) – statisches Bild
   Das nav-side ist HINTER der Topbar (z-index < 1001)
   → Telefon + Anfragen in der Topbar bleiben IMMER sichtbar
   -------------------------------------------------------------------------- */
.nav-side {
    flex: 1;
    position: relative;
    overflow: hidden;
}
.nav-side__img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; object-position: center;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Haupt-Menüliste – KEINE Trennlinien
   -------------------------------------------------------------------------- */
.nav-primary {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.nav-item { border: none; }

.nav-item__link {
    display: inline-block;
    padding: 11px 0;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 26px;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color 0.2s;
    position: relative;
}

.nav-item:hover .nav-item__link,
.nav-item--active .nav-item__link {
    color: var(--nav-brand);
}

/* Horizontale Linie: startet direkt nach dem Text, geht nach rechts zum Submenü */
.nav-item__link::after {
    content: '';
    position: absolute;
    left: calc(100% + 10px); /* 10px Abstand nach dem Text */
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 1px;
    background: var(--nav-brand);
    transition: width 0.32s ease;
}
.nav-item:hover .nav-item__link::after,
.nav-item--active .nav-item__link::after {
    width: 50px;
}

/* Toggle-Button: auf Desktop ausblenden */
.nav-item__toggle { display: none; }

/* Untermenü: auf Desktop in rechter Spalte via JS */
.nav-sub { display: none; }

/* --------------------------------------------------------------------------
   Submenü-Panel (rechte Spalte, Desktop) – ähnlich Hüttenhof-Screenshot
   Titel oben in Brand-Farbe + Linie, darunter die Links ohne weitere Borders
   -------------------------------------------------------------------------- */
.nav-submenu-panel-title {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--nav-brand);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15); /* nur Titel-Linie */
}

.nav-sub-desktop {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.nav-sub-desktop__item {
    opacity: 0;
    transform: translateX(-8px);
    animation: subItemIn 0.25s forwards;
}
.nav-sub-desktop__item:nth-child(1) { animation-delay: 0.04s; }
.nav-sub-desktop__item:nth-child(2) { animation-delay: 0.08s; }
.nav-sub-desktop__item:nth-child(3) { animation-delay: 0.12s; }
.nav-sub-desktop__item:nth-child(4) { animation-delay: 0.16s; }
.nav-sub-desktop__item:nth-child(5) { animation-delay: 0.20s; }
.nav-sub-desktop__item:nth-child(6) { animation-delay: 0.24s; }
.nav-sub-desktop__item:nth-child(7) { animation-delay: 0.28s; }
.nav-sub-desktop__item:nth-child(8) { animation-delay: 0.32s; }

@keyframes subItemIn {
    to { opacity: 1; transform: translateX(0); }
}

/* Submenü-Links: kein Border, größer, weiß */
.nav-sub-desktop__link {
    display: block;
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 0.01em;
    transition: color 0.2s, padding-left 0.2s;
}
.nav-sub-desktop__link:hover {
    color: #fff;
    padding-left: 8px;
}

/* --------------------------------------------------------------------------
   Overlay-Einblend-Animation
   -------------------------------------------------------------------------- */
.nav-overlay.is-open .nav-item {
    animation: navItemIn 0.4s both;
}
.nav-overlay.is-open .nav-item:nth-child(1) { animation-delay: 0.06s; }
.nav-overlay.is-open .nav-item:nth-child(2) { animation-delay: 0.11s; }
.nav-overlay.is-open .nav-item:nth-child(3) { animation-delay: 0.16s; }
.nav-overlay.is-open .nav-item:nth-child(4) { animation-delay: 0.21s; }
.nav-overlay.is-open .nav-item:nth-child(5) { animation-delay: 0.26s; }
.nav-overlay.is-open .nav-item:nth-child(6) { animation-delay: 0.31s; }

@keyframes navItemIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   MOBILE (< 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {

    .site-header__topbar { padding: 0 16px; }
    .nav-toggle__label { display: none; }
    .site-header__phone { display: none; }
    .site-header__book-btn { padding: 8px 14px; font-size: 0.8rem; }
    /* Logo auf Mobile etwas kleiner */
    .site-header__logo-img { height: 44px; }
    .is-scrolled .site-header__logo-img { height: 30px; }

    .nav-overlay {
        background: var(--nav-panel-bg-solid);
        flex-direction: column;
    }

    /* Panel: volle Breite, kein festes height:100vh auf Mobile */
    .nav-panel { width: 100%; height: auto; max-height: none; flex: 1; overflow-y: auto; }
    .nav-panel__bg img { filter: saturate(0.5) brightness(0.3); }
    .nav-panel__content { padding-top: var(--nav-height); height: auto; }

    .nav-panel__menus { grid-template-columns: 1fr; overflow: visible; min-height: auto; }
    .nav-panel__secondary { display: none; }
    .nav-panel__primary { padding: 8px 0; justify-content: flex-start; }

    .nav-side { display: none; }

    .nav-item {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        border-bottom: 1px solid var(--nav-divider);
    }
    .nav-item__link {
        flex: 1;
        display: block;
        padding: 16px 16px 16px 24px;
        font-size: 1.1rem;
    }
    .nav-item--has-sub .nav-item__link {
        cursor: pointer;
    }
    .nav-item__link::after { display: none; }

    .nav-item__toggle {
        display: flex; align-items: center; justify-content: center;
        width: 36px; height: 36px;
        margin-right: 12px;
        background: none;
        border: 1px solid var(--nav-divider);
        border-radius: 50%;
        cursor: pointer;
        color: var(--nav-text-muted);
        transition: color 0.2s, border-color 0.2s;
        flex-shrink: 0;
    }
    .nav-item__toggle[aria-expanded="true"] { color: var(--nav-brand); border-color: var(--nav-brand); }
    .nav-item__toggle[aria-expanded="true"] .toggle-v { opacity: 0; transform: scaleY(0); transform-origin: center; }
    .toggle-v { transition: opacity 0.2s, transform 0.2s; }

    .nav-sub {
        display: block; width: 100%; list-style: none;
        overflow: hidden; max-height: 0;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        background: rgba(255,255,255,0.03);
    }
    .nav-sub.is-open { max-height: 600px; }
    .nav-sub__item { border-bottom: 1px solid var(--nav-divider); }
    .nav-sub__item:last-child { border-bottom: none; }
    .nav-sub__link {
        display: block; padding: 13px 24px 13px 40px;
        color: var(--nav-text-muted); text-decoration: none;
        font-size: 0.9375rem; font-weight: 300; transition: color 0.2s;
    }
    .nav-sub__link:hover { color: var(--nav-text); }

    .nav-panel__footer { padding: 16px 24px; flex-direction: column; align-items: flex-start; gap: 12px; }

    /* Schließen auf Mobile: oben rechts */
    .nav-overlay__close { left: auto; right: 16px; }
}

/* Anfragen-Button ausblenden auf kleinen Mobilgeräten (redundant mit Bottom-Bar) */
@media (max-width: 767.98px) {
    .site-header__book-btn { display: none !important; }
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */
.nav-item__link:focus-visible,
.nav-sub__link:focus-visible,
.nav-sub-desktop__link:focus-visible,
.nav-toggle:focus-visible,
.nav-overlay__close:focus-visible,
.site-header__book-btn:focus-visible {
    outline: 2px solid var(--nav-brand);
    outline-offset: 3px;
    border-radius: 2px;
}