/* ============================================
   Photo Lightbox Overlay
   ============================================ */

.rundais-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.rundais-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lightboxFadeIn 0.2s ease;
}

@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rundais-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
    padding: 0;
}

.rundais-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.rundais-lightbox-close svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
}

.rundais-lightbox-img-wrap {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    cursor: default;
    animation: lightboxZoomIn 0.25s ease;
}

@keyframes lightboxZoomIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.rundais-lightbox-img-wrap img {
    display: block;
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* Navigation arrows (for galleries with multiple photos) */
.rundais-lightbox-prev,
.rundais-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
    padding: 0;
}

.rundais-lightbox-prev:hover,
.rundais-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.rundais-lightbox-prev svg,
.rundais-lightbox-next svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
}

.rundais-lightbox-prev {
    left: 16px;
}

.rundais-lightbox-next {
    right: 16px;
}

.rundais-lightbox.has-gallery .rundais-lightbox-prev,
.rundais-lightbox.has-gallery .rundais-lightbox-next {
    display: flex;
}

/* Photo counter */
.rundais-lightbox-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-family: "roc-grotesk", sans-serif;
    display: none;
}

.rundais-lightbox.has-gallery .rundais-lightbox-counter {
    display: block;
}

/* Loading spinner */
.rundais-lightbox-img-wrap .lightbox-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lightboxSpin 0.7s linear infinite;
}

@keyframes lightboxSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .rundais-lightbox-img-wrap {
        max-width: 95vw;
        max-height: 80vh;
    }

    .rundais-lightbox-img-wrap img {
        max-width: 95vw;
        max-height: 80vh;
        border-radius: 4px;
    }

    .rundais-lightbox-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .rundais-lightbox-prev,
    .rundais-lightbox-next {
        width: 36px;
        height: 36px;
    }

    .rundais-lightbox-prev {
        left: 8px;
    }

    .rundais-lightbox-next {
        right: 8px;
    }
}
