/* ========================================================================== */
/* --- CSS RESET UND GRUNDLAGEN --- */
/* ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Modernes Box-Modell */
}
html, body {
    height: 100%;
}
body {
    font-family: Arial, Helvetica, sans-serif; /* Beibehalten der gewünschten Schriftart */
    font-size: 13px;
    line-height: 1.6;
    color: #000;
    background: #FFF;
}
body.black {
    background: black;
    color: white;
}
strong {
    font-weight: bold;
}
a {
    color: inherit;
    text-decoration: none;
}
ul, ol {
    list-style: none;
}

/* ========================================================================== */
/* --- DESKTOP-LAYOUT (Basis 960px) --- */
/* ========================================================================== */
#container {
    width: 960px;
    margin: 0 auto;
}

/* --- HEADER / NAVIGATION --- */
#main-header {
    width: 960px;
    margin: 0 auto;
}
#additionalHead ul {
    float: right;
    line-height: 25px;
    font-size: 11px;
    padding: 25px 0 0 0; 
}
#additionalHead ul li {
    float: left;
    margin-left: 20px;
}

#head-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100px;
}
#logo {
    display: block;
    text-indent: -9999px;
    width: 300px;
    height: 100px;
    background: url(../images/buender-kurzfilmfestival-logo.jpg) top left no-repeat; 
    background-size: contain; 
}



#theme-nav {
    display: flex;
    justify-content: space-between; /* Links/Rechts Ausrichtung */
    align-items: center;
    height: 35px;
    border-bottom: 2px solid #EEE;
    margin-bottom: 25px; 
    padding-bottom: 2px;
}
#theme-nav ul {
    /* Setzt die Hauptmenüpunkte nebeneinander */
    display: flex;
    align-items: center;
}
#theme-nav ul li {
    line-height: 35px;
}
#theme-nav ul li a {
    margin-right: 20px;
    font-size: 16px;
}
#social-links li {
    display: inline-block;
    margin-left: 20px;
    font-size: 18px;
}


/* --- MAIN IMAGE / BANNER --- */
#mainImageContainer {
    width: 960px;
    /* FIX: Höhe beibehalten und overflow entfernen, um das Bild ganz zu zeigen */
    height: 340px; 
}
#mainImage {
    height: 340px;
    background: black url(../images/BKF_website.jpg) top center no-repeat;
    background-size: cover;
}
#mainImage img {
    /* Bild ist in der Tat das Banner */
    width: 960px;
    height: 340px;
    object-fit: cover;
}


/* --- CONTENT --- */
#content {
 
    background: white;
    /* FIX: Die seitlichen Linien entfernen, indem der Border entfernt wird */
    /* border: 1px solid #CCC; */ 
    padding: 20px;
    margin-bottom: 30px;
    width: 960px;
    margin-left: auto;
    margin-right: auto;
    /* Optional: Ein leichter Schatten für den "Schwebenden" Effekt ohne Border */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); 
}

/* --- INHALT STYLING --- */
.content-section {
    margin-bottom: 30px;
    padding-bottom: 10px;
}
#content h2 {
    
/* NEU: Schriftart und Stärke für Open Sans Extrabold */
    font-family: 'Open Sans', Arial, sans-serif; 
    font-weight: 800; /* Dies ist der Wert für ExtraBold */

    font-size: 26px;
    border-bottom: 2px solid #EEE;
    padding-bottom: 5px;
    margin-bottom: 10px;
}
#content h3 {
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 5px;
}
.full-width-text {
    width: 100%;
}
.full-width-text p {
    margin-bottom: 10px;
}

/* CSS GRID FÜR 2-SPALTIGES LAYOUT */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 40px; /* etwas größerer Abstand für bessere Lesbarkeit */
}
/* ========================================================================== */
/* --- ARCHIV/GALERIE STYLING --- */
/* ========================================================================== */

/* Definiert das Layout für das Archiv */
.two-col-grid-archiv {
    /* Nutzt CSS Grid für eine stabile 2-Spalten-Struktur */
    display: grid;
    /* Definiert: 150px für das Bild, der Rest für den Text (1fr) */
    grid-template-columns: 150px 1fr; 
    gap: 20px; /* Abstand zwischen Bild und Text */
    margin-bottom: 40px;
}

/* Stilisiert die Überschriften (h3) über dem Grid */
.two-col-grid-archiv h3 {
    /* Spannt die Überschrift über beide Spalten */
    grid-column: 1 / span 2; 
    border-bottom: 1px solid #CCC;
    padding-bottom: 5px;
    margin-top: 10px;
}

