/* Pinch/pan temporal para imagenes compartidas de modales y publicaciones. */
body.modal-image-gesture-active {
    overflow: hidden !important;
}

.character-preview-modal:not([hidden]),
.modal-overlay[id^="mediaModal-"].active,
#postModal.active,
#postModalCompact.active {
    /* Permite scroll vertical del texto, pero evita el pinch nativo del navegador. */
    touch-action: pan-y;
}

.character-preview-modal:not([hidden]) #characterPreviewImage,
.modal-overlay[id^="mediaModal-"].active img.modal-media-content,
.modal-overlay[id^="mediaModal-"].active img.strip-panel-img,
#postModal.active img.modal-media-content,
#postModalCompact.active img.modal-media-content,
.post-card .post-image img,
.post-card-masonry .post-image img {
    /* Un dedo conserva el scroll vertical; el modulo intercepta solo desde dos dedos. */
    touch-action: pan-y !important;
}

.modal-image-gesture-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    overflow: hidden;
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    transition: background 120ms ease;
}

.modal-image-gesture-overlay.active {
    background: rgba(0, 0, 0, 0.76);
}

.modal-image-gesture-content {
    --modal-image-scale: 1;
    --modal-image-x: 0px;
    --modal-image-y: 0px;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    transform: translate(-50%, -50%) translate3d(var(--modal-image-x), var(--modal-image-y), 0) scale(var(--modal-image-scale));
    transform-origin: center center;
    will-change: transform;
}

.modal-image-gesture-content.returning {
    transition: transform 170ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.modal-image-gesture-image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: inherit;
    object-fit: contain !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
}
