/* Photo Zoom lightbox */

html.pz-open {
    overflow: hidden;
}

.pz-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.94);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    overscroll-behavior: contain;
    -webkit-tap-highlight-color: transparent;
}

.pz-overlay.pz-active {
    opacity: 1;
    visibility: visible;
}

.pz-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
}

.pz-img {
    display: block;
    max-width: 92vw;
    max-height: 84vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
    border-radius: 2px;
    cursor: default;
    user-select: none;
}

.pz-caption {
    margin: 12px 0 0;
    max-width: 80vw;
    max-height: 15vh;
    overflow: auto;
    padding: 0 8px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.pz-caption:empty {
    display: none;
}

.pz-btn {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.pz-btn:hover,
.pz-btn:focus-visible {
    background: rgba(255, 255, 255, 0.26);
    outline: none;
}

.pz-btn:active {
    transform: scale(0.94);
}

.pz-close {
    top: 18px;
    right: 18px;
    font-size: 30px;
}

.pz-prev {
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
}

.pz-next {
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
}

.pz-prev:active,
.pz-next:active {
    transform: translateY(-50%) scale(0.94);
}

.pz-prev[hidden],
.pz-next[hidden] {
    display: none;
}

.pz-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    letter-spacing: 0.04em;
}

/* Кликабельные фото */
.gallery-item__img,
.entry-content img,
.wp-block-image img {
    cursor: zoom-in;
}

/* Ленивая загрузка: мягкая подложка, пока фото не пришло */
.gallery-item__img[loading="lazy"] {
    background-color: rgba(0, 0, 0, 0.04);
}

@media (max-width: 767px) {
    .pz-img {
        max-width: 96vw;
        max-height: 78vh;
    }

    .pz-btn {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }

    .pz-prev {
        left: 8px;
    }

    .pz-next {
        right: 8px;
    }

    .pz-close {
        top: 10px;
        right: 10px;
    }

    .pz-caption {
        max-width: 92vw;
        font-size: 13px;
    }
}