/* Stellt sicher, dass das Bild die volle Breite seiner kleinen Spalte einnimmt */
.two-col-grid-archiv .archiv-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Anpassung für mobile Geräte: Alle Elemente werden untereinander gestapelt */
@media screen and (max-width: 700px) {
    .two-col-grid-archiv {
        /* Setzt die Spalten wieder auf eine einzige, volle Breite */
        grid-template-columns: 1fr;
        gap: 15px; 
    }
    
    /* Stellt sicher, dass h3 auch hier volle Breite nimmt */
    .two-col-grid-archiv h3 {
        grid-column: 1 / span 1; 
    }
    
    /* Zentriert den DIV-Container, der das Bild hält (optional, aber gut für Konsistenz) */
    .two-col-grid-archiv div { 
        text-align: left;
    }
    
    .two-col-grid-archiv .archiv-img {
        max-width: 50%; 
        /* NEU: Zentriert das Bild selbst (durch das Setzen von Rändern) */
        margin: 0 auto;
        display: block; /* Wichtig, damit margin: auto funktioniert */
    }
}


/* Spezifisches Grid für Termine/Karte */
.two-col-grid-map {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
.map-container iframe {
    width: 100%; 
    height: 300px;
    border: 1px solid #CCC;
}


/* --- BILDER --- */
/* Standard-Bilder-Styling (für universum-buende.php) */
.floatright {
    float: right;
    margin: 10px 0 10px 20px;
}

/* ========================================================================== */
/* ######################### RESPONSIVE DESIGN ############################ */
/* ========================================================================== */
@media screen and (max-width: 960px) {
    
    /* --- Globale Container --- */
    #container, #main-header, #mainImageContainer, #content {
        width: 100% !important;
        padding: 0 15px; 
        margin-left: 0;
        margin-right: 0;
        box-shadow: none; /* Schatten auf Mobile entfernen */
    }
    
    /* Text schiebt sich NICHT über das Banner auf Mobile */
    #content {
        margin-top: 20px !important; 
        padding: 10px;
    }

    /* --- Header / Navigation (Stapelung) --- */
    #additionalHead ul {
        float: none;
        width: 100%;
        text-align: center;
        padding: 10px 0 0 0;
    }
    #additionalHead ul li {
        float: none;
        display: inline-block;
        margin: 0 5px;
    }
    
    #head-nav {
        flex-direction: column; 
        height: auto;
    }
    #logo {
        margin: 10px auto;
    }

    /* FIX: Theme-Nav und Social Media jetzt vertikal gestapelt und zentriert */
    #theme-nav {
        flex-direction: column; 
        height: auto;
        padding: 10px 0;
        margin-bottom: 15px;
    }
    #theme-nav ul {
        flex-direction: column;
        align-items: center;
        padding-bottom: 10px; /* Abstand zur Social Media Liste */
    }
    #theme-nav ul li {
        line-height: 1.5;
        margin-bottom: 5px;
    }
    #social-links {
        width: 100%;
        text-align: center;
        line-height: 1.5;
        padding-top: 10px;
        border-top: 1px solid #EEE; /* Optische Trennung der Navis */
    }
    #social-links li {
        margin: 0 10px;
    }

    /* --- Main Image --- */
    #mainImageContainer {
        height: 200px !important; 
        padding: 0;
    }
    #mainImage, #mainImage img {
        height: 100% !important;
        width: 100% !important;
        object-fit: cover;
    }
    
    /* --- Grid-Layouts werden zu einer Spalte --- */
    .two-col-grid,
    .two-col-grid-map {
        grid-template-columns: 1fr; 
        gap: 20px;
    }
    
    /* --- Bilder-Fix (70% und linksbündig) --- */
    #content img, 
    .floatright, 
    .floatleft {
        max-width: 70% !important; 
        height: auto;
        float: none !important; 
        display: block; 
        margin: 10px auto 10px 0; 
    }

    /* --- Karte (iFrame) --- */
    .map-container iframe {
        width: 100% !important;
        height: 250px; 
    }
    
}

/* --- NEUE STYLES FÜR SOCIAL ICONS --- */

/* Versteckt den Text für das Icon-Element, aber lässt es für Screenreader */
#social-links .social-item a .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap; 
    border-width: 0;
}

