.lb {
    position: fixed; inset: 0;
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 220ms ease, visibility 0s linear 220ms;
}
.lb.is-open {
    opacity: 1; visibility: visible;
    transition: opacity 220ms ease, visibility 0s linear 0s;
}
body.lb-open { overflow: hidden; }

.lb__backdrop {
    position: absolute; inset: 0;
    background: rgba(11, 12, 13, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.lb__shell {
    position: relative;
    width: min(1040px, calc(100vw - 140px));
    max-height: calc(100vh - 80px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas:
        "stage"
        "meta"
        "strip";
    gap: 18px;
    color: var(--text-primary);
    transform: scale(0.985);
    transition: transform 260ms cubic-bezier(.16,.01,.4,1);
}
.lb.is-open .lb__shell { transform: scale(1); }

.lb__stage {
    grid-area: stage;
    position: relative;
    min-height: 280px;
    max-height: 54vh;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.lb__stage img,
.lb__stage iframe,
.lb__stage .lb__ph {
    width: 100%; height: 100%;
    display: block;
    object-fit: contain;
    border: 0;
}
.lb__stage .lb__ph { position: absolute; inset: 0; }
.lb__stage--video { aspect-ratio: 16 / 9; min-height: 0; }

.lb__stage--photo {
    aspect-ratio: auto;
    height: min(72vh, 820px);
    max-height: 72vh;
    min-height: 0;
    background: transparent;
}
.lb__stage--photo img {
    width: auto; height: auto;
    max-width: 100%; max-height: 100%;
    border-radius: 12px;
}

.lb__stage.is-loading::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg,
        rgba(239,235,229,0) 0%,
        rgba(239,235,229,0.06) 50%,
        rgba(239,235,229,0) 100%);
    background-size: 200% 100%;
    animation: lb-shimmer 1.2s linear infinite;
    pointer-events: none;
}
@keyframes lb-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.lb__meta {
    grid-area: meta;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 24px;
    padding: 4px 4px;
    min-width: 0;
}
.lb__meta-copy { min-width: 0; }
.lb__title {
    font-family: "ClashDisplay-Medium", Arial, sans-serif;
    font-weight: 600;
    font-size: clamp(20px, calc(0.9vw + 16px), 30px);
    line-height: 1.15;
    margin: 0 0 8px;
    color: var(--text-primary);
}
.lb__desc {
    font-size: 15px;
    line-height: 1.55;
    color: rgba(239, 235, 229, 0.78);
    margin: 0;
}

.lb__title:empty, .lb__desc:empty { display: none; }
.lb__count {
    font-family: "ClashDisplay-Medium", Arial, sans-serif;
    font-size: 11px; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-muted-on-dark);
    white-space: nowrap;
    align-self: end;
    padding-bottom: 3px;
}

.lb__strip-wrap {
    grid-area: strip;
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(239, 235, 229, 0.08);
    padding-top: 18px;
}
.lb__strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(239,235,229,0.18) transparent;
    padding-top: 6px;
    padding-bottom: 4px;
    scroll-behavior: smooth;
}
.lb__strip::-webkit-scrollbar { height: 6px; }
.lb__strip::-webkit-scrollbar-track { background: transparent; }
.lb__strip::-webkit-scrollbar-thumb { background: rgba(239,235,229,0.18); border-radius: 3px; }

.lb__thumb {
    flex: 0 0 auto;
    width: 120px; height: 70px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    background: rgba(239,235,229,0.06);
    cursor: url('../cursor/cursor-pointer.svg?v=4') 15 16, pointer;
    border: 0;
    padding: 0;
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: outline-color 200ms ease, transform 200ms ease, opacity 200ms ease;
    opacity: 0.55;
}
.lb__thumb:hover { opacity: 0.95; transform: translateY(-2px); }
.lb__thumb.is-active {
    opacity: 1;
    outline-color: var(--text-primary);
}
.lb__thumb-ph {
    position: absolute; inset: 0;
}

.lb__thumb--project {
    width: auto;
    min-width: 120px;
    padding: 0 16px;
    gap: 8px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(239, 235, 229, 0.06);
    border: 1px solid rgba(239, 235, 229, 0.16);
    color: var(--text-primary);
    opacity: 0.75;
}
.lb__thumb--project:hover {
    opacity: 1;
    background: var(--text-primary);
    color: var(--text-on-light);
    border-color: var(--text-primary);
}
.lb__thumb--project .lb__icon { width: 16px; height: 12px; flex: 0 0 auto; }
.lb__thumb-project-label {
    font-family: "ClashDisplay-Medium", Arial, sans-serif;
    font-size: 10px; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    white-space: nowrap;
}
.lb__thumb-play {
    position: absolute;
    top: 50%; left: 50%;
    width: 26px; height: 26px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(11,12,13,0.55);
    color: var(--text-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px;
    padding-left: 2px;
}

.lb__btn {
    position: absolute;
    z-index: 2;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(239, 235, 229, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(239, 235, 229, 0.16);
    border-radius: 50%;
    cursor: url('../cursor/cursor-pointer.svg?v=4') 15 16, pointer;
    padding: 0;
    transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.lb__btn:hover {
    background: var(--text-primary);
    color: var(--text-on-light);
    border-color: var(--text-primary);
}
.lb__btn--close {
    top: 24px; right: 24px;
    width: 44px; height: 44px;
}
.lb__btn--close .lb__icon { width: 14px; height: 14px; }
.lb__btn--prev, .lb__btn--next {
    top: 50%;
    transform: translateY(-50%);
    width: 52px; height: 52px;
}
.lb__btn--prev:hover, .lb__btn--next:hover { transform: translateY(-50%) scale(1.04); }
.lb__btn--prev { left: 28px; }
.lb__btn--next { right: 28px; }
.lb__btn--prev .lb__icon { width: 18px; height: 14px; transform: translateX(-1px); }
.lb__btn--next .lb__icon { width: 18px; height: 14px; transform: translateX(1px); }
.lb__btn[disabled] { opacity: 0.3; pointer-events: none; }
.lb__icon { fill: currentColor; color: currentColor; pointer-events: none; }

.sw-photo-card[data-lb-trigger],
.sw-vid-card[data-lb-trigger] {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: url('../cursor/cursor-pointer.svg?v=4') 15 16, pointer;
}
.sw-photo-card[data-lb-trigger]:focus-visible,
.sw-vid-card[data-lb-trigger]:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 4px;
    border-radius: 6px;
}

@media (max-width: 900px) {
    .lb__shell {
        width: calc(100vw - 32px);
        gap: 16px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
    .lb__stage { max-height: 48vh; }
    .lb__stage--photo { height: 56vh; max-height: 56vh; }
    .lb__meta {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }
    .lb__count { align-self: auto; padding-bottom: 0; }
    .lb__btn--close { top: 14px; right: 14px; width: 38px; height: 38px; }
    .lb__btn--prev { left: 8px; width: 40px; height: 40px; }
    .lb__btn--next { right: 8px; width: 40px; height: 40px; }
    .lb__title { font-size: 22px; }
    .lb__desc  { font-size: 14px; }
    .lb__thumb { width: 92px; height: 56px; }
    .lb__thumb--project { width: auto; min-width: 0; padding: 0 12px; }
    .lb__thumb-project-label { font-size: 9px; }
}
