/* --- 1. GRUNDLAGEN & VARIABLEN --- */
:root {
    --bahn-rot: #b22222; 
    --dunkel: #2c3e50;
    --hintergrund: #fdfdfd;
    --text: #333;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--hintergrund);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- 2. HEADER & NAVIGATION --- */
header {
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), 
                url('bilder/2025-05-12-140909.jpg') no-repeat center center/cover;
    height: 25vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

header h1 { font-size: 3rem; margin: 0; text-shadow: 2px 2px 10px rgba(0,0,0,0.5); }

nav {
    background-color: var(--dunkel);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0;
}

nav ul {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 15px;
    transition: 0.3s;
}

nav a:hover, nav a.active {
    background-color: var(--bahn-rot);
    border-radius: 5px;
}

/* --- 3. LAYOUT-CONTAINER --- */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

h2 { color: var(--bahn-rot); border-bottom: 2px solid var(--bahn-rot); padding-bottom: 10px; }

/* --- 4. AKTUELLES (Flex-Layout) --- */
.content-flex {
    display: flex;
    gap: 40px;
    align-items: center; /* Vertikal zentriert */
    margin-top: 30px;
    flex-wrap: wrap;
}

.flex-bild { flex: 0 0 550px; } /* Vergrößertes Bild */
.flex-text { flex: 1; }

/* --- 5. RASTER-SYSTEME (Galerie & Links) --- */
.anlage-galerie, .link-grid {
    display: grid;
    gap: 25px;
    margin-top: 30px;
}

.anlage-galerie { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.link-grid { grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); }

/* Galerie-Karten */
.anlage-galerie figure { margin: 0; border-radius: 12px; overflow: hidden; background: #eee; }
.anlage-galerie img {
    width: 100%; height: 220px; object-fit: cover; display: block;
    transition: transform 0.3s ease;
}
.anlage-galerie figure:hover img { transform: scale(1.05); }

/* Link-Kacheln */
.link-item {
    padding: 25px; display: flex; flex-direction: column; border-radius: 12px;
    background: white; border: 1px solid #eee; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: 0.3s; text-decoration: none !important;
}
.link-item:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

.link-item strong, .link-item:visited strong {
    color: var(--bahn-rot) !important; font-size: 1.2rem; display: block; margin-bottom: 8px;
}
.link-item span, .link-item:visited span { color: var(--text) !important; }

.link-content { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.link-logo {
    width: 80px;            /* Einheitliche Breite für alle Logos */
    height: auto;           /* Proportionale Höhe (wichtig für runde Logos) */
    margin-left: 15px;      /* Abstand zum Text links */
    align-self: flex-start; /* Fixiert das Logo oben rechts in der Kachel */
    border-radius: 4px;     /* Dezente Rundung der Ecken */
}

/* --- 6. TERMINE --- */
.termin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px; margin-top: 30px;
}

.termin-card {
    display: flex; padding: 20px; gap: 20px; background: white;
    border-radius: 12px; border: 1px solid #eee; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.termin-plakat {
    width: 150px; height: auto; border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.termin-card:hover .termin-plakat {
    transform: scale(1.05); box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* --- 7. SPEZIAL-ELEMENTE (Anlage) --- */
.veranstalter-box {
    background-color: #f2f2f2; padding: 30px; border-radius: 12px;
    border-left: 5px solid var(--bahn-rot); margin: 30px 0;
}

.pdf-hover-container a img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #ddd;
}

.pdf-hover-container a:hover img { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }

.gesamtansicht-link img { transition: 0.3s ease; }
.gesamtansicht-link:hover img { transform: scale(1.02); box-shadow: 0 8px 25px rgba(0,0,0,0.2) !important; }

/* --- 8. FOOTER & RESPONSIVE --- */
footer { text-align: center; padding: 60px 20px; color: #888; border-top: 1px solid #eee; margin-top: 40px; }
.footer-logos { display: flex; justify-content: center; align-items: center; gap: 40px; margin-bottom: 20px; }
.footer-logo-img { height: 100px; width: auto; }

@media (max-width: 1100px) { .flex-bild { flex: 0 0 450px; } }

@media (max-width: 768px) {
    header h1 { font-size: 2rem; }
    .flex-bild { flex: 1 1 100%; }
    .termin-grid { grid-template-columns: 1fr; }
    .termin-card { flex-direction: column; }
    .termin-plakat { width: 100%; }
}

/* --- 9. FIX FÜR VERANSTALTUNGS-KACHELN (Farbe & Layout) --- */

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* Fixiert die Farbe für Kacheln in veranstaltungen.html */
.event-kachel, .event-kachel:visited {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none !important;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    transition: all 0.2s ease;
    color: var(--text) !important; /* Verhindert das Umspringen auf Violett */
}

.event-kachel:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-color: var(--bahn-rot);
}

.event-kachel img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    background: #fdfdfd;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.event-kachel-text { padding: 15px; }

.event-kachel-text strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 8px;
    color: var(--bahn-rot) !important; /* Bleibt Rot */
}

.event-kachel-text span {
    color: var(--text) !important; /* Bleibt Schwarz/Dunkelgrau */
}

/* --- 10. ERGÄNZUNGEN FÜR KONSISTENZ --- */

/* Damit alle Überschriften im Inhaltsbereich automatisch rot sind */
.container h2, .container h3 {
    color: var(--bahn-rot);
}

/* Die Boxen für die Zeitschriftenberichte */
.bericht-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid #eee;
    display: flex;
    gap: 20px;
    align-items: center;
}

.bericht-img {
    max-width: 120px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
/* NEU: Vorbereitung für den Effekt */
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* NEU: Der Hover-Effekt */
.bericht-img:hover {
    transform: scale(1.05);
    opacity: 0.8;
    cursor: pointer;
}

/* Falls wir Pläne oder Grafiken (wie aus dem PDF) zeigen */
.planung-grafik {
    text-align: center;
    margin: 20px 0;
}

/* --- 11. FUHRPARK / FAHRZEUG-KARTEN --- */

.fuhrpark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin: 20px 0 40px 0;
}

.fahrzeug-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.fahrzeug-info {
    padding: 15px;
    flex-grow: 1;
}

.fahrzeug-info h4 {
    margin-top: 0;
    color: var(--bahn-rot);
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.fahrzeug-galerie {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 10px;
    background: #f4f4f4;
}

.fahrzeug-galerie img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    border-radius: 2px;
    transition: opacity 0.2s;
}

.fahrzeug-galerie img:hover {
    opacity: 0.8;
}

/* Trenner für die Kategorien */
.kategorie-titel {
    margin-top: 50px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--bahn-rot);
}

/* Container für eine Zeile in der Galerie */
.galerie-zeile {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 5px 10px;
}

/* Kleine dezente Beschriftung über den Bildern */
.galerie-label {
    font-size: 0.75rem;
    color: #777;
    padding: 10px 10px 0 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Den Hintergrund der Galerie etwas anpassen */
.fahrzeug-galerie-neu {
    background: #f4f4f4;
    border-top: 1px solid #eee;
}

/* Hover-Effekt für die neuen Galerie-Zeilen */
.galerie-zeile img {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.galerie-zeile img:hover {
    opacity: 0.7;
    transform: scale(1.05); /* Das leichte Vergrößern */
    cursor: pointer;
}

/* Ändert die Richtung für jeden ZWEITEN content-flex Block */
.content-flex:nth-of-type(2n) {
    flex-direction: row-reverse;
}

/* Fix für Mobilgeräte: Untereinander statt nebeneinander */
@media (max-width: 768px) {
    .content-flex:nth-of-type(2n) {
        flex-direction: column;
    }
}