/**
 * File: main.css
 *
 * Main CSS for KuK Bendorf Theme.
 * Global styles, variables, and common elements.
 *
 * @package     KuK Bendorf Theme
 * @author      Oliver Ferber <admin@kuk-bendorf.de>
 * @copyright   2024-2026 KuK Bendorf e.V.
 * @license     Proprietary
 * @version     1.0.0
 */

/* Variables */
:root {
    /* =============================================
       BRAND COLORS – Unveränderlich (KuK Identity)
       ============================================= */
    --kuk-red:          #F20F0F;
    --kuk-red-dark:     #C80B0B;
    --kuk-red-light:    #FFF0F0;
    --kuk-red-glow:     rgba(242, 15, 15, 0.22);
    --kuk-gold:         #FFD700;
    --kuk-white:        #FFFFFF;

    /* =============================================
       LIGHT MODE SURFACE TOKENS (Default)
       ============================================= */
    --surface-0:        #FFFFFF;       /* Page background */
    --surface-1:        #F8F9FA;       /* Subtle bg, section bg */
    --surface-2:        #FFFFFF;       /* Card / elevated bg */
    --surface-nav:      #FFFFFF;       /* Navigation background */

    /* =============================================
       LIGHT MODE TEXT TOKENS
       ============================================= */
    --color-text:       #1A1A2E;       /* Primary text */
    --color-text-2:     #4A5568;       /* Secondary text */
    --color-text-3:     #718096;       /* Muted / meta text */
    --color-border:     #E2E8F0;       /* Borders, dividers */

    /* =============================================
       LEGACY SEMANTIC ALIASES (Backward compat)
       ============================================= */
    --kuk-text:         #1A1A2E;
    --kuk-text-light:   #4A5568;
    --kuk-text-muted:   #718096;
    --kuk-off-white:    #F8F9FA;
    --primary:          var(--kuk-red);
    --primary-dark:     var(--kuk-red-dark);
    --secondary:        #ffffff;
    --text:             var(--kuk-text);
    --text-light:       var(--kuk-text-light);
    --bg-light:         var(--kuk-off-white);
    --accent:           var(--kuk-gold);
    --font-heading:     'Roboto', sans-serif;
    --font-body:        'Open Sans', sans-serif;

    /* =============================================
       SHADOWS
       ============================================= */
    --shadow:           0 4px 8px rgba(0, 0, 0, 0.09);
    --shadow-sm:        0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md:        0 4px 16px rgba(0, 0, 0, 0.09);
    --shadow-lg:        0 10px 32px rgba(0, 0, 0, 0.13);
    --shadow-card:      0 4px 20px rgba(0, 0, 0, 0.07);
    --shadow-hover:     0 10px 36px rgba(0, 0, 0, 0.13);
    --shadow-red:       0 4px 20px rgba(242, 15, 15, 0.18);
    --shadow-red-lg:    0 8px 32px rgba(242, 15, 15, 0.25);

    /* =============================================
       SPACING, RADIUS, TRANSITIONS
       ============================================= */
    --radius:           8px;
    --radius-sm:        4px;
    --radius-md:        8px;
    --radius-lg:        12px;
    --radius-xl:        16px;
    --radius-full:      50px;

    --space-xs:         4px;
    --space-sm:         8px;
    --space-md:         16px;
    --space-lg:         24px;
    --space-xl:         32px;
    --space-2xl:        48px;

    --hover-lift:           translateY(-5px);
    --hover-transition:     all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base:      all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce:    all 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* =============================================
   DARK MODE TOKEN OVERRIDE
   All pages except FBI/Tech-Style pages (login,
   access-denied, 404) are affected.
   ============================================= */
html[data-theme="dark"] {
    /* Surfaces */
    --surface-0:        #0D0D1A;
    --surface-1:        #13131F;
    --surface-2:        #1C1C2E;
    --surface-nav:      #11111C;
    --kuk-red-light:    rgba(242, 15, 15, 0.14);

    /* Text */
    --color-text:       #F0F0F8;
    --color-text-2:     #A0A8C0;
    --color-text-3:     #6B7A99;
    --color-border:     #2A2A42;

    /* Legacy aliases – override for backward compat */
    --kuk-text:         #F0F0F8;
    --kuk-text-light:   #A0A8C0;
    --kuk-text-muted:   #6B7A99;
    --kuk-off-white:    #13131F;
    --text:             #F0F0F8;
    --text-light:       #A0A8C0;
    --bg-light:         #13131F;
    --secondary:        #1C1C2E;

    /* Shadows – deeper in dark mode */
    --shadow:           0 4px 8px rgba(0, 0, 0, 0.45);
    --shadow-sm:        0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md:        0 4px 16px rgba(0, 0, 0, 0.50);
    --shadow-lg:        0 10px 32px rgba(0, 0, 0, 0.65);
    --shadow-card:      0 4px 20px rgba(0, 0, 0, 0.55);
    --shadow-hover:     0 10px 36px rgba(0, 0, 0, 0.65);
    --shadow-red:       0 4px 20px rgba(242, 15, 15, 0.28);
    --shadow-red-lg:    0 8px 32px rgba(242, 15, 15, 0.35);
}

/* =============================================
   SMOOTH THEME TRANSITION (Dark/Light Switch)
   ============================================= */
html {
    min-height: 100%;
    overflow-x: hidden;         /* kein horizontales Scrollen / Wischen */
    max-width: 100%;            /* Verhindert dass Kindelemente die Seite breiter machen */
    width: 100%;
    transition: background-color 0.35s ease, color 0.35s ease;
}

/* Global Styles */
body {
    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--surface-0);
    background-image:
        radial-gradient(circle at 100% 0%, rgba(242, 15, 15, 0.14) 0%, rgba(242, 15, 15, 0.02) 60%, transparent 80%),
        radial-gradient(circle at 0% 100%, rgba(242, 15, 15, 0.09) 0%, rgba(242, 15, 15, 0.02) 60%, transparent 80%);
    background-attachment: fixed !important;
    min-height: 100vh;
    overflow-x: hidden;         /* Zweite Absicherung: Body auch fix */
    max-width: 100vw;           /* Strikt auf Viewport-Breite begrenzen */
    transition: background-color 0.35s ease, color 0.35s ease;
}

