/* ===========================================
   R4P – COMPONENTS
   Navbar, Buttons, Cards, Footer, Mobile-Menu
   =========================================== */

/* ====== Navbar ====== */
:root {
    --nav-safe-top: 80px;
}

.nav-wrap {
    position: fixed;
    top: 18px;
    left: 0;
    right: 0;
    z-index: 50;
    pointer-events: none;
}

.nav {
    pointer-events: auto;
    position: relative;
    display: grid;
    /* 1fr | auto | 1fr: gleich breite Außen-Spalten → Mitte (Links) liegt exakt in der Nav-Mitte */
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    background: var(--c-white);
    border-radius: var(--r-pill);
    padding: 10px 12px 10px 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s var(--ease-out), background 0.3s var(--ease-out);
}

.nav-wrap.is-scrolled .nav {
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.25);
}

.brand {
    grid-column: 1;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}

.brand:hover {
    opacity: 0.88;
}

.brand__logo {
    display: block;
    height: clamp(40px, 5.5vw, 52px);
    width: auto;
    max-width: min(160px, 42vw);
    object-fit: contain;
    object-position: left center;
}

.nav__links {
    grid-column: 2;
    justify-self: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px 18px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav__links a {
    position: relative;
    padding: 8px 4px;
    color: var(--c-text-dark);
}

.nav__links a::after {
    content: '';
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 4px;
    height: 2px;
    background: var(--c-green);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease-out);
}

.nav__links a:hover::after,
.nav__links a.is-active::after {
    transform: scaleX(1);
}

.nav__actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Language Switch */
.lang {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 7px 16px 7px 12px;
    border: 1.5px solid #E4E4E4;
    border-radius: var(--r-pill);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    line-height: 1;
    user-select: none;
    transition: border-color 0.25s var(--ease-out);
}

.lang:hover,
.lang:focus-visible {
    border-color: var(--c-green);
    outline: none;
}

.lang__flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
    line-height: 0;
    flex-shrink: 0;
}

.lang__flag svg {
    display: block;
    width: 30px;
    height: auto;
}

.lang__label {
    flex-shrink: 0;
    white-space: nowrap;
}

.lang__chev {
    display: block;
    flex: 0 0 12px;
    width: 12px;
    height: 8px;
    margin-inline-end: 1px;
    color: var(--c-text-dark);
    transform-origin: 50% 50%;
    transition: transform 0.25s var(--ease-out);
}

.lang.is-open .lang__chev {
    transform: rotate(180deg);
}

.lang__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    background: var(--c-white);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    padding: 8px;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

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

.lang__menu li {
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
}

.lang__menu li:hover {
    background: var(--c-off-white);
}

.lang__menu li.is-active {
    background: var(--c-green);
    color: var(--c-accent);
    font-weight: 700;
}

/* ====== Buttons ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--ff-body);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 14px 26px;
    border: 1.5px solid transparent;
    transition: transform 0.25s var(--ease-out),
                background 0.25s var(--ease-out),
                color 0.25s var(--ease-out),
                border-color 0.25s var(--ease-out);
    white-space: nowrap;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    opacity: 1;
}

.btn--pill {
    border-radius: var(--r-pill);
}

.btn--dark {
    background: var(--c-black);
    color: var(--c-white);
}

.btn--dark:hover {
    background: var(--c-green);
}

.btn--accent {
    background: var(--c-accent);
    color: var(--on-accent, var(--c-green));
}

.btn--accent:hover {
    box-shadow: 0 0 0 6px var(--c-accent-glow);
}

.btn--outline {
    background: transparent;
    color: var(--c-green);
    border-color: var(--c-green);
}

.btn--outline:hover {
    background: var(--c-green);
    color: var(--c-white);
}

.btn--ghost {
    background: transparent;
    color: var(--c-white);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn--ghost:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
}

/* ====== Burger ====== */
.nav__burger {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: var(--r-pill);
    background: var(--c-black);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-left: 4px;
}

.nav__burger span {
    width: 18px;
    height: 2px;
    background: var(--c-white);
    transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

/* ====== Mobile Menu ====== */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: var(--c-green);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease-out), visibility 0.4s;
}

.mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}

.mobile-menu nav a {
    font-family: var(--ff-display);
    font-size: 2.5rem;
    color: var(--c-accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mobile-menu nav a.btn {
    font-family: var(--ff-body);
    font-size: 0.9rem;
    color: var(--c-green);
    margin-top: 12px;
}

.mobile-menu__close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: var(--r-pill);
    background: var(--c-accent);
    color: var(--c-green);
    font-size: 2rem;
    line-height: 1;
    display: grid;
    place-items: center;
}

/* ====== Footer ====== */
.footer {
    background: var(--c-green-deep);
    color: var(--c-white);
    padding: 80px 0 32px;
}

.footer__inner {
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 48px;
    padding-bottom: 60px;
    border-bottom: 1px solid var(--c-line);
}

.footer__brand p {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.65);
    max-width: 280px;
}

.footer__cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.footer__cols h4 {
    font-family: var(--ff-body);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    color: var(--c-accent);
    margin-bottom: 18px;
    text-transform: uppercase;
}

.footer__cols a,
.footer__cols span {
    display: block;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    padding: 4px 0;
}

.footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.footer__bottom a:hover {
    color: var(--c-accent);
}

/* ====== Section Dots (vertikale Side-Nav) ====== */
.section-dots {
    position: fixed;
    top: 50%;
    right: 28px;
    transform: translateY(-50%);
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 16px 12px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--r-pill);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.section-dots a {
    position: relative;
    width: 14px;
    height: 14px;
    display: grid;
    place-items: center;
    transition: transform 0.25s var(--ease-out);
}

.section-dots a:hover {
    transform: scale(1.2);
}

.section-dots__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transition: background 0.3s var(--ease-out),
                transform 0.3s var(--ease-out),
                box-shadow 0.3s var(--ease-out);
}

.section-dots a:hover .section-dots__dot {
    background: rgba(255, 255, 255, 0.7);
}

.section-dots a.is-active .section-dots__dot {
    background: var(--c-accent);
    transform: scale(1.4);
    box-shadow: 0 0 0 4px rgba(230, 255, 77, 0.18);
}

/* Tooltip via data-label */
.section-dots a::before {
    content: attr(data-label);
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    padding: 6px 12px;
    background: var(--c-black);
    color: var(--c-white);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: var(--r-pill);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.section-dots a::after {
    content: '';
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: var(--c-black);
    opacity: 0;
    transition: opacity 0.25s var(--ease-out);
}

.section-dots a:hover::before,
.section-dots a:hover::after {
    opacity: 1;
}

.section-dots a:hover::before {
    transform: translateY(-50%) translateX(0);
}

/* ====== Responsive ====== */
html[data-theme="peace"] .nav-wrap {
    top: 0;
}

@media (max-width: 960px) {
    .nav-wrap {
        top: 12px;
    }

    html[data-theme="peace"] .nav-wrap {
        top: 0;
    }

    html[data-theme="peace"] .nav__strava {
        display: none;
    }
    .nav {
        padding: 8px 8px 8px 18px;
    }
    .nav__links,
    .lang,
    .nav__actions > .btn,
    .nav__actions > .auth-login-btn,
    .nav__actions > .user-menu {
        display: none;
    }
    .nav__burger {
        display: flex;
    }
    .footer__inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .section-dots {
        display: none;
    }
}

@media (max-width: 640px) {
    .footer__cols {
        grid-template-columns: 1fr 1fr;
    }
    .footer__bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .btn {
        padding: 12px 22px;
        font-size: 0.78rem;
    }
}
