/* ==========================================================================
   1. VARIABLEN & BASIS
   ========================================================================== */
:root {
    --iron-red: #e30613;
    --iron-black: #1a1a1a;
    --iron-white: #ffffff;
}

/* ==========================================================================
   2. HERO SEKTION
   ========================================================================== */
.iron-event-wrapper {
    position: relative;
}

.iron-hero {
    height: 75vh;
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    overflow: hidden;
}

.iron-hero h1 {
    font-size: 4rem;
    text-transform: uppercase;
    font-weight: 900;
    margin: 20px 0;
    letter-spacing: -1px;
}

/* Hero Slant mit clip-path, pointer-events none, blockiert keine Nav */
.iron-slant {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: var(--iron-white);
    clip-path: polygon(0% 100%, 100% 0%, 100% 100%, 0% 100%);
    z-index: 2;
    pointer-events: none; /* Klicks durchlassen */
}

/* ==========================================================================
   3. RACE NAVIGATION (STICKY)
   ========================================================================== */
.iron-race-nav {
    background: var(--iron-white);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: sticky !important;
    top: 0; /* FIX: Von 70px auf 0 gesetzt, um den Spalt beim Scrollen zu entfernen */
    z-index: 999999 !important; /* Extrem hoch */
    pointer-events: auto !important; /* Erzwingt Klickbarkeit */
    padding: 15px 0;
}

.iron-nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.iron-nav-scroll {
    flex: 1; /* Nimmt verfügbaren Platz links ein */
    overflow-x: auto;
    /* FIX: overflow-y MUSS visible sein, damit Dropdowns nicht abgeschnitten werden */
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    position: relative; /* Bezugspunkt für Dropdown */
}

.iron-nav-scroll::-webkit-scrollbar {
    display: none; /* Chrome */
}

.iron-nav-items {
    display: flex;
    align-items: center;
    gap: 20px;
    white-space: nowrap;
    padding: 0 10px;
}

