/* ============================================================
   LAYOUT — Container, Header, Navigation, Footer, Sektionen
   ============================================================ */
.container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.section {
    padding-block: var(--space-section);
}

.section--center {
    text-align: center;
}

.section--center p {
    margin-inline: auto;
}

/* --- Header --- */
.site-header {
    position: absolute;
    inset: 20px 0 auto 0;
    z-index: 10;
}

/* Desktop: Logo links | Nav exakt zentriert | CTAs rechts */
.site-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
    min-height: var(--header-h);
}

.site-header__brand {
    justify-self: start;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--clr-text);
}

.site-header__logo {
    height: var(--logo-h);
    width: auto;
    filter: drop-shadow(var(--shadow));
}

.site-header__actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* --- Navigation --- */
.site-nav {
    justify-self: center;
}

.site-nav__toggle {
    display: none;
}

.site-nav__list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: var(--fs-500);
}

.site-nav__list a:not(.btn) {
    color: var(--clr-text);
    text-decoration: none;
    padding-block: 0.25em;
    border-bottom: 2px solid transparent;
    transition: border-color var(--transition);
}

.site-nav__list a:not(.btn):hover,
.site-nav__list a:not(.btn)[aria-current="page"] {
    border-bottom-color: var(--clr-accent);
}

/* --- Dropdown-Untermenü --- */
.site-nav__item--has-submenu {
    position: relative;
}

/* Unsichtbare Brücke über die Lücke zwischen Trigger und Menü: hält den :hover
   durchgehend, damit das Dropdown beim Rüberfahren nicht sofort schließt. */
.site-nav__item--has-submenu:hover::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 15rem;
    max-width: 90vw;
    height: 0.85rem;
}

/* Dropdown-Trigger sieht aus wie die übrigen Nav-Links (ist aber ein <button>). */
.site-nav__sublink {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    margin: 0;
    padding: 0.25em 0;
    font: inherit;
    color: var(--clr-text);
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: border-color var(--transition);
}

.site-nav__sublink:hover,
.site-nav__sublink[data-current],
.site-nav__item--has-submenu:focus-within > .site-nav__sublink {
    border-bottom-color: var(--clr-accent);
}

.site-nav__chevron {
    font-size: 0.7em;
    transition: transform var(--transition);
}

.site-nav__item--has-submenu:hover .site-nav__chevron,
.site-nav__item--has-submenu:focus-within .site-nav__chevron,
.site-nav__sublink[aria-expanded="true"] .site-nav__chevron {
    transform: rotate(180deg);
}

.site-nav__submenu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    display: grid;
    gap: 0.35rem;
    min-width: 13rem;
    margin: 0;
    padding: 0.6rem;
    list-style: none;
    background: var(--clr-bg-deep);
    border: 1px solid var(--clr-glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    /* Clippt die Hover-Flächen sauber an den abgerundeten Ecken (kein Überstehen). */
    overflow: hidden;
    /* Sanftes Einblenden statt hartem display-Wechsel (animierbar). */
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), top var(--transition), visibility var(--transition);
}

.site-nav__item--has-submenu:hover > .site-nav__submenu,
.site-nav__item--has-submenu:focus-within > .site-nav__submenu,
.site-nav__sublink[aria-expanded="true"] + .site-nav__submenu {
    opacity: 1;
    visibility: visible;
    top: calc(100% + 0.75rem);
}

.site-nav__list .site-nav__submenu a:not(.btn) {
    display: block;
    padding: 0.6rem 0.85rem;
    border-bottom: 0;
    border-radius: var(--radius-btn);
    font-size: var(--fs-500);
    line-height: 1.25;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}

.site-nav__list .site-nav__submenu a:not(.btn):hover,
.site-nav__list .site-nav__submenu a:not(.btn):focus-visible {
    border-bottom: 0;
    background: rgb(var(--clr-accent-rgb) / 0.16);
}

.site-nav__list .site-nav__submenu a:not(.btn)[aria-current="page"] {
    border-bottom: 0;
    background: rgb(var(--clr-accent-rgb) / 0.24);
}

