/* LIGHTBOX STYLING - Isoliert, um das Haupt-Layout nicht zu stören */

/* Das Haupt-Lightbox-Overlay (schwarzer Hintergrund) */
.lightbox {
    display: none; 
    position: fixed; 
    /* WICHTIG: Höchster Z-Index beibehalten */
    z-index: 9999; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    
    /* Hintergrundabdeckung: NEU: Setzen auf volle Deckkraft (rgba(0,0,0,1) oder einfach 'black') */
    background-color: black; 
    /* Oder als Alternative, falls Sie einen sehr leicht durchscheinenden Effekt behalten wollen: rgba(0,0,0,0.99) */
    
    /* WICHTIG: Die gesamte Lightbox ist initial unsichtbar */
    visibility: hidden; 
    
    /* Zentrierung */
    display: flex;
    justify-content: center; 
    align-items: center; 
    padding: 0; 
}

/* Klasse für die Aktivierung (durch JS gesetzt) */
.lightbox.is-visible {
    visibility: visible;
}

/* Der Container für das Bild und die Pfeile */
.lightbox-content {
    position: relative; 
    margin: 0; 
    display: flex;
    align-items: center; 
    justify-content: center;
    width: 90%;
    max-width: 1100px;
    margin-top: 60px; 
}

/* Das eigentliche Bild (zentriert und mit Übergang) */
#lightbox-img {
    width: auto;
    max-width: 100%; 
    max-height: 85vh; 
    display: block;
    border-radius: 5px;
    animation-name: zoom;
    animation-duration: 0.6s;
    
    /* Wichtig: Übergang für den Fade-Effekt */
    transition: opacity 1s ease-in-out; 
    margin: 0 auto; 
}

/* Schließen-Button und Zähler */
.close-btn {
    position: absolute;
    top: -45px; 
    right: 5px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10000; 
}
#image-counter {
    color: #f2f2f2;
    font-size: 14px;
    padding: 8px 12px;
    position: absolute;
    top: -45px; 
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
}
.prev-btn, .next-btn {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.4);
}
.prev-btn {
    left: -60px; 
    border-radius: 3px 0 0 3px;
}
.next-btn {
    right: -60px; 
    border-radius: 0 3px 3px 0;
}
.prev-btn:hover, .next-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Klasse für den Überblend-Effekt */
.fade {
    opacity: 0; 
}
@keyframes zoom {
    from {transform:scale(0.8)} 
    to {transform:scale(1)}
}