/**
 * Vista Spots Lightbox Styles
 * White-background, editorial lightbox with thumbnail strip
 */

/* ── Shell ──────────────────────────────────────────────────────────────────── */
.vista-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vista-lightbox[aria-hidden="false"] {
    display: block;
}

.vista-lightbox-open {
    opacity: 1;
}

.vista-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.97);
    cursor: pointer;
}

/* ── Container ───────────────────────────────────────────────────────────────── */
.vista-lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* top: close btn gap | sides: nav arrows | bottom: thumbnail strip */
    padding: 56px 88px 88px;
    box-sizing: border-box;
}

/* ── Image ───────────────────────────────────────────────────────────────────── */
.vista-lightbox-content {
    position: relative;
    max-width: 1280px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: vistaLightboxReveal 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes vistaLightboxReveal {
    from { opacity: 0; transform: scale(0.98); }
    to   { opacity: 1; transform: scale(1); }
}

.vista-lightbox-image-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Specificity 0,2,1 — beats .elementor-kit-NNN img (0,1,1) */
.vista-lightbox-content .vista-lightbox-image {
    /* width: auto prevents FSE block-theme global "img { width: 100% }" from stretching */
    width: auto;
    max-width: 100%;
    /* Reserve room for caption area (~60px) + thumbnail strip (80px) + padding (56px top) */
    max-height: calc(100vh - 320px);
    height: auto;
    display: block;
    border-radius: 0;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.12);
}

/* ── Caption ─────────────────────────────────────────────────────────────────── */
.vista-lightbox-caption-area {
    width: 100%;
    padding: 12px 0 0;
    margin-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 40px;
    flex-shrink: 0; /* never crushed by flex layout */
}

/* Left block: spot name + owner row stacked vertically */
.vista-lightbox-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}

.vista-lightbox-spot-row {
    line-height: 1.2;
}

.vista-lightbox-spot-name,
.vista-lightbox-spot-name:hover,
.vista-lightbox-spot-name:visited,
.vista-lightbox-spot-name:focus {
    font-size: 0.68rem !important;
    font-weight: 500 !important;
    color: rgba(0, 0, 0, 0.5) !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    white-space: nowrap;
}

.vista-lightbox-spot-name:hover {
    text-decoration: underline;
    color: rgba(0, 0, 0, 0.75) !important;
}

.vista-lightbox-owner-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.vista-lightbox-owner-info .vista-lightbox-owner-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
}

/* !important here beats Elementor kit global color overrides */
.vista-lightbox-owner-name,
.vista-lightbox-owner-name:hover,
.vista-lightbox-owner-name:visited,
.vista-lightbox-owner-name:focus {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: rgba(0, 0, 0, 0.75) !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    text-decoration: none;
}

.vista-lightbox-owner-name:hover {
    text-decoration: underline;
}

.vista-lightbox-caption-text {
    font-size: 0.875rem !important;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.6) !important;
    flex: 1;
    font-style: italic;
}

/* ── Close button (top-right corner) ─────────────────────────────────────────── */
.vista-lightbox .vista-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    bottom: auto;
    left: auto;
    transform: none;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 24px;
    color: #111;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 7px 16px;
    width: auto;
    height: auto;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
    z-index: 10;
    text-decoration: none;
}

.vista-lightbox .vista-lightbox-close:hover,
.vista-lightbox .vista-lightbox-close:focus {
    background: rgba(0, 0, 0, 0.15);
    color: #000;
    transform: none;
    text-decoration: none;
    opacity: 1;
}

/* ── Navigation arrows ───────────────────────────────────────────────────────── */
.vista-lightbox .vista-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #000;
    border: none;
    /* padding: 0 + box-sizing: border-box counteract FSE theme's global
       "button { padding: 1rem 2.25rem }" which would inflate these into ovals */
    padding: 0;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    min-width: unset;
    min-height: unset;
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    color: #fff;
    transition: opacity 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.vista-lightbox .vista-lightbox-nav:hover,
.vista-lightbox .vista-lightbox-nav:focus {
    opacity: 0.75;
    background: #000;
    color: #fff;
    transform: translateY(-50%);
    text-decoration: none;
}

.vista-lightbox .vista-lightbox-prev { left: 20px; }
.vista-lightbox .vista-lightbox-next { right: 20px; }

/* ── Thumbnail strip ─────────────────────────────────────────────────────────── */
.vista-lightbox-thumbnails {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 88px;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.vista-lightbox-thumbnails::-webkit-scrollbar {
    display: none;
}

.vista-lightbox-thumb {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background-size: cover;
    background-position: center;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
    padding: 0;
    outline: none;
}

.vista-lightbox-thumb:hover {
    opacity: 0.8;
    transform: scale(1.06);
}

.vista-lightbox-thumb.active {
    border-color: rgba(0, 0, 0, 0.8);
    opacity: 1;
}

/* ── Mobile ──────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .vista-lightbox-container {
        padding: 50px 48px 76px;
    }

    /* Match base-rule specificity (0,2,1) so this override actually wins */
    .vista-lightbox-content .vista-lightbox-image {
        max-height: calc(100vh - 280px);
    }

    .vista-lightbox .vista-lightbox-nav {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .vista-lightbox .vista-lightbox-prev { left: 8px; }
    .vista-lightbox .vista-lightbox-next { right: 8px; }

    .vista-lightbox .vista-lightbox-close {
        top: 10px;
        right: 12px;
        padding: 6px 12px;
        font-size: 0.78rem;
    }

    .vista-lightbox-thumbnails {
        padding: 10px 48px;
        height: 68px;
    }

    .vista-lightbox-thumb {
        width: 44px;
        height: 44px;
    }
}

/* ── Accessibility ───────────────────────────────────────────────────────────── */
.vista-lightbox[aria-hidden="true"] {
    pointer-events: none;
}

.vista-lightbox button:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.4);
    outline-offset: 3px;
}
