:root {
    --subpage-lightbox-backdrop: rgba(8, 8, 10, 0.94);
    --subpage-lightbox-fg: #f6f2ef;
    --subpage-lightbox-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

body.subpage-lightbox-open {
    overflow: hidden !important;
    touch-action: none;
}

img.subpage-zoomable-image {
    cursor: zoom-in !important;
    transition: opacity 180ms ease, filter 180ms ease;
}

a.subpage-lightbox__source-link {
    display: inline-block;
    line-height: 0;
}

img.subpage-zoomable-image:hover {
    filter: brightness(1.03);
}

.subpage-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}

.subpage-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

.subpage-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: var(--subpage-lightbox-backdrop);
    backdrop-filter: blur(8px);
}

.subpage-lightbox__stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1rem;
    touch-action: none;
}

.subpage-lightbox__media-link {
    display: inline-block;
    line-height: 0;
}

.subpage-lightbox__media {
    max-width: none !important;
    max-height: none !important;
    width: auto;
    height: auto;
    box-shadow: var(--subpage-lightbox-shadow);
    user-select: none;
    -webkit-user-drag: none;
    cursor: grab;
    transform-origin: center center;
    will-change: transform;
}

.subpage-lightbox__media.is-click-close {
    cursor: zoom-out;
}

.subpage-lightbox.is-dragging .subpage-lightbox__media {
    cursor: grabbing;
}

.subpage-lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--subpage-lightbox-fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 160ms ease, transform 160ms ease;
    backdrop-filter: blur(8px);
}

.subpage-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.03);
}

.subpage-lightbox__close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.subpage-lightbox__close svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

.subpage-lightbox__hint {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font: 500 0.82rem/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.01em;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

@media (max-width: 900px) {
    .subpage-lightbox__stage {
        padding: 0.5rem;
    }

    .subpage-lightbox__close {
        top: 0.75rem;
        right: 0.75rem;
    }

    .subpage-lightbox__hint {
        bottom: 0.75rem;
        max-width: calc(100vw - 1.5rem);
        text-align: center;
        white-space: normal;
    }
}