/*
 * assets/css/site-navbar.css — Navbar "Block" (components/navbar.php), produktiv seit 19.09.2026.
 *
 * Entscheidung aus 4 Varianten (design-previews/navbar-redesign/): CTA als bündiger, schräg
 * angeschnittener Vollhöhen-Block am rechten Rand, Link + Theme-Toggle davor mit Trennlinie.
 * Die Leiste ist in beiden Themes dunkel (Light: Waldgrün wie der Hero, Dark: Slate), deshalb
 * heller CTA mit dunkler Schrift statt Grün auf Grün.
 *
 * Wird auf allen Seiten mit components/navbar.php geladen (Startseite, Rechner, Rechtsseiten);
 * keine Abhängigkeit von light-skin.css / wald-sand-tokens.css.
 */

/* ---------------------------------------------------------------- Tokens */
.nv {
    --nv-mint: #40d6a0;
    --nv-ink-on-mint: #052a1c;
    --nv-ease: cubic-bezier(.2, .8, .2, 1);
    --nv-h: 76px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    color: var(--nv-text);
    background: var(--nv-bg);
    border-bottom: 1px solid var(--nv-line);
    box-shadow: var(--nv-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: background-color .3s var(--nv-ease);
}
/* Light: "Moos" (25.09.2026, heller als vorher #0b2c20; Auswahl in design-previews/navbar-hell/).
   Deckkraft .92, damit der Ton beim Scrollen über Sand nicht verwäscht. Kontrast Link 5,7. */
html:not(.dark) .nv {
    --nv-bg: rgba(27, 84, 64, 0.92);
    --nv-bg-solid: #1b5440;
    --nv-line: rgba(246, 243, 236, 0.10);
    --nv-line-strong: rgba(246, 243, 236, 0.18);
    --nv-text: #f6f3ec;
    --nv-text-2: rgba(246, 243, 236, 0.80);
    --nv-text-3: rgba(246, 243, 236, 0.58);
    --nv-accent: #6ee7b7;
    --nv-hover-fill: rgba(246, 243, 236, 0.07);
    --nv-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
}
html.dark .nv {
    --nv-bg: rgba(2, 6, 23, 0.86);
    --nv-bg-solid: #020617;
    --nv-line: rgba(255, 255, 255, 0.10);
    --nv-line-strong: rgba(255, 255, 255, 0.18);
    --nv-text: #f8f8f0;
    --nv-text-2: #cbd5e1;
    --nv-text-3: #94a3b8;
    --nv-accent: #40d6a0;
    --nv-hover-fill: rgba(255, 255, 255, 0.06);
    --nv-shadow: 0 10px 30px rgba(2, 6, 23, 0.45);
}

/* Logo: Creme + Mint auf dunkler Leiste (Farbentscheidung "Reihe 2", 14.09.2026) */
.nv-brand { display: inline-flex; align-items: center; color: var(--nv-text); text-decoration: none; }
.nv-brand .nv-brand-accent { color: var(--nv-accent); }

/* ---------------------------------------------------------------- Gerüst */
.nv-wrap {
    max-width: 1400px;
    height: var(--nv-h);
    margin: 0 auto;
    padding: 0 0 0 2rem;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
}
.nv-left { display: flex; align-items: center; }
.nv-right { display: none; align-items: stretch; gap: 22px; }
@media (min-width: 768px) { .nv-right { display: flex; } }
.nv-right > .nv-link,
.nv-right > .nv-toggle,
.nv-right > .nv-sep { align-self: center; }

.nv-link {
    position: relative;
    font-weight: 600;
    font-size: 15px;
    color: var(--nv-text-2);
    text-decoration: none;
    white-space: nowrap;
    transition: color .25s var(--nv-ease);
}
.nv-link:hover { color: var(--nv-text); }
.nv-right > .nv-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    border-radius: 2px;
    background: var(--nv-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s var(--nv-ease);
}
.nv-right > .nv-link:hover::after { transform: scaleX(1); }

.nv-sep { width: 1px; height: 22px; background: var(--nv-line-strong); flex: none; }

/* Theme-Toggle: Sonne im Light, Mond im Dark */
.nv-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--nv-line-strong);
    background: var(--nv-hover-fill);
    color: var(--nv-text-2);
    cursor: pointer;
    transition: background .25s var(--nv-ease), color .25s var(--nv-ease), transform .25s var(--nv-ease);
}
.nv-toggle:hover { color: var(--nv-text); background: rgba(255, 255, 255, .12); transform: rotate(12deg); }
.nv-toggle i { font-size: 14px; }
.nv-toggle .nv-sun { color: #fbbf24; }
.nv-toggle .nv-moon { color: #a5b4fc; display: none; }
html.dark .nv-toggle .nv-sun { display: none; }
html.dark .nv-toggle .nv-moon { display: inline; }

/* ---------------------------------------------------------------- CTA-Block */
.nv-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 6px;
    padding: 0 36px 0 40px;
    font-weight: 800;
    font-size: 15.5px;
    color: var(--nv-ink-on-mint);
    text-decoration: none;
    white-space: nowrap;
    background: linear-gradient(160deg, #5ee9b5 0%, #40d6a0 55%, #23b384 100%);
    clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
    overflow: hidden;
    isolation: isolate;
    transition: background .3s var(--nv-ease);
}
.nv-cta:hover { background: linear-gradient(160deg, #7ff0c3 0%, #52e0ad 55%, #2cc492 100%); }
/* feine Diagonalstruktur, nach rechts einblendend */
.nv-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .18;
    background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0) 0 10px, rgba(255, 255, 255, .55) 10px 11px);
    mask-image: linear-gradient(90deg, transparent 0%, #000 60%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 60%);
}
/* weicher Lichtstreifen an der Unterkante */
.nv-cta::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7));
}
.nv-cta .nv-cta-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(5, 42, 28, .16);
    font-size: 15px;
}
.nv-cta .nv-cta-arrow {
    font-size: 13px;
    width: 0;
    opacity: 0;
    margin-left: -6px;
    transform: translateX(-4px);
    overflow: hidden;
    transition: width .3s var(--nv-ease), opacity .3s var(--nv-ease), transform .3s var(--nv-ease), margin .3s var(--nv-ease);
}
.nv-cta:hover .nv-cta-arrow { width: 13px; opacity: 1; margin-left: 0; transform: translateX(0); }
.nv-cta:focus-visible { outline: 3px solid var(--nv-accent); outline-offset: -3px; }

