/* Site image popup */

.af-site-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 20px;
}

.af-site-popup[hidden] {
	display: none !important;
}

.af-site-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 18, 28, 0.62);
	backdrop-filter: blur(2px);
}

.af-site-popup__dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 480px);
	max-height: min(88vh, 760px);
	overflow: hidden;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
	animation: afSitePopupIn 0.28s ease;
}

.af-site-popup__close {
	position: absolute;
	top: 10px;
	inset-inline-start: 10px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	color: #0f172a;
	font-size: 1.4rem;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
}

.af-site-popup__media {
	display: block;
	line-height: 0;
	background: #e8f9fc;
}

.af-site-popup__link {
	display: block;
	line-height: 0;
}

.af-site-popup__media img {
	display: block;
	width: 100%;
	height: auto;
	max-height: min(80vh, 720px);
	object-fit: contain;
}

body.af-site-popup-open {
	overflow: hidden;
}

@keyframes afSitePopupIn {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (max-width: 640px) {
	.af-site-popup {
		padding: 12px;
		align-items: center;
	}

	.af-site-popup__dialog {
		width: 100%;
		border-radius: 16px;
	}
}
