.page-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.page-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--primary-color, #263238) 82%, transparent);
    backdrop-filter: blur(6px);
}

.page-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: min(96vw, 1100px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-lightbox__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-height: calc(92vh - 80px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.page-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 80px);
    width: auto;
    height: auto;
    object-fit: contain;
    background: #0f172a;
}

.page-lightbox__close {
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 3;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #111827;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
}

.page-lightbox__close:hover {
    transform: scale(1.05);
    background: #f3f4f6;
}

.page-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.page-lightbox__nav:hover {
    background: #fff;
}

.page-lightbox__nav--prev {
    left: -56px;
}

.page-lightbox__nav--next {
    right: -56px;
}

.page-lightbox__counter {
    margin: 14px 0 0;
    color: #e5e7eb;
    font-size: 14px;
    text-align: center;
}

body.page-lightbox-open {
    overflow: hidden;
}

.page-gallery__item {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    border-radius: 10px;
    overflow: hidden;
}

.page-gallery__item:focus-visible {
    outline: 2px solid var(--primary-color, #2563eb);
    outline-offset: 2px;
}

.dynamic-page-content img[data-page-lightbox] {
    cursor: zoom-in;
    transition: opacity 0.15s ease;
}

.dynamic-page-content img[data-page-lightbox]:hover {
    opacity: 0.92;
}

@media (max-width: 768px) {
    .page-lightbox__nav--prev {
        left: 8px;
    }

    .page-lightbox__nav--next {
        right: 8px;
    }

    .page-lightbox__close {
        top: 8px;
        right: 8px;
    }
}
