/**
 * FahrerCockpit - Die Fahrschule
 * Haupt-Stylesheet (Designsystem: Motorsport trifft Premium-Webdesign)
 */

/* ==========================================================================
   0. Lokale Webfonts (Libre Franklin - SIL Open Font License)
   ========================================================================== */
@font-face {
    font-family: "Libre Franklin";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/LibreFranklin-VariableFont_wght-latin.woff2") format("woff2");
    unicode-range: U+0000-03FF, U+0530-10FFFF;
}

@font-face {
    font-family: "Libre Franklin";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/LibreFranklin-Italic-VariableFont_wght-latin.woff2") format("woff2");
    unicode-range: U+0000-03FF, U+0530-10FFFF;
}

/* Kyrillische Zeichen nur bei tatsächlicher Verwendung nachladen. */
@font-face {
    font-family: "Libre Franklin";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/LibreFranklin-VariableFont_wght-cyrillic.woff2") format("woff2");
    unicode-range: U+0400-052F;
}

@font-face {
    font-family: "Libre Franklin";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/LibreFranklin-Italic-VariableFont_wght-cyrillic.woff2") format("woff2");
    unicode-range: U+0400-052F;
}

/* ==========================================================================
   1. CSS Custom Properties / Design Tokens
   ========================================================================== */
:root {
    /* Farbpalette */
    --color-bg: #07080a;
    --color-bg-secondary: #0f1217;
    --color-surface: #161a22;
    --color-surface-hover: #1e232e;
    --color-surface-elevated: #242a37;
    
    --color-border: #252b36;
    --color-border-light: #343c4c;
    --color-border-neon: rgba(212, 255, 0, 0.4);
    
    /* Original Logo Neon-Lime (#d4ff00) */
    --color-neon: #d4ff00;
    --color-neon-hover: #e2ff2b;
    --color-neon-text: #07080a;
    --color-neon-dim: rgba(212, 255, 0, 0.12);
    --color-neon-glow: rgba(212, 255, 0, 0.25);
    
    /* Motorsport-Rot (Tachonadel) */
    --color-red: #ff2a4b;
    
    /* Typografie-Farben */
    --color-text: #f3f5f9;
    --color-text-muted: #9ba4b5;
    --color-text-dim: #8d9bb3;
    --color-white: #ffffff;

    /* Typografie */
    --font-sans: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Layout & Abstände */
    --container-max: 1240px;
    --container-narrow: 860px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Schatten & Effekte */
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    --shadow-neon: 0 0 20px rgba(212, 255, 0, 0.25);
    --transition-fast: 0.18s ease;
    --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   2. Reset & Grundstile
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: 120px;
    overflow-x: clip;
    overscroll-behavior-x: none;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    letter-spacing: -0.01em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
}

img, picture, svg {
    max-width: 100%;
    display: block;
}

a {
    color: var(--color-neon);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-neon-hover);
}

p {
    margin-bottom: 1.25rem;
}

p:last-child {
    margin-bottom: 0;
}

ul, ol {
    list-style: none;
}

/* Barrierefreier Skip-Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--color-neon);
    color: var(--color-neon-text);
    padding: 0.75rem 1.25rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    z-index: 9999;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
    outline: 3px solid var(--color-white);
}

/* Fokus-Markierung (WCAG 2.2 AA) */
:focus-visible {
    outline: 2px solid var(--color-neon);
    outline-offset: 3px;
}

/* ==========================================================================
   3. Typografie & Überschriften
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: anywhere;
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.03em;
}

h2 {
    font-size: clamp(1.6rem, 3.5vw, 1.8rem);
}

h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.4rem);
}

.lead-text {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Motorsport Badges */
.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.badge-tag.badge-neon {
    background: var(--color-neon-dim);
    color: var(--color-neon);
    border-color: rgba(212, 255, 0, 0.3);
}

