/* Lightbox overlay */
.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
}
.lightbox.open {
    display: flex;
}

.lightbox .lb-image-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    cursor: pointer;
    position: relative;
}

.lightbox .lb-spinner {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lb-spin 0.8s linear infinite;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.lightbox .lb-spinner.lb-spinner-visible {
    opacity: 1;
}
@keyframes lb-spin {
    to { transform: rotate(360deg); }
}

.lightbox .lb-image {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox .lb-caption {
    position: absolute;
    z-index: 10;
    left: 0;
    right: 0;
    bottom: 16px;
    text-align: center;
    color: #fff;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.65);
    font-size: 18px;
    line-height: 1.35;
    cursor: text;
    user-select: text;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Controls - above image wrap so they always receive clicks */
.lightbox .lb-close,
.lightbox .lb-prev,
.lightbox .lb-next {
    position: absolute;
    z-index: 10;
    border: 0;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.lightbox .lb-close {
    top: 16px;
    right: 16px;
    font-size: 26px;
}
.lightbox .lb-prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}
.lightbox .lb-next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox .lb-close:focus,
.lightbox .lb-prev:focus,
.lightbox .lb-next:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