@media (max-width: 1249px) {
    /* Mobile: Logo links, CTAs + Burger rechts */
    .site-header__inner {
        display: flex;
        justify-content: space-between;
    }

    .site-header__actions {
        order: 2;
        margin-left: auto;
        /* CTAs bleiben über dem Menü-Overlay sichtbar */
        position: relative;
        z-index: 30;
    }

    .site-nav {
        order: 3;
    }

    .site-nav__toggle {
        display: grid;
        place-items: center;
        width: 48px;
        height: 48px;
        background: transparent;
        border: 0;
        cursor: pointer;
    }

    /* Burger: Mittelbalken + Pseudo-Balken, animiert zum X */
    .site-nav__toggle-bar,
    .site-nav__toggle-bar::before,
    .site-nav__toggle-bar::after {
        display: block;
        width: 28px;
        height: 3px;
        background: var(--clr-text);
        border-radius: 2px;
        transition: transform var(--transition), opacity var(--transition);
    }

    .site-nav__toggle-bar {
        position: relative;
    }

    .site-nav__toggle-bar::before,
    .site-nav__toggle-bar::after {
        content: '';
        position: absolute;
        left: 0;
    }

    .site-nav__toggle-bar::before { top: -9px; }
    .site-nav__toggle-bar::after  { top: 9px; }

    .site-nav__toggle[aria-expanded="true"] .site-nav__toggle-bar {
        background: transparent;
    }

    .site-nav__toggle[aria-expanded="true"] .site-nav__toggle-bar::before {
        transform: translateY(9px) rotate(45deg);
    }

    .site-nav__toggle[aria-expanded="true"] .site-nav__toggle-bar::after {
        transform: translateY(-9px) rotate(-45deg);
    }

    .site-nav__list {
        position: fixed;
        inset: 0;
        z-index: 20;
        flex-direction: column;
        justify-content: center;
        gap: 1.75rem;
        background: rgb(0 0 0 / 0.91);
        font-size: var(--fs-700);
        visibility: hidden;
        opacity: 0;
        transition: opacity var(--transition), visibility var(--transition);
    }

    .site-nav__list a:not(.btn) {
        font-family: var(--ff-heading);
        text-transform: uppercase;
    }

    /* Dropdown im Overlay: Trigger wie die anderen Punkte, Untermenü inline darunter. */
    .site-nav__sublink {
        font-family: var(--ff-heading);
        font-size: var(--fs-700);
        text-transform: uppercase;
        justify-content: center;
    }

    /* Im Overlay inline einklappen — display statt visibility, sonst bliebe Platz reserviert. */
    .site-nav__submenu {
        position: static;
        transform: none;
        display: none;
        opacity: 1;
        visibility: visible;
        gap: 0.25rem;
        min-width: 0;
        margin: 0.75rem 0 0;
        padding: 0;
        background: none;
        border: 0;
        box-shadow: none;
        text-align: center;
    }

    .site-nav__item--has-submenu:focus-within > .site-nav__submenu,
    .site-nav__sublink[aria-expanded="true"] + .site-nav__submenu {
        display: grid;
    }

    .site-nav__list .site-nav__submenu a:not(.btn) {
        font-size: var(--fs-600);
        color: var(--clr-text-muted);
    }

    body.nav-open .site-nav__list {
        visibility: visible;
        opacity: 1;
    }

    body.nav-open {
        overflow: hidden;
    }

    /* Toggle über dem Overlay halten */
    .site-nav__toggle {
        position: relative;
        z-index: 30;
    }
}

@media (max-width: 600px) {
    /* Schmale Screens: CTA(s) kompakter neben dem Burger. */
    .site-header__actions a:not(:last-child) {
        display: none;
    }

    .site-header__actions .btn {
        font-size: var(--fs-400);
        padding: 8px 14px;
    }
}

/* --- Back-to-top --- */
.back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 15;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: var(--clr-text);
    font-size: 1.25rem;
    background: rgb(10 10 10 / 0.82);
    border: 1px solid var(--clr-glass-border-strong);
    border-radius: 50%;
    backdrop-filter: blur(6px);
    /* Unsichtbar, bis genug gescrollt wurde (is-visible via JS) */
    opacity: 0;
    visibility: hidden;
    translate: 0 10px;
    transition: opacity var(--transition), visibility var(--transition), translate var(--transition), background var(--transition);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    translate: 0 0;
}

.back-to-top:hover {
    background: var(--clr-accent);
    border-color: var(--clr-accent);
}

.back-to-top:focus-visible {
    outline: 2px solid var(--clr-text);
    outline-offset: 3px;
}

@media print {
    .back-to-top {
        display: none;
    }
}

/* --- Footer --- */
.site-footer {
    margin-top: var(--space-section);
    background: var(--clr-bg-footer);
    font-size: var(--fs-500);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr 1fr;
    gap: 3rem;
    padding-block: 4.5rem 3.5rem;
}

@media (max-width: 992px) {
    .site-footer__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .site-footer__grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

/* Brand-Block */
.site-footer__brand {
    display: grid;
    justify-items: start;
    gap: 1.25rem;
}

.site-footer__claim {
    color: var(--clr-text-muted);
    max-width: 36ch;
}

.site-footer__social {
    display: grid;
    gap: 0.5rem;
}

.site-footer__social a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding-block: 0.3rem;
    color: var(--clr-text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.site-footer__social .icon {
    font-size: 1.25em;
    color: var(--clr-text);
}

/* Spalten-Headings mit rotem Akzentstrich — Coolvetica ist schmal,
   braucht hier mehr Größe + Laufweite für Lesbarkeit */
.site-footer__heading {
    font-size: var(--fs-650);
    letter-spacing: 0.06em;
    margin-bottom: 1.1rem;
    padding-bottom: 0.6rem;
    position: relative;
}

.site-footer__heading::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 2.5rem;
    height: 3px;
    background: var(--clr-accent);
    border-radius: 2px;
}

.site-footer__address {
    font-style: normal;
    color: var(--clr-text-muted);
    display: grid;
    gap: 1rem;
}

.site-footer__address p {
    display: flex;
    gap: 0.6rem;
    margin: 0;
}

.site-footer__address .icon {
    flex: none;
    margin-top: 0.3em;
    color: var(--clr-text);
}

.site-footer__list {
    display: grid;
    gap: 0.25rem;
}

.site-footer__list a,
.site-footer__address a {
    display: inline-block;
    padding-block: 0.3rem;
    color: var(--clr-text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.site-footer__list a:hover,
.site-footer__address a:hover,
.site-footer__social a:hover {
    color: var(--clr-text);
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

/* Bottom-Bar */
.site-footer__bottom {
    border-top: 1px solid var(--clr-glass-border);
}

.site-footer__bottom-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    padding-block: 1.5rem;
    font-size: var(--fs-400);
    color: var(--clr-text-muted);
}

.site-footer__bottom-inner p {
    margin: 0;
}

/* Verbände-Zeile bleibt ab Tablet-Breite einzeilig (wrappt als Ganzes in die nächste Reihe) */
@media (min-width: 768px) {
    .site-footer__memberships {
        white-space: nowrap;
    }
}