/* Styling für das Icon-Bild selbst */
#social-links .social-icon {
    width: 25px;   /* Gewünschte Größe */
    height: 25px;
    vertical-align: middle; /* Stellt das Bild mittig zur Text-Basislinie */
    opacity: 0.8;
    transition: opacity 0.2s;
}

#social-links .social-item a:hover .social-icon {
    opacity: 1.0; /* Heller beim Hover */
}

/* Passt das Layout der Liste an, damit die Youtube-Liste und das Icon nebeneinander stehen */
#social-links li {
    line-height: 25px; /* Anpassung an die Icon-Höhe */
    margin-left: 15px;
    /* Entfernt die bisherige font-size: 18px, damit die Schrift des Youtube-Links normal ist */
    font-size: 13px; 
}

/* --- 8. GALERIE SLIDER (CSS Scroll Snap) --- */

.image-carousel {
    display: flex;
    overflow-x: scroll; /* ERMÖGLICHT Wischen/Scrollen */
    scroll-snap-type: x mandatory; /* Zwingt den Browser, auf jedem Bild einzurasten */
    -webkit-overflow-scrolling: touch; /* Verbessert Scrolling auf iOS */
    padding-bottom: 20px;
    gap: 20px;
    margin: 20px 0;
    
    /* Scrollbar auf modernen Browsern ausblenden (optional) */
    /*-ms-overflow-style: none;  /* IE and Edge */
    /*scrollbar-width: none;  /* Firefox */
}
.image-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.carousel-item {
    flex: 0 0 auto; /* WICHTIG: Verhindert, dass die Bilder schrumpfen oder wachsen */
    width: 300px; /* Feste Breite für das Bild im Desktop-Modus */
    scroll-snap-align: center; /* Das Element rastet am Anfang des Scroll-Containers ein */
    text-decoration: none;
    display: block;
    border: 1px solid var(--color-light-background);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.carousel-item:hover {
    transform: translateY(-5px); /* Kleiner Hover-Effekt */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.carousel-item img {
    display: block;
    width: 100%;
    height: 200px; /* Feste Höhe für Einheitlichkeit */
    object-fit: cover; /* Stellt sicher, dass das Bild den Bereich ausfüllt, ohne verzerrt zu werden */
}

.image-caption {
    background: var(--color-dark-background);
    color: #fff;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.carousel-hint {
    margin-top: 15px;
    font-style: italic;
    font-size: 0.9rem;
    color: #777;
}

/* Mobile Optimierung: Die Bilder sollen auf kleinen Bildschirmen 80% der Breite einnehmen */
@media (max-width: 700px) {
    .carousel-item {
        width: 80vw; /* Nimmt 80% der Viewport-Breite ein */
    }
}

/* ========================================================================== */
/* --- LIGHTBOX (Modal-Galerie) CSS --- */
/* ========================================================================== */

/* Der Haupt-Container der Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.9); /* Dunkler, halbtransparenter Hintergrund */
    z-index: 1000; /* Stellt sicher, dass das Overlay über allem liegt */
    opacity: 0;
    pointer-events: none; /* Macht das Overlay standardmäßig "durchklickbar" */
    transition: opacity 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

/* Wird aktiv, wenn der Anker in der URL gesetzt ist (z.B. #lightbox-2024) */
.lightbox:target {
    opacity: 1;
    pointer-events: auto; /* Macht das Overlay wieder aktiv */
}

/* Das große Bild im Lightbox-Fenster */
.lightbox img {
    max-width: 98vw; /* Maximal 90% der Viewport-Breite */
    max-height: 90vh; /* Maximal 80% der Viewport-Höhe */
    width: auto;
    height: auto;
    display: block;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
    /* Setzt die ursprünglichen inline-Styles zurück, falls vorhanden */
    margin: 0;
    padding: 0;
}

/* Der Schließen-Button (X) */
.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #FFF;
    text-decoration: none;
    font-size: 40px;
    font-weight: 100;
    line-height: 1;
    z-index: 1001; /* Muss über dem Bild liegen */
    transition: color 0.2s;
}

.close-lightbox:hover {
    color: #CCC;
}

/* Beschriftung unter dem Bild */
.lightbox-caption {
    color: #FFF;
    margin-top: 10px;
    font-size: 16px;
    text-align: center;
    max-width: 80vw;
}

/* Auf mobilen Geräten: Schließen-Button etwas weiter nach innen */
@media screen and (max-width: 700px) {
    .close-lightbox {
        right: 15px;
        top: 15px;
    }
}