/**
 * Listing photo lightbox: keep Magnific Popup fixed in the viewport and
 * contained, so the page behind it cannot scroll (especially on iOS Safari).
 * The theme initializes the popup with fixedContentPos:false, which positions
 * the overlay as absolute and lets the page move underneath.
 */
.mfp-bg,
.mfp-wrap {
	position: fixed !important;
	inset: 0 !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	height: 100dvh !important;
	max-height: 100dvh !important;
	overscroll-behavior: contain;
	touch-action: pan-y pinch-zoom;
}

.mfp-wrap {
	overflow: hidden !important;
}

.mfp-container {
	height: 100% !important;
	max-height: 100dvh !important;
}

.mfp-content,
.mfp-figure,
img.mfp-img {
	/* Keep the photo centered in the fixed overlay. */
	margin-left: auto;
	margin-right: auto;
}

img.mfp-img {
	max-height: calc(100dvh - 80px);
}
