@media (max-width: 600px) {
    .lightbox {
        user-select: none;
    }
}

/* Lightbox container */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* Verwende die Viewport-Breite */
    height: 100vh; /* Verwende die Viewport-Höhe */
    background: rgba(255, 255, 255, 0.9); /* Leichtes weißes Overlay */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out; /* Smooth fade-in effect */
}

/* Lightbox active */
.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

/* Lightbox content */
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    /* overflow: hidden; */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.lightbox-image {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    opacity: 0;
    transform: translateX(10px); /* Initial slide effect */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out; /* Smooth fade-in and slide */
}

.lightbox-image.visible {
    opacity: 1;
    transform: translateX(0); /* Reset slide effect */
}

/* Caption */
.lightbox-caption {
    color: #333;
    font-size: 1rem;
    text-align: center;
    margin-top: 10px;
}

.lightbox-nav,
.lightbox-close {
    text-indent: -9999px;
    overflow: hidden;
    white-space: nowrap;
    /* clip-path: inset(50%); */
}


/* Navigation */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    cursor: pointer;
    height: 40px;
    width: 40px;
    background-repeat: no-repeat;
    background-size: cover;
    user-select: none;
    z-index: 1100; /* Ensure it’s above other content */
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8); /* Add subtle shadow for better visibility */
}

.lightbox-nav.prev {
    left: 20px; /* Place relative to the screen’s edge */
    background-image: url(../images/icons/arrow-left.svg);
}

.lightbox-nav.next {
    right: 20px; /* Place relative to the screen’s edge */
    background-image: url(../images/icons/arrow-right.svg);
}

/* Close button */
.lightbox-close {
    position: fixed;
    top: 10px;
    right: 10px;
    color: #333;
    font-size: 0; /* Hide text */
    cursor: pointer;
    height: 50px;
    width: 50px;
    z-index: 1100;
}
.lightbox-close > span {
    position: absolute;
    background-repeat: no-repeat;
    background-size: cover;
    background-image: url(../images/icons/close.svg);
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    height: 16px;
    width: 16px;
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .lightbox-nav,
    .lightbox-close {
        font-size: 3rem;
    }
}

/* Neues Bild von rechts einblenden */
.slide-in-from-right {
    animation: slideInFromRight 0.3s ease-in-out forwards;
}

/* Neues Bild von links einblenden */
.slide-in-from-left {
    animation: slideInFromLeft 0.3s ease-in-out forwards;
}

/* Bestehende Animationen */
.slide-left {
    animation: slideOutToLeft 0.3s ease-in-out forwards;
}

.slide-right {
    animation: slideOutToRight 0.3s ease-in-out forwards;
}

/* Keyframes für Animationen mit subtileren Bewegungen */
@keyframes slideInFromRight {
    from {
        transform: translateX(10px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-10px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-10px);
        opacity: 0;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(10px);
        opacity: 0;
    }
}

/* Subtileres Fade-In der Bilder */
.lightbox-image.visible {
    opacity: 1;
    transition: opacity 0.3s ease-in-out; /* Smooth fade-in for images */
}