/* Tablet hochkant (768–1023 px): Rechtsseiten haben zwei Links + CTA, alles einzeilig halten */
@media (min-width: 768px) and (max-width: 1023px) {
    .nv-wrap { padding-left: 1.25rem; }
    .nv-brand svg:first-child { height: 2.25rem; }
    .nv-brand svg:last-child { height: 1.05rem; }
    .nv-brand > span { gap: .6rem; }
    .nv-right { gap: 12px; }
    .nv-link { font-size: 14px; }
    .nv-cta { padding: 0 16px 0 28px; font-size: 13.5px; gap: 8px; }
    .nv-cta .nv-cta-ico { width: 28px; height: 28px; font-size: 13px; }
    .nv-cta .nv-cta-arrow { display: none; }
}

/* ---------------------------------------------------------------- Mobile */
.nv-mobile-controls { display: none; }
@media (max-width: 767px) {
    .nv-wrap { padding: 0 1.25rem; align-items: center; }
    /* Logo etwas kleiner, damit Wortmarke und Burger bei 360–400 px Platz haben */
    .nv-brand svg:first-child { height: 2.25rem; }
    .nv-brand svg:last-child { height: 1.05rem; }
    .nv-brand > span { gap: .6rem; }
    .nv-mobile-controls { display: flex; flex: none; align-items: center; }
    /* Variante C: Darstellung und Menü gemeinsam neben der flexiblen Wortmarke. */
    .nv-wrap--theme-controls { gap: 10px; }
    .nv-wrap--theme-controls .nv-left { min-width: 0; flex: 1 1 auto; }
    .nv-wrap--theme-controls .nv-brand { min-width: 0; width: 100%; max-width: 275px; }
    .nv-wrap--theme-controls .nv-brand > span { width: 100%; gap: 8px; }
    .nv-wrap--theme-controls .nv-brand svg:first-child { height: 34px; flex: none; }
    .nv-wrap--theme-controls .nv-brand svg:last-child { min-width: 0; flex: 1 1 auto; width: 0; height: 16.8px; }
    .nv-wrap--theme-controls .nv-mobile-controls {
        border: 1px solid var(--nv-line-strong);
        border-radius: 12px;
        background: var(--nv-hover-fill);
    }
    .nv-wrap--theme-controls .nv-mobile-controls > button {
        width: 44px;
        height: 44px;
        flex: none;
        background: transparent;
        border: none;
    }
    .nv-wrap--theme-controls .nv-mobile-controls .nv-toggle {
        border-right: 1px solid var(--nv-line-strong);
        border-radius: 12px 0 0 12px;
    }
    .nv-wrap--theme-controls .nv-mobile-controls .nv-toggle:hover { transform: none; }
    .nv-wrap--theme-controls .nv-mobile-controls button:focus-visible { outline: 2px solid var(--nv-accent); outline-offset: 2px; }
}
.nv-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--nv-line-strong);
    background: var(--nv-hover-fill);
    color: var(--nv-text);
    cursor: pointer;
}
@media (min-width: 768px) { .nv-burger { display: none; } }
.nv-mobile {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 14px 20px 22px;
    background: var(--nv-bg-solid);
    border-bottom: 1px solid var(--nv-line);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
.nv-mobile:not(.hidden) { display: flex; }
@media (min-width: 768px) { .nv-mobile { display: none !important; } }
.nv-mobile .nv-link { font-size: 17px; padding: 12px 4px; border-bottom: 1px solid var(--nv-line); }
.nv-mobile .nv-mobile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px 4px;
    color: var(--nv-text-3);
    font-size: 13px;
}
.nv-mobile .nv-cta {
    justify-content: center;
    margin: 8px 0 0;
    padding: 15px 20px;
    border-radius: 16px;
    clip-path: none;
}
.nv-mobile .nv-cta::after { display: none; }

@media (prefers-reduced-motion: reduce) {
    .nv, .nv-link, .nv-toggle, .nv-cta, .nv-cta .nv-cta-arrow { transition: none; }
}