/* Dark mode body background */
html[data-theme="dark"] body {
    background-color: var(--surface-0);
    background-image:
        radial-gradient(circle at 100% 0%, rgba(242, 15, 15, 0.07) 0%, transparent 60%),
        radial-gradient(circle at 0% 100%, rgba(242, 15, 15, 0.05) 0%, transparent 60%);
}

/* Restore transparent wrappers */
#page,
.site,
.site-content,
main#primary {
    background-color: transparent !important;
}

/* Remove Card Layout Styles - Cleaner Look */
.site-main .container,
.site-content .container,
.page-content,
.entry-content {
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
    /* padding: 0 wird auf Desktop gesetzt, aber auf Mobile überschrieben */
    padding-top: 0;
    padding-bottom: 0;
    /* Horizontales Padding explizit auf 0 für Desktop (Mobile-Breakpoints überschreiben) */
    padding-left: 0;
    padding-right: 0;
    margin-top: 0;
    margin-bottom: 0;
}

/* Ensure header stays white (dark mode override below) */
.site-header {
    background: var(--surface-nav);
    box-shadow: 0 4px 12px rgba(242, 15, 15, 0.08);
    transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

/* Specific wrappers handled above */

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.28s ease;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: var(--radius);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: var(--transition-base);
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-red);
}

/* Header */
.site-header {
    background: var(--surface-nav);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

html[data-theme="dark"] .site-header {
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
    border-bottom-color: var(--color-border);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
}

.custom-logo {
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

.site-title a {
    color: var(--primary);
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

/* Navigation & Dropdown */
.main-navigation ul li {
    margin-left: 20px;
    position: relative;
    display: flex;
    align-items: center;
}

.main-navigation ul li a {
    color: var(--color-text);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    display: block;
    padding: 10px 0;
    margin-right: 5px;
    transition: color 0.25s ease;
    /* Space for arrow */
}

/* Dropdown Arrow */
.main-navigation ul li.menu-item-has-children>a::after {
    content: '\f107';
    /* FontAwesome Angle Down */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-left: 8px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.main-navigation ul li.menu-item-has-children:hover>a::after {
    transform: rotate(180deg);
}

.main-navigation ul li a:hover {
    color: var(--primary);
}

/* Desktop Dropdown */
@media (min-width: 769px) {
    .main-navigation ul ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--surface-nav);
        box-shadow: var(--shadow-md);
        min-width: 220px;
        z-index: 999;
        border-radius: var(--radius-lg);
        padding: 10px 0;
        flex-direction: column;
        border-top: 3px solid var(--primary);
        border: 1px solid var(--color-border);
        border-top: 3px solid var(--primary);
        transition: background-color 0.35s ease;
    }

    .main-navigation ul li:hover>ul {
        display: flex;
        animation: fadeIn 0.2s ease;
    }

    .main-navigation ul ul li {
        margin: 0;
        display: block;
        border-bottom: 1px solid var(--color-border);
    }

    .main-navigation ul ul li:last-child {
        border-bottom: none;
    }

    .main-navigation ul ul li a {
        padding: 12px 20px;
        display: block;
        text-transform: none;
        font-size: 0.95rem;
        color: var(--color-text);
    }

    .main-navigation ul ul li a:hover {
        background: var(--surface-1);
        color: var(--primary);
        padding-left: 25px;
        transition: all 0.2s;
    }
}

/* Mobile Menu */
.menu-toggle {
    display: none;
}

/* =============================================
   DARK MODE TOGGLE BUTTON
   Premium Sun/Moon morph animation
   ============================================= */
.dark-mode-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--color-border);
    cursor: pointer;
    margin-left: 12px;
    padding: 0;
    position: relative;
    transition: background 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
    flex-shrink: 0;
    outline: none;
}

