/* ==========================================================================
   Lao Ethnic Garden — Modern Image Lightbox
   ========================================================================== */

.leg-lb {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    user-select: none;
    -webkit-user-select: none;
}
.leg-lb.is-open {
    display: flex;
    flex-direction: column;
    animation: leg-lb-fade 240ms ease;
}
@keyframes leg-lb-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Top toolbar */
.leg-lb__topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    color: #fff;
    background: linear-gradient(180deg, rgba(0,0,0,0.7), transparent);
    pointer-events: none;
}
.leg-lb__topbar > * { pointer-events: auto; }

.leg-lb__counter {
    font-family: var(--leg-font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.leg-lb__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.leg-lb__btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 0;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 200ms;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    text-decoration: none;
}
.leg-lb__btn:hover {
    background: rgba(255,255,255,0.22);
    transform: scale(1.1);
    color: #fff;
}
.leg-lb__btn--close:hover {
    background: rgba(225, 29, 72, 0.85);
}
.leg-lb__btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Main stage */
.leg-lb__stage {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Image */
.leg-lb__image {
    max-width: 92vw;
    max-height: calc(100vh - 200px);
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    border-radius: 4px;
    transition: opacity 200ms, transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: zoom-in;
    user-drag: none;
    -webkit-user-drag: none;
}
.leg-lb__image.is-zoomed {
    cursor: zoom-out;
    transform: scale(1.6);
}
.leg-lb__image.is-loading {
    opacity: 0;
}

/* Loader spinner */
.leg-lb__spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: leg-lb-spin 800ms linear infinite;
    opacity: 0;
    transition: opacity 200ms;
    pointer-events: none;
}
.leg-lb__spinner.is-visible { opacity: 1; }
@keyframes leg-lb-spin {
    to { transform: rotate(360deg); }
}

/* Navigation arrows */
.leg-lb__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 0;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 200ms;
    backdrop-filter: blur(4px);
    z-index: 2;
}
.leg-lb__nav:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-50%) scale(1.1);
}
.leg-lb__nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.leg-lb__nav:disabled:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-50%) scale(1);
}
.leg-lb__nav--prev { left: 22px; }
.leg-lb__nav--next { right: 22px; }
.leg-lb__nav svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Bottom toolbar (caption + thumbnails) */
.leg-lb__bottom {
    position: relative;
    z-index: 2;
    padding: 14px 22px 18px;
    background: linear-gradient(0deg, rgba(0,0,0,0.78), transparent);
}
.leg-lb__caption {
    text-align: center;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 12px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    min-height: 1.2em;
}
.leg-lb__caption strong { font-weight: 700; }

/* Thumbnail strip */
.leg-lb__strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px;
    justify-content: center;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.leg-lb__strip::-webkit-scrollbar { height: 4px; }
.leg-lb__strip::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}
.leg-lb__thumb {
    flex: 0 0 56px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    background: #000;
    padding: 0;
    transition: all 180ms;
    opacity: 0.55;
}
.leg-lb__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.leg-lb__thumb:hover {
    opacity: 1;
    transform: translateY(-2px);
}
.leg-lb__thumb.is-active {
    opacity: 1;
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.6);
    transform: translateY(-2px);
}

/* Hint badge */
.leg-lb__hint {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 14px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 240ms;
}
.leg-lb__hint.is-visible {
    opacity: 1;
}

/* Mobile */
@media (max-width: 575px) {
    .leg-lb__topbar { padding: 12px 14px; }
    .leg-lb__btn { width: 38px; height: 38px; }
    .leg-lb__btn svg { width: 18px; height: 18px; }
    .leg-lb__nav {
        width: 44px;
        height: 44px;
    }
    .leg-lb__nav--prev { left: 8px; }
    .leg-lb__nav--next { right: 8px; }
    .leg-lb__nav svg { width: 22px; height: 22px; }
    .leg-lb__image { max-height: calc(100vh - 170px); max-width: 100vw; }
    .leg-lb__strip { padding: 4px 8px; }
    .leg-lb__thumb { flex: 0 0 48px; height: 48px; }
    .leg-lb__bottom { padding: 10px 12px 14px; }
}

/* Hide page scroll when open */
body.leg-lb-open { overflow: hidden; }