/* ==========================================================================
   4. Layout-Container & Sektionen
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.section {
    padding: 4.5rem 0;
    position: relative;
}

.section-dark {
    background-color: var(--color-bg);
}

/* Rennflaggen-Akzentlinie */
.checkered-divider {
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        #ffffff 0,
        #ffffff 12px,
        #07080a 12px,
        #07080a 24px
    );
    opacity: 0.8;
    width: 100%;
}

/* ==========================================================================
   5. Buttons & Interaktion
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.85rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    text-decoration: none;
    line-height: 1;
}

/* Primärer Neon-Button (WCAG AAA Kontrast > 15:1 mit #07080a Text) */
.btn-primary {
    background: var(--color-neon);
    color: var(--color-neon-text);
    box-shadow: 0 4px 14px rgba(212, 255, 0, 0.25);
}

.btn-primary:hover {
    background: var(--color-neon-hover);
    color: var(--color-neon-text);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 255, 0, 0.4);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-white);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-neon);
    color: var(--color-neon);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
}

.btn-icon {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

/* In primären Neon-Buttons das weiße Icon dunkel färben für perfekten Kontrast */
.btn-primary .btn-icon {
    filter: brightness(0);
}

.btn-primary:hover .btn-icon,
.btn-secondary:hover .btn-icon {
    transform: translateX(4px);
}

/* ==========================================================================
   6. Header & Navigation
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(7, 8, 10, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    transition: all var(--transition-fast);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    min-height: 64px;
}

.brand-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.brand-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Desktop-Menü */
.nav-menu {
    display: none;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 1;
}

.nav-link {
    color: var(--color-text-muted);
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap; /* Verhindert jeglichen unerwünschten Zeilenumbruch wie bei 'Über uns' */
    display: inline-block;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-neon);
    background: var(--color-neon-dim);
}

.nav-cta-wrap {
    display: none;
    align-items: center;
    flex-shrink: 0;
}

.nav-cta-wrap .btn {
    white-space: nowrap;
}

.nav-label-mobile {
    display: none;
}

/* Mobiler Burger-Button */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-white);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 800;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
}

.menu-toggle:hover {
    border-color: var(--color-neon);
    color: var(--color-neon);
}

/* Sauberes Umschalten auf Desktop ab 1216px */
@media (min-width: 1216px) {
    .nav-menu {
        display: flex;
    }
    .nav-cta-wrap {
        display: flex;
    }
    .menu-toggle {
        display: none;
    }
}

/* Großzügigere Abstände auf weiten Bildschirmen */
@media (min-width: 1280px) {
    .brand-logo-img {
        height: 44px;
    }
}

/* Mobiles Drawer-Menü */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 380px;
    height: 100vh;
    height: 100dvh;
    background: var(--color-bg);
    border-left: 2px solid var(--color-border-neon);
    z-index: 2000;
    padding: 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
    transition: right var(--transition-smooth);
    overflow: hidden;
}

