/* ═══════════════════════════════════════════════════════════ */
/* PREMIUM IMAGE LIGHTBOX — Secret Island theme                */
/* ═══════════════════════════════════════════════════════════ */

:root {
    --glb-bg-color: rgba(11, 16, 24, 0.96);
    --glb-backdrop-blur: 10px;
    --glb-accent-color: var(--ink, #eff0ef);
    --glb-text-color: var(--ink, #eff0ef);
    --glb-text-muted: rgba(239, 240, 239, 0.55);

    --glb-btn-bg: rgba(239, 240, 239, 0.06);
    --glb-btn-border: rgba(239, 240, 239, 0.18);
    --glb-btn-hover-bg: rgba(239, 240, 239, 0.16);
    --glb-btn-hover-border: rgba(239, 240, 239, 0.4);

    --glb-thumb-size: 64px;
    --glb-thumb-gap: 8px;
    --glb-thumb-opacity: 0.35;
    --glb-thumb-hover-opacity: 0.75;

    --glb-transition-speed: 0.35s;
    --glb-transition-ease: cubic-bezier(0.25, 0.8, 0.25, 1);
}

#gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--glb-bg-color);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--glb-transition-speed) var(--glb-transition-ease),
                visibility var(--glb-transition-speed) var(--glb-transition-ease);
}

@supports (backdrop-filter: blur(5px)) {
    #gallery-lightbox {
        background: rgba(11, 16, 24, 0.88);
        backdrop-filter: blur(var(--glb-backdrop-blur));
    }
}

#gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.glb-no-scroll {
    overflow: hidden !important;
}

.glb-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    flex-shrink: 0;
    z-index: 10;
}

.glb-counter {
    color: var(--glb-text-muted);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    user-select: none;
}

.glb-close {
    color: var(--glb-text-color);
    background: var(--glb-btn-bg);
    border: 1px solid var(--glb-btn-border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--glb-transition-speed) var(--glb-transition-ease);
    padding: 0;
}

.glb-close svg {
    transition: transform var(--glb-transition-speed) var(--glb-transition-ease);
}

.glb-close:hover {
    background: var(--glb-btn-hover-bg);
    border-color: var(--glb-btn-hover-border);
}

.glb-close:hover svg {
    transform: rotate(90deg);
}

.glb-close:focus-visible {
    outline: 2px solid var(--glb-accent-color);
    outline-offset: 2px;
}

.glb-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 5rem;
    min-height: 0;
    cursor: zoom-out;
    user-select: none;
}

.glb-img-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.glb-main-img {
    max-width: calc(100vw - 12rem);
    max-height: calc(100vh - 14rem);
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.3s ease,
                transform 0.4s var(--glb-transition-ease);
}

.glb-main-img.is-loaded {
    opacity: 1;
    transform: scale(1);
}

.glb-spinner {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 3px solid rgba(239, 240, 239, 0.1);
    border-radius: 50%;
    border-top-color: var(--glb-accent-color);
    animation: glb-spin 0.8s linear infinite;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 1;
}

.glb-spinner.is-active {
    opacity: 1;
}

@keyframes glb-spin {
    to { transform: rotate(360deg); }
}

.glb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--glb-btn-bg);
    border: 1px solid var(--glb-btn-border);
    color: var(--glb-text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--glb-transition-speed) var(--glb-transition-ease);
    z-index: 10;
    padding: 0;
}

.glb-arrow:hover {
    background: var(--glb-btn-hover-bg);
    border-color: var(--glb-btn-hover-border);
    transform: translateY(-50%) scale(1.08);
}

.glb-arrow-prev { left: 1.5rem; }
.glb-arrow-prev svg { transform: translateX(-1px); transition: transform 0.2s ease; }
.glb-arrow-prev:hover svg { transform: translateX(-3px); }

.glb-arrow-next { right: 1.5rem; }
.glb-arrow-next svg { transform: translateX(1px); transition: transform 0.2s ease; }
.glb-arrow-next:hover svg { transform: translateX(3px); }

.glb-arrow:focus-visible {
    outline: 2px solid var(--glb-accent-color);
    outline-offset: 2px;
}

.glb-thumbstrip {
    flex-shrink: 0;
    width: 100%;
    padding: 1rem 2rem 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
    text-align: center;
    scrollbar-width: thin;
    scrollbar-color: rgba(239, 240, 239, 0.2) transparent;
    z-index: 10;
}

.glb-thumbstrip::-webkit-scrollbar { height: 4px; }
.glb-thumbstrip::-webkit-scrollbar-track { background: transparent; }
.glb-thumbstrip::-webkit-scrollbar-thumb {
    background: rgba(239, 240, 239, 0.15);
    border-radius: 4px;
    transition: background 0.3s ease;
}
.glb-thumbstrip::-webkit-scrollbar-thumb:hover {
    background: rgba(239, 240, 239, 0.35);
}

.glb-thumb {
    display: inline-block;
    width: var(--glb-thumb-size);
    height: var(--glb-thumb-size);
    border-radius: 3px;
    object-fit: cover;
    margin: 0 calc(var(--glb-thumb-gap) / 2);
    cursor: pointer;
    opacity: var(--glb-thumb-opacity);
    border: 1px solid transparent;
    transition: all 0.25s var(--glb-transition-ease);
    vertical-align: middle;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.glb-thumb:hover {
    opacity: var(--glb-thumb-hover-opacity);
    transform: scale(1.04);
}

.glb-thumb.is-active {
    opacity: 1;
    border-color: var(--glb-accent-color);
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(239, 240, 239, 0.18);
}

@media (max-width: 768px) {
    :root {
        --glb-thumb-size: 52px;
        --glb-thumb-gap: 6px;
    }

    .glb-topbar { padding: 1rem 1.25rem; }
    .glb-close { width: 38px; height: 38px; }
    .glb-close svg { width: 20px; height: 20px; }

    .glb-stage { padding: 0 1.5rem; }
    .glb-arrow { width: 40px; height: 40px; }
    .glb-arrow svg { width: 18px; height: 18px; }
    .glb-arrow-prev { left: 0.75rem; }
    .glb-arrow-next { right: 0.75rem; }

    .glb-main-img {
        max-width: calc(100vw - 3rem);
        max-height: calc(100vh - 12rem);
        border-radius: 2px;
    }

    .glb-thumbstrip { padding: 0.75rem 1rem 1.25rem; }
}
