:root {
    --linde-gruen:        #1a6b35;
    --linde-gruen-dk:     #0e4420;
    --linde-gruen-hell:   #2d8f4e;
    --linde-gruen-heller: #E3E3E0;
    --linde-gold:         #c8a84b;
    --linde-gold-hell:    #e8d08a;
    --linde-bg:           #eeebe4;
    --linde-weiss:        #ffffff;
    --linde-text:         #1e2519;
    --linde-text-mid:     #4a5540;
    --linde-text-hell:    #7a8a72;
    --linde-border:       rgba(26,107,53,0.15);
    --linde-shadow:       0 4px 24px rgba(0,0,0,0.09);
    --r:   6px;
    --banner-h: 36px;
    --nav-h:    60px;
    --linde-sage: #dce7dd;
    --linde-mint: #eef6ef;
    --linde-forest: #12331c;
    --glass: rgba(255,255,255,0.75);
}

/* ══════════════════════════════════════
   MEDIATHEK MODULE STYLES
   ══════════════════════════════════════ */
.gallery-section-title {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 22px 8px 12px;
    text-align: center;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 1.6em;
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.25);
    min-height: 20px;
}

.gallery-intro {
    text-align: center;
    margin-bottom: 30px;
    color: #555;
    font-style: italic;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 20px;
}
/* Klasse für die Einzelansicht eines Albums */
.gallery-grid.album-single-view {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* --- STYLING DER KARTEN & ALBEN --- */
.gallery-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 1px solid #e5e5e5;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.1);
}
.gallery-img-wrapper {
    height: 180px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.album-single-view .gallery-img-wrapper {
    height: 140px; /* Bilder im Album sind kompakter */
}
.gallery-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.gallery-card:hover .gallery-img-wrapper img {
    transform: scale(1.03);
}
.gallery-card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}
.gallery-card-title {
    font-size: 1.15rem;
    font-weight: bold;
    color: linde-gruen;/* #006621;*/
    margin: 0 0 8px 0;
}
.gallery-card-desc {
    font-size: 0.92rem;
    color: #666;
    margin-bottom: 12px;
    flex-grow: 1;
    line-height: 1.4;
}
.gallery-card-meta {
    font-size: 0.85rem;
    color: #888;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* ANPASSUNG: Standardmäßig ausgeblendet, wird per JS eingeblendet */
.img-title-banner {
    text-align: center;
    padding: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    background: #ffffff;
    color: #444;
    border-top: 1px solid #eee;
    word-break: break-all;
    display: none; 
}
/* CSS-Weiche: Wenn das Grid diese Klasse hat, Titel anzeigen */
.show-titles .img-title-banner {
    display: block;
}

/* Styling für den neuen Steuerungs-Bereich (Checkbox) */
.gallery-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
    padding: 0 5px;
}
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    user-select: none;
}
.toggle-label input[type="checkbox"] {
    accent-color: #006621;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* --- STYLES FÜR DIE LINDE-GRÜNEN BUTTONS --- */
.btn-linde-back {
    display: inline-block;
    background-color: #006621;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 33px 8px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 102, 33, 0.15);
    transition: background-color 0.2s ease, transform 0.1s ease;
}
.btn-linde-back:hover {
    background-color: #004d17;
    transform: translateY(-1px);
}
.btn-linde-back:active {
    transform: translateY(0);
}

/* --- LIGHTBOX MODAL MODERNE STYLES --- */
.lb-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.lb-modal.active { display: flex; opacity: 1; }
.lb-content {
    position: relative;
    max-width: 88%;
    max-height: calc(100vh - 176px);
    margin-top: 96px; /* schiebt Inhalt unter Banner+Nav */
    display: flex; flex-direction: column; align-items: center;
}
.lb-img {
    max-width: 100%;
    max-height: calc(100vh - 230px); /* sicherer Puffer für X-Button + Caption */
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

/* --- NEU: TEILEN BUTTON & META BEREICH --- */
.lb-meta-wrap {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 18px;
    border-radius: 20px;
    max-width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lb-caption {
    color: #fff; 
    font-size: 1.05rem; 
    text-align: center;
}

.lb-share-btn {
    background: none;
    border: none;
    color: var(--linde-gold-hell, #e8d08a);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    display: none; /* Wird via JS nur bei Support (Smartphone) eingeblendet */
    transition: transform 0.2s, color 0.2s;
}
.lb-share-btn:hover { 
    transform: scale(1.15); 
    color: #ffffff;
}

.lb-btn {
    position: absolute; 
    background: rgba(0, 0, 0, 0.4); /* Dunklerer Hintergrund für exzellenten Kontrast */
    color: #fff; border: none; font-size: 1.8rem;
    width: 50px; height: 50px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.2s; user-select: none;
    
    /* NEU: Holt die Knöpfe IMMER vor das Bild, damit sie nicht verdeckt werden */
    z-index: 20; 
}

.lb-btn:hover { background: rgba(255,255,255,0.3);}
.lb-close { top: -50px; right: 0; }
.lb-prev { left: -65px; top: 50%; transform: translateY(-50%); }
.lb-next { right: -65px; top: 50%; transform: translateY(-50%); }

/* --- DEIN @MEDIA BEREICH (Optimiert für Smartphones & Tablets) --- */
@media (max-width: 768px) {
    .lb-content { 
        max-width: 95%; 
        max-height: 80vh;
    }
    .lb-img { 
        max-height: 70vh; 
    }
    
    /* Knöpfe mobil etwas kompakter für Touch-Bedienung */
    .lb-btn {
        width: 46px;
        height: 46px;
        font-size: 1.4rem;
        background: rgba(0, 0, 0, 0.5);
    }
    /* Auf Smartphones kleben die Elemente jetzt sauber in den Ecken des Displays */
    .lb-close { 
        top: 16px; 
        right: 16px; 
    }
    .lb-prev { 
        left: 12px; 
        top: 50%;
        transform: translateY(-50%);
    }
    .lb-next { 
        right: 12px; 
        top: 50%;
        transform: translateY(-50%);
    }

    /* Grid-Anpassung für kompakte Ansicht auf Tablets */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    .gallery-grid.album-single-view {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
}

/* Zusätzlicher Schutz für schmale Smartphones */
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .gallery-grid.album-single-view {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    .album-single-view .gallery-img-wrapper {
        height: 100px;
    }
}