.lb-open {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: none;
    color: inherit;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.lb-open:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -4px;
}

.lb-open::after {
    content: '';
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(6, 23, 39, 0.78) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") center / 17px no-repeat;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
    opacity: 0;
    transform: scale(0.9);
    transition:
        opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1),
        transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .lb-open:hover::after,
    .lb-open:focus-visible::after {
        opacity: 1;
        transform: none;
    }
}

@media (hover: none), (pointer: coarse) {
    .lb-open::after {
        width: 30px;
        height: 30px;
        opacity: 0.92;
        transform: none;
    }
}

.pt-shot .lb-open {
    height: 100%;
}

html.lb-lock {
    overflow: hidden;
}

html.lb-lock.lb-gutter {
    scrollbar-gutter: stable;
}

.lb::backdrop {
    background: transparent;
}

.lb[open] {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    background: rgba(5, 12, 20, 0);
    color: #eaf5ff;
    font-family: var(--body);
    touch-action: pan-y pinch-zoom;
    overscroll-behavior: contain;
    transition: background-color 0.22s cubic-bezier(0.23, 1, 0.32, 1);
}

.lb[open].is-open {
    background: rgba(5, 12, 20, 0.95);
}

.lb-top {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 60px;
    padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    opacity: 0;
    transition: opacity 0.22s cubic-bezier(0.23, 1, 0.32, 1);
}

.lb-pager {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lb-count {
    min-width: 3.6em;
    color: #b9d0e3;
    font: 600 0.92rem/1 var(--body);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.lb-btn {
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.lb-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (hover: hover) and (pointer: fine) {
    .lb-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

.lb-btn:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: 2px;
}

.lb-stage {
    display: grid;
    flex: 1;
    min-height: 0;
    place-items: center;
    padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
}

.lb-fig {
    width: 100%;
    min-width: 0;
    margin: 0;
    opacity: 0;
    transform: scale(0.96);
    transition:
        opacity 0.22s cubic-bezier(0.23, 1, 0.32, 1),
        transform 0.22s cubic-bezier(0.23, 1, 0.32, 1);
}

.lb-img {
    display: block;
    width: 100%;
    max-width: min(1600px, calc((100dvh - 168px) * var(--lb-ar, 1.6)));
    height: auto;
    margin: 0 auto;
    aspect-ratio: var(--lb-ar, 1.6);
    border-radius: 10px;
    background: #0b2740;
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
    user-select: none;
    -webkit-user-drag: none;
    transition: opacity 0.12s ease;
}

.lb-img.is-out {
    opacity: 0;
}

.lb-foot {
    display: flex;
    flex: none;
    justify-content: center;
    padding: 8px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    opacity: 0;
    transition: opacity 0.22s cubic-bezier(0.23, 1, 0.32, 1);
}

.lb-cap {
    max-width: 64ch;
    margin: 0;
    color: #b9d0e3;
    font-size: 0.9rem;
    line-height: 1.45;
    text-align: center;
    text-wrap: balance;
}

.lb-title {
    display: block;
    margin-bottom: 2px;
    color: #fff;
    font: 700 1rem/1.3 var(--display);
}

.lb-title:empty {
    display: none;
}

.lb-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.lb.is-open .lb-top,
.lb.is-open .lb-foot {
    opacity: 1;
}

.lb.is-open .lb-fig {
    opacity: 1;
    transform: none;
}

.lb.is-single .lb-pager {
    display: none;
}

@media (min-width: 761px) {
    .lb-stage {
        padding-inline: 88px;
    }

    .lb-pager .lb-btn {
        position: absolute;
        top: 50%;
        width: 52px;
        height: 52px;
        margin-top: -26px;
    }

    .lb-pager .lb-prev {
        left: 20px;
    }

    .lb-pager .lb-next {
        right: 20px;
    }

    .lb-pager {
        position: static;
    }

    .lb-count {
        text-align: left;
    }

    .lb-cap {
        font-size: 0.98rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lb[open],
    .lb-top,
    .lb-foot,
    .lb-fig,
    .lb-img,
    .lb-btn,
    .lb-open::after {
        transition: none;
    }

    .lb-fig {
        transform: none;
    }
}
