/**
 * Lofton Arts - Lightbox Gallery Styles
 * Isolated from Tailwind JIT purging; loaded via <link> in public layout.
 */

/* ── Dialog overlay ─────────────────────────────────────── */
.lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 50;
    box-sizing: border-box;
}

/* Override native dialog backdrop */
.lightbox::backdrop {
    background: rgba(0, 0, 0, 0.95);
}

/* ── Inner layout container ─────────────────────────────── */
.lightbox__inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ── Top bar (counter + close) ──────────────────────────── */
.lightbox__topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 30;
}

/* Image counter label */
.lightbox__counter {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

/* Close button */
.lightbox__close {
    color: rgba(255, 255, 255, 0.55);
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    line-height: 1;
}

.lightbox__close:hover {
    color: #bfa15f;
}

/* ── Navigation arrows ──────────────────────────────────── */
.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 48px;
    font-weight: 300;
    cursor: pointer;
    user-select: none;
    transition:
        color 0.2s,
        background 0.2s;
    z-index: 20;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    line-height: 1;
}

.lightbox__prev {
    left: 8px;
}

.lightbox__next {
    right: 8px;
}

.lightbox__nav:hover {
    color: #bfa15f;
    background: rgba(0, 0, 0, 0.6);
}

/* ── Main image viewport ────────────────────────────────── */
.lightbox__viewport {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.lightbox__img {
    max-width: 90vw;
    max-height: 72vh;
    object-fit: contain;
    user-select: none;
    transition:
        transform 0.2s,
        opacity 0.3s;
    opacity: 0;
}

/* ── Thumbnail strip ────────────────────────────────────── */
.lightbox__thumbs-wrap {
    position: absolute;
    bottom: 32px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    pointer-events: none;
}

/* Semi-transparent backdrop behind thumbnails for separation */
.lightbox__thumbs-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 12px;
    max-width: 85vw;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Thumbnail button */
.lightbox__thumb {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 4px;
    border: 2px solid transparent;
    opacity: 0.45;
    transition:
        opacity 0.2s,
        border-color 0.2s;
    cursor: pointer;
    padding: 0;
    background: none;
    display: block;
}

.lightbox__thumb:hover {
    opacity: 0.75;
}

.lightbox__thumb.is-active {
    border-color: #bfa15f;
    opacity: 1;
}

/* Thumbnail inner image */
.lightbox__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Caption bar ────────────────────────────────────────── */
.lightbox__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 6px 24px;
}

.lightbox__caption-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}

/* ── Scrollbar hide utility ─────────────────────────────── */
.lightbox .scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.lightbox .scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ── Fade-in animation on open ──────────────────────────── */
@keyframes lightbox-enter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox[open] {
    animation: lightbox-enter 0.25s ease-out;
}

/* Smooth image reveal within the animation */
.lightbox[open] .lightbox__img {
    transition:
        opacity 0.4s ease 0.1s,
        transform 0.2s;
}