.iron-nav-items a,
.iron-dropdown-trigger {
    text-decoration: none;
    color: var(--iron-black);
    font-weight: 800;
    text-transform: uppercase;
    border-bottom: 3px solid transparent;
    transition: 0.3s;
    font-size: 0.9rem;
    flex-shrink: 0;
    pointer-events: auto !important;
    cursor: pointer !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.iron-nav-items a:hover,
.iron-nav-items a.active,
.iron-nav-dropdown:hover .iron-dropdown-trigger {
    border-color: var(--iron-red);
    color: var(--iron-red);
}

.iron-cta-btn {
    background: var(--iron-red);
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 2px;
    flex-shrink: 0; /* Verhindert das Schrumpfen des Buttons */
    margin-left: 15px;
}

/* ==========================================================================
   4. CONTENT & TYPOGRAFIE
   ========================================================================== */
.iron-main-content { padding-top: 0px; }

.iron-section {
    padding-top: 10px !important; /* Erzwingt einen geringeren Abstand der Sektion nach oben */
    padding-bottom: 10px !important; /* Verringert den Abstand nach unten */
}

.iron-section h2 {
    font-size: 2.5rem;
    text-transform: uppercase;
    margin-bottom: 5px;
    margin-top: 0px;
    line-height: 1.1;
}

.iron-text {
    font-family: 'Open Sans', Arial, sans-serif;
    line-height: 1.8;
    color: #333;
    font-size: 1.1rem;
    text-align: justify;
    hyphens: auto;
}

.iron-text::first-letter {
    float: left;
    font-size: 4rem;
    line-height: 0.8;
    margin: 8px 12px 0 0;
    color: var(--iron-red);
    font-weight: 900;
    text-transform: uppercase;
}

.iron-text p { margin-bottom: 25px; }

.iron-text h3 {
    text-transform: uppercase;
    font-weight: 900;
    color: var(--iron-black);
    border-left: 5px solid var(--iron-red);
    padding-left: 15px;
    margin: 40px 0 20px 0;
}

/* ==========================================================================
   5. GRID SYSTEM (DESKTOP)
   ========================================================================== */
.iron-grid {
    display: grid;
    grid-template-columns: 1fr; /* Standard: Einspaltig für Mobile */
    gap: 30px;
}

/* Ab Tablet/Desktop nebeneinander */
@media (min-width: 992px) {
    .iron-grid {
        grid-template-columns: 2fr 1fr;
        gap: 50px;
    }
}

/* ==========================================================================
   6. SIDEBAR & CARDS
   ========================================================================== */
.iron-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.iron-card {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-top: 4px solid var(--iron-black);
}

.iron-card.cta-card {
    border-top-color: var(--iron-red);
    background: #fff;
    padding: 20px;
    text-align: center;
}

.card-header {
    background: var(--iron-black);
    color: #fff;
    padding: 10px 15px;
    text-transform: uppercase;
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.card-body { padding: 15px; }

.fact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.fact-item i { color: var(--iron-red); width: 20px; text-align: center; }

.status-badge {
    display: inline-block;
    padding: 5px 15px;
    background: #28a745;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-bottom: 15px;
}

.iron-btn-full {
    display: block;
    background: var(--iron-red);
    color: #fff;
    padding: 12px;
    text-decoration: none;
    font-weight: 900;
    text-transform: uppercase;
    margin-top: 10px;
    transition: 0.3s;
}

.iron-btn-full:hover { background: #b30510; }

/* Downloads */
.iron-link-wrapper { display: flex; flex-direction: column; }

.iron-download-link {
    display: flex;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: var(--iron-black);
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease-in-out;
    background: #fff;
}

.iron-download-link:last-child { border-bottom: none; }

.iron-download-link .icon-box {
    font-size: 1.5rem;
    color: #999;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.iron-download-link .text-box { display: flex; flex-direction: column; flex-grow: 1; }
.iron-download-link .label { font-weight: 800; text-transform: uppercase; font-size: 0.9rem; }
.iron-download-link .sub-label { font-size: 0.75rem; color: #777; }
.iron-download-link .arrow { font-size: 0.8rem; color: #ccc; transition: 0.2s; }

.iron-download-link:hover { background: #fdfdfd; padding-left: 20px; }
.iron-download-link:hover .icon-box,
.iron-download-link:hover .arrow { color: var(--iron-red); }

/* ==========================================================================
   7. RACE FACTS / BEWERBE SPECIFIC
   ========================================================================== */
.race-facts-grid { display: grid; gap: 20px; }
.iron-race-facts-wrapper { display: flex; flex-direction: column; gap: 20px; margin-top: 30px; }

.race-fact-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #eee;
}

.race-fact-card .card-header { background: #e30613; }

.race-fact-card .race-fact-body {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

/* ==========================================================================
   8. MEDIA QUERIES (MOBILE)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Den äußeren Container zwingen, Platz zu machen */
    .iron-race-nav {
        display: block !important;
        padding: 10px 0 !important;
        height: auto !important;
        min-height: 50px;
        position: sticky !important;
        top: 0 !important; /* FIX: Kein Spalt auf Mobile */
    }

    .iron-nav-flex {
        display: flex !important;
        flex-direction: row !important; /* Nebeneinander behalten */
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 5px;
    }

    /* 2. Den Scroll-Bereich stabilisieren */
    .iron-nav-scroll {
        display: block !important;
        flex: 1 1 auto; /* Nimmt den Platz ein, den der CTA lässt */
        overflow-x: auto !important;
        overflow-y: visible !important; /* Wichtig für Dropdowns auf Mobile */
        -webkit-overflow-scrolling: touch;
        min-width: 50px; /* Verhindert das Kollabieren auf 0px */
    }

    /* 3. Die Items vor dem Schrumpfen schützen */
    .iron-nav-items {
        display: flex !important;
        flex-direction: row !important;
        gap: 15px;
        padding: 5px 10px;
    }

    .iron-nav-items a,
    .iron-dropdown-trigger {
        display: inline-block !important;
        flex-shrink: 0 !important; /* Extrem wichtig: Verhindert Breite 0 */
        font-size: 13px !important;
        padding: 10px 5px !important;
        color: var(--iron-black) !important;
    }

    /* 4. Den CTA Button sichtbar halten */
    .iron-cta-btn {
        flex-shrink: 0 !important;
        padding: 8px 10px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
        margin-left: 5px;
    }

    /* Race Facts Mobile */
    .race-fact-card .race-fact-body { grid-template-columns: 1fr; }

    .iron-main-content {
        padding: 40px 15px; /* Etwas weniger Padding auf Mobile */
    }

    .iron-text {
        text-align: left; /* Blocksatz sieht auf schmalen Handys oft unschön aus */
    }

    .iron-sidebar {
        margin-top: 20px; /* Abstand zur Beschreibung, wenn sie darunter rutscht */
    }

    .iron-hero h1 {
        font-size: 2.5rem; /* Hero-Text verkleinern, damit er nicht bricht */
    }
}

/* Strecken-Layout */
.iron-bewerb-title {
    font-size: 2rem;
    color: var(--iron-black);
    border-bottom: 4px solid var(--iron-red);
    display: inline-block;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.track-main-desc {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #444;
}

.iron-discipline-box {
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.discipline-header {
    background: #f4f4f4;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #eee;
}

.discipline-header i {
    color: var(--iron-red);
    font-size: 1.5rem;
}

.discipline-header h4 {
    margin: 0;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
}

.discipline-content {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Text links, Map rechts */
}

.discipline-text {
    padding: 25px;
    font-size: 0.95rem;
    line-height: 1.6;
    background: #fff;
}

.map-wrapper {
    background: #eee;
    min-height: 400px;
}

/* Mobile Optimierung */
@media (max-width: 992px) {
    .discipline-content {
        grid-template-columns: 1fr; /* Stacked auf Mobile */
    }
    .map-wrapper {
        order: -1; /* Map über dem Text auf Handy */
    }
}

/* ==========================================================================
   9. DROPDOWN STYLING (VERBESSERT)
   ========================================================================== */
.iron-nav-dropdown {
    position: relative;
    display: inline-block;
}

.iron-dropdown-trigger {
    color: var(--iron-black);
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

/* Das Menü */
.iron-dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 200px;
    box-shadow: 0px 8px 25px rgba(0,0,0,0.1);
    border-top: 3px solid var(--iron-red);
    z-index: 9999999;
    top: 100%;
    left: 0;
}

/* Links im Dropdown */
.iron-dropdown-content a {
    color: #444 !important;
    padding: 12px 20px !important;
    text-decoration: none;
    display: block !important;
    text-transform: none !important;
    font-size: 0.95rem !important;
    border-bottom: 1px solid #f5f5f5 !important;
    transition: all 0.2s ease;
    font-weight: 600 !important;
}

.iron-dropdown-content a:last-child {
    border-bottom: none !important;
}

.iron-dropdown-content a:hover {
    background-color: #f9f9f9;
    color: var(--iron-red) !important;
    padding-left: 25px !important;
}

/* Hover-Logik Desktop */
@media (min-width: 769px) {
    .iron-nav-dropdown:hover .iron-dropdown-content {
        display: block !important;
    }
}

/* Active Status im Dropdown */
.iron-dropdown-content a.active {
    background-color: #f0f0f0;
    color: var(--iron-red) !important;
    font-weight: bold !important;
}

/* ==========================================================================
   10. MOBILE DROPDOWN FIX
   ========================================================================== */
@media (max-width: 768px) {
    /* Verhindert Abschneiden des Dropdowns im Scroll-Container */
    .iron-nav-scroll {
        overflow-x: auto;
        overflow-y: visible !important;
    }

    .iron-nav-dropdown:active .iron-dropdown-content,
    .iron-nav-dropdown:focus .iron-dropdown-content {
        display: block;
    }

    .iron-dropdown-content {
        position: fixed; /* Bessere Stabilität auf Mobile */
        left: 10px;
        right: 10px;
        min-width: calc(100% - 20px);
        top: 60px; /* FIX: Angepasst an die Nav-Höhe ohne Spalt */
        z-index: 1000001;
    }
}