.dark-mode-toggle:hover {
    background: var(--kuk-red-light);
    border-color: rgba(242, 15, 15, 0.4);
    box-shadow: 0 0 16px var(--kuk-red-glow);
}

.dark-mode-toggle:focus-visible {
    outline: 2px solid var(--kuk-red);
    outline-offset: 3px;
}

.toggle-icon-wrap {
    position: relative;
    width: 20px;
    height: 20px;
}

/* SUN SVG */
.toggle-sun {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--kuk-red);
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
}

/* MOON SVG */
.toggle-moon {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    opacity: 0;
    transform: scale(0.4) rotate(-90deg);
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--kuk-red);
    stroke: none;
    fill: currentColor;
}

/* Dark mode state: show moon, hide sun */
html[data-theme="dark"] .toggle-sun {
    opacity: 0;
    transform: scale(0.4) rotate(90deg);
}

html[data-theme="dark"] .toggle-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Hide toggle on 404 page so it doesn't interfere with Flappy Bird aesthetic */
body.error404 .dark-mode-toggle {
    display: none !important;
}

/* Hero Section */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #fce4ec 0%, #ffffff 100%);
    /* Sbutle red tint */
    padding: 100px 0;
    text-align: center;
    overflow: hidden;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Confetti Animation Placeholder */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.confetti-particle {
    position: absolute;
    top: -10px;
    opacity: 0.8;
    animation: confetti-fall linear infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.hero-content {
    position: relative;
    z-index: 1;
}


/* Sections */
.section-padding {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin: 10px auto 0;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* Cards (Generic) */
.card,
.post-card,
.event-card,
.person-card {
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid var(--color-border);
}

.card:hover,
.post-card:hover,
.event-card:hover,
.person-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.card-title {
    margin-top: 0;
    font-size: 1.25rem;
}

/* Personnel Grid (Vorstand) */
.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.person-card img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 20px auto;
    border: 3px solid var(--primary);
}

.person-card .role {
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 10px;
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.group-card {
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid var(--color-border);
}

.group-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.group-card a {
    text-decoration: none;
    color: inherit;
}

.group-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.group-info {
    padding: 20px;
}

/* Events */
.bg-light {
    background: var(--surface-1);
}

.events-container {
    max-width: 800px;
    margin: 0 auto;
}

.event-card {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.event-date {
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    padding: 15px;
    text-align: center;
    min-width: 80px;
    flex-shrink: 0;
}

.event-date .day {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.event-date .month {
    display: block;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-top: 5px;
}

.event-details h3 {
    margin: 0 0 5px 0;
    color: var(--color-text);
}

/* Sponsors Grid */
.sponsors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    align-items: center;
    justify-items: center;
}

.sponsor-logo {
    padding: 20px;
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.32s ease;
    border: 1px solid var(--color-border);
}

.sponsor-logo:hover {
    transform: scale(1.06);
    box-shadow: var(--shadow-hover);
}

.sponsor-logo img {
    max-width: 100%;
    height: auto;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 2rem;
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-red);
    transform: translateY(-2px);
}

.read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-weight: 600;
    margin-top: 10px;
}

/* ── Page Header (global – alle Seiten außer Vorstandsbereich) ── */
.page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 20px 32px;
    margin-bottom: 32px;
    position: relative;
}