.mobile-drawer > div:first-child {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

.mobile-drawer.open {
    right: 0;
}

@media (min-width: 1160px) {
    .mobile-drawer, .drawer-overlay {
        display: none;
    }
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.drawer-header .brand-logo-img {
    height: 48px;
}

.drawer-close {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-white);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    cursor: pointer;
}

.drawer-close:hover {
    border-color: var(--color-neon);
    color: var(--color-neon);
}

.drawer-links {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mobile-drawer .nav-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
}

.mobile-drawer .nav-link {
    display: block;
    color: var(--color-white);
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    white-space: normal;
}

.mobile-drawer .nav-link:hover, .mobile-drawer .nav-link.active {
    background: var(--color-surface);
    color: var(--color-neon);
    border-left-color: var(--color-neon);
}

.mobile-drawer .nav-cta-wrap {
    flex-shrink: 0;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-drawer .nav-cta-wrap .btn {
    width: 100%;
    white-space: normal;
}

.mobile-drawer .nav-cta-wrap .btn-primary {
    padding: 1.05rem 2rem;
    font-size: 1.05rem;
}

.mobile-drawer .nav-label-desktop {
    display: none;
}

.mobile-drawer .nav-label-mobile {
    display: inline;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   7. Footer
   ========================================================================== */
.site-footer {
    background: #000000;
    border-top: 2px solid var(--color-border-neon);
    margin-top: auto;
    padding: 4rem 0 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.88rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

@media (max-width: 425px) {
    .hide-on-mobile {
        display: none;
    }
}

@media (min-width: 605px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr 1fr;
    }
}

.footer-col-title {
    color: var(--color-white);
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 28px;
    height: 2px;
    background: var(--color-neon);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-link {
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--color-neon);
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
    justify-content: space-between;
}

.footer-legal {
    position: relative;
    width: min(100%, 24rem);
}

.footer-legal-toggle {
    width: initial;
    justify-content: space-between;
}

.footer-legal-chevron {
    width: 0.5rem;
    height: 0.5rem;
    margin: 0 0.25rem -0.25rem 1rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(225deg);
}

.footer-legal-toggle[aria-expanded="true"] .footer-legal-chevron {
    transform: rotate(45deg);
    margin-bottom: 0.25rem;
}

.footer-legal-links {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    gap: 0 1.5rem;
    text-align: center;
}

.footer-legal-toggle[hidden], .footer-legal-links[hidden] {
    display: none;
}

.footer-legal-toggle:not([hidden]) + .footer-legal-links {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    width: min(100%, 13rem);
    max-height: calc(100vh - 12rem);
    max-height: calc(100dvh - 12rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
}

.footer-legal-toggle:not([hidden]) + .footer-legal-links .footer-legal-link {
    justify-content: flex-start;
    min-height: 48px;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.9rem;
}

.footer-legal-toggle:not([hidden]) + .footer-legal-links .footer-legal-link + .footer-legal-link {
    border-top: 1px solid var(--color-border);
}

.footer-legal-toggle:not([hidden]) + .footer-legal-links .footer-legal-link:hover, .footer-legal-toggle:not([hidden]) + .footer-legal-links .footer-legal-link:focus-visible {
    background: var(--color-surface-hover);
}

.footer-legal-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    padding: 0.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.footer-legal-link:hover, .footer-legal-link:focus-visible {
    color: var(--color-neon);
}

.footer-legal-link:focus-visible {
    outline: 2px solid var(--color-neon);
    outline-offset: 3px;
}

/* Ab hier sind dieselben Links ohne Aufklappen sichtbar. */
@media (min-width: 720px) {
    .footer-legal {
        width: fit-content;
        max-width: 100%;
    }

    .footer-legal-links {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .footer-legal-links {
        grid-template-columns: repeat(6, max-content);
    }
}

/* ==========================================================================
   8. Gemeinsame Hilfsklassen (Utility Classes)
   ========================================================================== */
body.drawer-open {
    overflow: hidden;
}

.btn-block {
    width: 100%;
}

.footer-logo-img {
    height: 40px;
    width: auto;
}

.footer-brand-text {
    margin-top: 1rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-brand-badge {
    margin-top: 1rem;
}

/* Profil- und Supportlinks unter dem Markenclaim */
.footer-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
    padding: 0;
    list-style: none;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.footer-social-link:hover, .footer-social-link:focus-visible {
    background: var(--color-neon);
    border-color: var(--color-neon);
}

.footer-social-link:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 3px;
}

.footer-social-icon, .footer-support-icon {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.footer-social-link:hover .footer-social-icon, .footer-social-link:focus-visible .footer-social-icon {
    filter: brightness(0);
}

.footer-contact-company {
    color: var(--color-text);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.footer-contact-address {
    color: var(--color-text-muted);
    line-height: 1.6;
    font-size: 0.9rem;
}

.footer-contact-mail {
    color: var(--color-neon);
}

/* ==========================================================================
   9. Barrierefreiheit & Reduced Motion (WCAG 2.2 AA)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


