/* Article image viewer: desktop wheel/drag and mobile pinch zoom. */
html.localsj-image-viewer-open,
body.localsj-image-viewer-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

#bo_v_img img.localsj-zoomable-image,
#bo_v_con img.localsj-zoomable-image {
    cursor: zoom-in;
}

.localsj-image-viewer {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    display: none;
    color: #fff;
    background: rgba(0, 0, 0, .94);
}

.localsj-image-viewer.is-open {
    display: block;
}

.localsj-image-viewer__stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 64px 20px 92px;
    box-sizing: border-box;
    touch-action: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    cursor: zoom-out;
}

.localsj-image-viewer__image {
    display: block;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 156px);
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
    cursor: grab;
}

.localsj-image-viewer__image.is-dragging {
    cursor: grabbing;
}

.localsj-image-viewer__close {
    position: absolute;
    z-index: 3;
    top: max(14px, env(safe-area-inset-top));
    right: 16px;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    color: #fff;
    background: rgba(20, 20, 20, .75);
    font: 400 34px/42px Arial, sans-serif;
    text-align: center;
    cursor: pointer;
}

.localsj-image-viewer__toolbar {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 28px;
    background: rgba(20, 20, 20, .78);
    transform: translateX(-50%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.localsj-image-viewer__toolbar button {
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 0;
    border-radius: 21px;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    font: 700 22px/42px Arial, sans-serif;
    cursor: pointer;
}

.localsj-image-viewer__toolbar button[data-action="reset"] {
    min-width: 58px;
    font-size: 14px;
}

.localsj-image-viewer__scale {
    min-width: 52px;
    font: 500 13px/1 Arial, sans-serif;
    text-align: center;
}

.localsj-image-viewer__hint {
    position: absolute;
    z-index: 2;
    top: max(22px, env(safe-area-inset-top));
    left: 50%;
    max-width: calc(100vw - 150px);
    overflow: hidden;
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
}

@media (max-width: 768px) {
    .localsj-image-viewer__stage {
        padding: 58px 8px 84px;
    }

    .localsj-image-viewer__image {
        max-width: calc(100vw - 16px);
        max-height: calc(100vh - 142px);
    }

    .localsj-image-viewer__hint {
        font-size: 12px;
    }
}
