/* KVA Lightbox — стили общего вьювера галерей.
   Подключается через kva_enqueue_style('lightbox.css') рядом с js/lightbox.js. */

.lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.lightbox.active { opacity: 1; pointer-events: all; }

.lightbox-img-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease;
    will-change: transform;
    cursor: zoom-in;
}

/* Подпись к изображению (берётся из data-caption) */
.lightbox-caption {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1.25rem;
    max-width: min(90vw, 760px);
    padding: 0.55rem 1rem;
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.9375rem;
    font-weight: 300;
    line-height: 1.4;
    text-align: center;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 9999;
}
.lightbox-caption.is-visible { opacity: 1; }
@media (max-width: 768px) {
    .lightbox-caption { font-size: 0.8125rem; bottom: 4rem; padding: 0.45rem 0.75rem; }
}
.lightbox img.is-zoomed   { cursor: grab; }
.lightbox img.is-dragging { cursor: grabbing; transition: none; }

.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-white, #fff);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10000;
}
.lightbox-btn:hover {
    background: var(--color-olive, #919602);
    transform: translateY(-50%) scale(1.1);
    border-color: var(--color-olive, #919602);
}
.lightbox-close { top: 1.5rem; right: 1.5rem; transform: none; }
.lightbox-close:hover { transform: scale(1.1); }
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

@media (max-width: 768px) {
    .lightbox-btn   { width: 2.5rem; height: 2.5rem; }
    .lightbox-prev  { left: 0.5rem; }
    .lightbox-next  { right: 0.5rem; }
    .lightbox-close { top: 1rem; right: 1rem; }
    .lightbox img   { max-width: 100vw; max-height: 80vh; }
}
