/* ==========================================================================
   Kopf, Fuss und Randlabel der oeffentlichen Unternehmensseiten (SP93)
   --------------------------------------------------------------------------
   Gemeinsame Gestaltung fuer alles, was src/layout.php (renderHeader/renderFooter) ausgibt. Uebernommen aus dem
   freigegebenen Merch-Kopf/-Fuss (SP87/SP90), jetzt fuer alle Seiten gleich. Markup und Links kommen zentral aus
   src/site-chrome.php und src/site-nav.php.

   Scope: ausschliesslich body.kb-site (wird nur von renderHeader gesetzt). Admin-Cockpit, Engine-/Legacy-Shops, Checkout,
   Kundenportal und Merch-Rechtsseiten haben eigene Layouts und laden diese Datei nicht.
   Diese Datei wird nach style.css und vor seitenspezifischen Stylesheets geladen; gleiche Spezifitaet gewinnt hier durch die
   Reihenfolge (style.css: body.hp-dark .site-*).
   ========================================================================== */

/* --- Kopf -------------------------------------------------------------- */
body.kb-site .site-header {
    background: rgba(5, 10, 20, 0.97);
}

body.kb-site .site-header-inner {
    min-height: 68px;
}

body.kb-site .site-logo {
    max-height: 44px;
}

body.kb-site .site-nav {
    gap: 4px;
}

body.kb-site .site-nav a {
    padding: 10px 12px;
    border-radius: 4px;
    color: rgba(241, 245, 249, 0.88);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}

body.kb-site .site-nav a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

/* aktueller Bereich (serverseitig aria-current): ruhige orange Unterstreichung statt Pille */
body.kb-site .site-nav a[aria-current="page"] {
    background: transparent;
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 0 -3px 0 #f97316;
}

body.kb-site .site-nav a[aria-current="page"]:hover {
    background: rgba(255, 255, 255, 0.07);
}

body.kb-site .site-brand:focus-visible,
body.kb-site .site-nav a:focus-visible,
body.kb-site .nav-toggle:focus-visible {
    outline: 3px solid #fb923c;
    outline-offset: 2px;
}

body.kb-site .nav-toggle {
    border-radius: 4px;
}

/* --- Fuss -------------------------------------------------------------- */
body.kb-site .kb-footer {
    margin-top: 0;
    padding: clamp(40px, 6vw, 72px) 0 0;
    background: #020609;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.kb-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 36px clamp(24px, 5vw, 72px);
}

.kb-footer__logo {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 52px;
    filter: brightness(0) invert(1);
}

body.kb-site .kb-footer p {
    max-width: 46ch;
    margin: 16px 0 0;
    line-height: 1.6;
    color: rgba(241, 245, 249, 0.76);
}

body.kb-site .kb-footer h2 {
    margin: 0 0 12px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fb923c;
}

body.kb-site .kb-footer a {
    display: inline-block;
    min-height: 24px;
    padding-block: 5px;
    color: #f1f5f9;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

body.kb-site .kb-footer a:hover,
body.kb-site .kb-footer a[aria-current="page"] {
    color: #ffffff;
    text-decoration-color: #f97316;
}

body.kb-site .kb-footer a:focus-visible {
    outline: 3px solid #fb923c;
    outline-offset: 2px;
}

body.kb-site .kb-footer .footer-links li + li {
    margin-top: 2px;
}

/* Elektronische Widerrufsfunktion (SP126): hervorgehobener Zugang auf die zentrale Seite /merch/widerruf.php, auf Touch-Geraeten gut treffbar */
body.kb-site .kb-footer .footer-links li.kb-footer__withdraw {
    margin: 0 0 10px;
}

body.kb-site .kb-footer .footer-links li.kb-footer__withdraw a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 9px 16px;
    border: 2px solid #f97316;
    border-radius: 4px;
    background: rgba(249, 115, 22, 0.14);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
}

body.kb-site .kb-footer .footer-links li.kb-footer__withdraw a:hover {
    background: #f97316;
    color: #171a21;
}

.kb-footer__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 24px;
    margin-top: clamp(32px, 5vw, 56px);
    padding: 20px 0 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.kb-site .kb-footer__bar p {
    margin: 0;
    max-width: none;
    font-size: 0.85rem;
    color: rgba(241, 245, 249, 0.66);
}

body.kb-site .kb-footer__bar .kb-footer__origin {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* --- Randlabel "Gestaltet im Odenwald" ---------------------------------
   Rein dekorativ (aria-hidden, nicht klickbar); derselbe Hinweis steht im Fuss. Nur auf freigegebenen Seiten im Markup
   (kbSiteSignaturePaths) und nur dort sichtbar, wo ausserhalb des 1120-px-Inhalts genug Rand frei ist. */
.kb-signature {
    display: none;
}

@media (min-width: 1440px) and (min-height: 560px) {
    .kb-signature {
        position: fixed;
        /* Mitte des Labels bei ca. 30 % der Viewporthoehe (oberes Drittel); die Untergrenze haelt es bei niedrigen Fenstern
           unterhalb des 69-px-Kopfs */
        top: max(30%, 230px);
        right: 22px;
        z-index: 40;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
        transform: translateY(-50%);
        pointer-events: none;
        user-select: none;
    }

    .kb-signature__text {
        /* Leserichtung von unten nach oben (SP94): 180 Grad gedreht, nicht gespiegelt; die Punkte darunter bleiben unveraendert */
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        font-size: 0.68rem;
        font-weight: 600;
        line-height: 1;
        letter-spacing: 0.34em;
        color: rgba(241, 245, 249, 0.52);
        white-space: nowrap;
    }

    /* von oben nach unten: Schwarz, Rot, Gold */
    .kb-signature__dots {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .kb-signature__dots i {
        display: block;
        width: 7px;
        height: 7px;
        border-radius: 50%;
    }

    .kb-signature__dots i:nth-child(1) {
        background: #0b0b0c;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
    }

    .kb-signature__dots i:nth-child(2) {
        background: #d4271b;
    }

    .kb-signature__dots i:nth-child(3) {
        background: #f2b705;
    }
}

/* --- Responsiv --------------------------------------------------------- */
@media (max-width: 980px) {
    .kb-footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .kb-footer__brand {
        grid-column: 1 / -1;
    }
}

/* Mobile Navigation ab 1040 px (statt 760 px): die sechs Menuepunkte brechen so nie um.
   Der Umschalter (.nav-toggle, JS in layout.php) wirkt unabhaengig von der Breite. */
@media (max-width: 1040px) {
    body.kb-site .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }

    body.kb-site .site-nav {
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + 6px);
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px;
        border: 1px solid rgba(255, 255, 255, 0.07);
        border-radius: 6px;
        background: #0a101c;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
    }

    body.kb-site .site-nav.is-open {
        display: flex;
    }

    body.kb-site .site-nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 12px 14px;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.04);
    }

    /* Menue als ruhiges Feld; der aktuelle Bereich traegt einen seitlichen Balken */
    body.kb-site .site-nav a[aria-current="page"] {
        background: rgba(249, 115, 22, 0.14);
        box-shadow: inset 4px 0 0 #f97316;
    }
}

@media (max-width: 700px) {
    .kb-footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px 20px;
    }
}

@media (max-width: 360px) {
    .kb-footer__grid {
        grid-template-columns: 1fr;
    }
}
