/* ============================================================
   Lightbox-Styles — Vollbildansicht einzelner Fotos
   ============================================================ */

/* --- Lightbox-Overlay --- */

#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background-color: #000000;
    z-index: 500;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#lightbox.visible {
    display: flex;
}

/* --- Image Area --- */

.lightbox-image-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 3rem 5rem;
    position: relative;
    min-height: 0; /* Important for flex children with overflow */
}

#lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    /* Fade in smoothly, hide immediately (via transitioning class) */
    transition: opacity 0.2s ease;
}

/* Hide old image immediately — no fade-out, so nothing lingers */
#lightbox-image.transitioning {
    opacity: 0;
    transition: none;
}

/* --- Navigation Arrows --- */

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 2rem;
    cursor: pointer;
    padding: 1rem;
    line-height: 1;
    transition: color 0.2s;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-arrow:hover {
    color: rgba(255, 255, 255, 0.95);
}

#lightbox-prev {
    left: 0.5rem;
}

#lightbox-next {
    right: 0.5rem;
}

/* --- Close Button --- */

#lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.2s;
    z-index: 10;
}

#lightbox-close:hover {
    color: rgba(255, 255, 255, 0.95);
}

/* --- Caption --- */

.lightbox-caption {
    width: 100%;
    padding: 1rem 5rem 1.5rem;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#lightbox-title {
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

#lightbox-info {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.04em;
}

/* Image counter (e.g. 3 / 15) */
.lightbox-counter {
    position: absolute;
    top: 1.1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.1em;
    pointer-events: none;
}

/* --- Responsive --- */

@media (max-width: 700px) {
    .lightbox-image-area {
        padding: 3rem 3rem 1.5rem;
    }

    .lightbox-caption {
        padding: 0.75rem 1.25rem 1.25rem;
    }

    .lightbox-arrow {
        font-size: 1.5rem;
        padding: 0.75rem 0.5rem;
    }

    #lightbox-prev {
        left: 0;
    }

    #lightbox-next {
        right: 0;
    }

    #lightbox-title {
        font-size: 0.8rem;
    }
}
