.image-popup {
	align-items: center;
	background: rgba(0, 0, 0, 0.78);
	box-sizing: border-box;
	display: flex;
	bottom: 0;
	left: 0;
	justify-content: center;
	opacity: 0;
	overflow-y: auto;
	padding: 32px;
	pointer-events: none;
	position: fixed;
	right: 0;
	top: 0;
	transition: opacity 180ms ease;
	visibility: hidden;
	z-index: 2147483647;
}

.image-popup.is-visible {
	opacity: 1;
	pointer-events: auto;
	visibility: visible;
}

.image-popup__dialog {
	box-sizing: border-box;
	max-height: calc(100vh - 32px);
	max-width: 100%;
	position: relative;
	width: auto;
}

.image-popup__link {
	display: block;
}

.image-popup__image {
	border: 0;
	display: block;
	height: auto;
	max-height: calc(100vh - 32px);
	max-width: 100%;
	object-fit: contain;
	width: auto;
}

.image-popup__close {
	align-items: center;
	background: #fff;
	border: 0;
	border-radius: 50%;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
	color: #111;
	cursor: pointer;
	display: flex;
	font: 700 30px/1 Arial, sans-serif;
	height: 42px;
	justify-content: center;
	padding: 0 0 3px;
	position: absolute;
	right: -14px;
	top: -14px;
	width: 42px;
	z-index: 1;
}

.image-popup__close:focus {
	outline: 3px solid #4d90fe;
	outline-offset: 2px;
}

body.image-popup-open {
	overflow: hidden;
}

@media (max-width: 600px) {
	.image-popup {
		padding: 16px;
	}

	.image-popup__dialog,
	.image-popup__image {
		max-height: calc(100vh - 32px);
		max-height: calc(100dvh - 32px);
	}

	.image-popup__close {
		right: -8px;
		top: -8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.image-popup {
		transition: none;
	}
}