/* Kleines rotes Eyebrow-Label über dem Titel */
.page-header-eyebrow {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--kuk-red, #F20F0F);
    margin: 0 0 12px;
    opacity: 0.82;
    font-family: var(--font-heading, 'Roboto', sans-serif);
}

/* Haupttitel */
.page-header .page-title {
    font-size: clamp(2.6rem, 6vw, 3.8rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--color-text, #111);
    margin: 0;
    display: inline-block;
    position: relative;
}

/* Roter Akzent-Balken unter dem Titel */
.page-header .page-title::after {
    content: '';
    display: block;
    width: 68px;
    height: 4px;
    background: var(--kuk-red, #F20F0F);
    border-radius: 3px;
    margin: 14px auto 0;
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-header .page-title:hover::after {
    width: 100%;
}

/* Untertitel / Beschreibung */
.page-header-sub {
    font-size: 1.0rem;
    color: var(--color-text-2, #666);
    margin: 18px auto 0;
    max-width: 560px;
    line-height: 1.65;
    font-weight: 400;
}

/* Dark mode */
html[data-theme="dark"] .page-header .page-title {
    color: var(--color-text, #F0F0F8);
}

html[data-theme="dark"] .page-header-sub {
    color: var(--color-text-2, #A0A8C0);
}

html[data-theme="dark"] .page-header-eyebrow {
    opacity: 0.65;
}

/* ── Spacing corrections ───────────────────────────────────────────────────
   Ziel: Alle Seiten haben denselben visuellen Abstand wie "Unser Vorstand".

   Pattern A: .page-header nested inside .section-padding
   Die section-padding liefert bereits 60 px oben; der page-header braucht
   nur minimalen eigenen Top-Abstand.  margin-bottom auf 0 → gleicher
   Abstand wie Pattern B.
   ─────────────────────────────────────────────────────────────────────── */
.section-padding .page-header {
    padding-top: 12px;
    padding-bottom: 16px;
    margin-bottom: 0;           /* ← verhindert doppelten Abstand nach Heading */
}

/* ── Pattern B: .page-header.container directly before a content section ──
   padding-bottom (40) + margin-bottom (48) + next section's
   section-padding (60) = 148 px gap — far too much white space.
   Set padding-bottom and margin-bottom to zero; the following section's
   own section-padding (60 px) provides all the breathing room needed.
   ─────────────────────────────────────────────────────────────────────── */
.page-header.container {
    padding-top: 52px;    /* Einheitlicher Abstand zum Sticky-Header auf allen Seiten */
    padding-bottom: 16px;
    margin-bottom: 0;
}

/* ── Abstand nach Pattern-B-Heading: nächste Section nicht mit vollem
   section-padding beginnen, sonst entsteht 60px-Lücke nach der Überschrift ── */
.page-header.container + .section-padding,
.page-header.container + section {
    padding-top: 28px;
}

.page-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.header-login {
    margin-left: 20px;
}

.btn-login {
    background: var(--primary);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-login:hover {
    background: var(--primary-dark);
    color: white;
}

.entry-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.entry-excerpt {
    margin: 10px 0;
}


/* Footer */
.site-footer {
    background: #1A1A2E;
    color: rgba(240, 240, 248, 0.85);
    padding: 48px 0 24px;
    transition: background-color 0.35s ease;
}

html[data-theme="dark"] .site-footer {
    background: #090910;
    border-top: 1px solid var(--color-border);
}

.footer-widgets {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.site-info {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.9rem;
    color: rgba(240, 240, 248, 0.5);
}

.site-info a {
    color: rgba(240, 240, 248, 0.8);
    transition: color 0.25s ease;
}

.site-info a:hover {
    color: var(--kuk-red);
}

/* Hide mobile submenu toggle on desktop */
.submenu-toggle {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        color: var(--primary);
        border: 2px solid var(--primary);
        padding: 8px 15px;
        border-radius: 6px;
        cursor: pointer;
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.9rem;
        margin-left: auto;
        transition: all 0.2s ease;
    }

    .menu-toggle:hover,
    .menu-toggle:active {
        background: var(--primary);
        color: white;
    }

    /* Add Hamburger Icon using pseudo-element */
    .menu-toggle::before {
        content: '\f0c9';
        /* FontAwesome Hamburger Menu */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        margin-right: 8px;
        font-size: 1.1rem;
    }

    .menu-toggle[aria-expanded="true"]::before {
        content: '\f00d';
        /* FontAwesome JS Close X */
    }

    .main-navigation ul {
        display: none;
        flex-direction: column;
        background: var(--surface-nav);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        border-top: 3px solid var(--primary);
        transition: background-color 0.35s ease;
    }

    .main-navigation.toggled>div>ul,
    .main-navigation.toggled>ul {
        display: flex;
        animation: fadeInDown 0.3s ease;
    }

    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .main-navigation ul li {
        margin: 0;
        border-bottom: 1px solid var(--color-border);
        width: 100%;
    }

    .main-navigation ul li a {
        display: block;
        padding: 15px 20px;
        width: 100%;
        color: var(--color-text);
    }

    /* Submenu handling on mobile */
    .main-navigation ul li.menu-item-has-children {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-navigation ul li.menu-item-has-children>a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex: 1;
        /* Take up available space */
    }

    /* Submenu Accordion Toggle Button */
    .submenu-toggle {
        display: block !important;
        background: transparent;
        border: none;
        color: var(--primary);
        font-size: 1.2rem;
        padding: 15px 20px;
        position: absolute;
        right: 0;
        top: 0;
        cursor: pointer;
        transition: transform 0.3s ease;
    }

    .menu-item-has-children.submenu-open>.submenu-toggle {
        transform: rotate(180deg);
    }

    .main-navigation ul li ul {
        position: static;
        box-shadow: none;
        display: none;
        background: var(--surface-1);
        border-top: 1px solid var(--color-border);
        width: 100%;
    }

    /* Override hover for mobile - use JS class instead */
    .main-navigation ul li:hover>ul {
        display: none;
    }

    .main-navigation ul li.submenu-open>ul {
        display: flex;
        animation: fadeInDown 0.2s ease;
    }

    .main-navigation ul li ul li a {
        padding-left: 40px;
        /* Indent submenus */
        font-size: 0.85rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .header-container {
        flex-wrap: wrap;
    }

    .header-login {
        margin: 10px 0 0 0;
        width: 100%;
        text-align: center;
    }

    .news-grid,
    .groups-grid {
        grid-template-columns: 1fr;
    }

    .event-card {
        flex-direction: column;
        text-align: center;
    }

    /* ── Globaler Seitenabstand: Content klebt nicht am Rand ──
       Beide Selektoren nötig: .container allein hat weniger Spez. als
       .site-main .container aus dem Cleaner-Look-Block oben. */
    .container,
    .site-main .container,
    .site-content .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* ── Page-Header: etwas weniger Abstand zum Menü auf Tablets ── */
    .page-header.container {
        padding-top: 40px;
    }

    /* ── Page-Header-Titel: kleinere Schrift auf Tablets ── */
    .page-header .page-title {
        font-size: clamp(2.0rem, 5vw, 2.8rem);
    }

    /* ── Weniger section-padding oben/unten auf mobilen Geräten ── */
    .section-padding {
        padding: 40px 0;
    }
}

/* =========================================
   PHASE 17: PREMIUM HOMEPAGE STYLES
   ========================================= */

/* Premium Hero */
.hero-premium {
    position: relative;
    min-height: 85vh;
    /* Almost full screen */
    background: radial-gradient(circle at top right, #fff0f0 0%, #fff 40%, #f0f4ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 80px;
    /* Space for header */
}

/* Animated Gradient Overlay */
.hero-bg-overlay {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(242, 15, 15, 0.05) 0%, transparent 60%);
    animation: rotateBg 60s linear infinite;
    z-index: 0;
}

@keyframes rotateBg {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.hero-container {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    padding: 20px;
}

.hero-badge {
    display: inline-block;
    background: rgba(211, 47, 47, 0.1);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 20px;
    letter-spacing: 1px;
    backdrop-filter: blur(5px);
}

.hero-title-large {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(45deg, var(--text) 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.hero-description {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 15px 35px;
    font-size: 1.1rem;
}

/* Glass Floating Cards (Navigation) */
.glass-nav-container {
    position: relative;
    z-index: 10;
    margin-top: -60px;
    /* Overlap Hero */
    margin-bottom: 60px;
}

.glass-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s ease,
                background 0.35s ease,
                border-color 0.35s ease;
    text-decoration: none;
    color: var(--color-text);
    display: block;
}

.glass-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.92);
    border-color: var(--primary);
    color: var(--color-text);
}

/* Dark mode glass cards */
html[data-theme="dark"] .glass-card {
    background: rgba(28, 28, 46, 0.82);
    border-color: var(--color-border);
    color: var(--color-text);
}

html[data-theme="dark"] .glass-card:hover {
    background: rgba(28, 28, 46, 0.96);
    border-color: rgba(242, 15, 15, 0.45);
}

.glass-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary);
    background: rgba(211, 47, 47, 0.1);
    width: 70px;
    height: 70px;
    line-height: 70px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
    transition: transform 0.3s ease;
}

.glass-card:hover .glass-icon {
    transform: scale(1.1) rotate(10deg);
    background: var(--primary);
    color: white;
}

.glass-title {
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
}

/* Content Hub (News & Events) */
.content-hub-section {
    padding: 80px 0;
    background: var(--surface-0);
    transition: background-color 0.35s ease;
}

.hub-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    /* News wider than Events */
    gap: 50px;
}

@media (max-width: 991px) {
    .hub-grid {
        grid-template-columns: 1fr;
    }
}

.hub-column h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
}

.hub-column h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

/* Modern News Card */
.news-card-modern {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-start;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.news-card-modern:last-child {
    border-bottom: none;
}

html[data-theme="dark"] .news-card-modern {
    border-bottom-color: var(--color-border);
}

html[data-theme="dark"] .news-content h3 a {
    color: var(--color-text);
}

html[data-theme="dark"] .news-content h3 a:hover {
    color: var(--kuk-red);
}

.news-thumb {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.news-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
}

.news-content h3 a {
    color: var(--text);
}

.news-content h3 a:hover {
    color: var(--primary);
}

.news-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

/* Modern Event List */
.event-list-modern {
    background: var(--surface-1);
    padding: 30px;
    border-radius: 16px;
    transition: background-color 0.35s ease;
}

.event-item-modern {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.event-item-modern:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.event-date-box {
    text-align: center;
    background: var(--surface-2);
    padding: 10px;
    border-radius: 8px;
    min-width: 60px;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.35s ease;
}

.event-date-box .day {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary);
}

.event-date-box .month {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-light);
}

.event-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

.event-info h4 a {
    color: var(--color-text);
}

.event-info h4 a:hover {
    color: var(--primary);
}

.event-meta-small {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Sponsors Ticker */
.sponsors-ticker-section {
    padding: 40px 0;
    background: var(--surface-0);
    overflow: hidden;
    border-top: 1px solid var(--color-border);
    transition: background-color 0.35s ease;
}

.ticker-wrap {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.ticker-move {
    display: inline-block;
    animation: ticker 30s linear infinite;
}

.ticker-item {
    display: inline-block;
    padding: 0 40px;
    vertical-align: middle;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.ticker-item:hover {
    opacity: 1;
}

.ticker-item img {
    max-height: 50px;
    width: auto;
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .hero-title-large {
        font-size: 2.5rem;
    }

    .hero-premium {
        min-height: auto;
        padding: 120px 0 80px 0;
    }

    .glass-nav-container {
        margin-top: 0;
    }

    .news-card-modern {
        flex-direction: column;
    }

    .news-thumb {
        width: 100%;
        height: 180px;
    }
}

/* =========================================
   MOBILE: TOUCH TARGETS & SMALL SCREENS
   ========================================= */

/* Ensure minimum 44px touch targets on mobile */
@media (max-width: 768px) {
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-login,
    .read-more-link,
    .footer-links a,
    .footer-social a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .main-navigation ul li a {
        min-height: 44px;
    }

    .submenu-toggle {
        min-width: 44px;
        min-height: 44px;
    }
}

/* =============================================
   DARK MODE MOBILE NAVIGATION OVERRIDES
   ============================================= */
@media (max-width: 768px) {
    html[data-theme="dark"] .menu-toggle {
        border-color: var(--kuk-red);
        color: var(--kuk-red);
    }

    html[data-theme="dark"] .menu-toggle:hover,
    html[data-theme="dark"] .menu-toggle:active {
        background: var(--kuk-red);
        color: white;
    }

    /* Dark mode toggle repositioning on mobile */
    .dark-mode-toggle {
        margin-left: 8px;
        width: 38px;
        height: 38px;
    }
}

/* Very small screens (480px) */
@media (max-width: 480px) {
    .container,
    .site-main .container,
    .site-content .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .page-header.container {
        padding-top: 32px;
    }

    .page-header .page-title {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
    }

    .section-padding {
        padding: 32px 0;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .hero-title-large {
        font-size: 2rem;
    }

    .glass-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .glass-card {
        padding: 15px 10px;
    }

    .glass-icon {
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 1.8rem;
    }

    .glass-title {
        font-size: 0.9rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn-lg {
        width: 100%;
        text-align: center;
    }

    .person-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}