/*
 * Modal dialogs.
 */

.site-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.site-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.site-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.site-modal__dialog {
	position: relative;
	width: min(980px, 94vw);
	max-width: 980px;
	max-height: 92vh;
	overflow-y: auto;
	background: #ffffff;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	transform: translateY(20px) scale(0.98);
	transition: transform 0.35s ease;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE */
}

.site-modal__dialog::-webkit-scrollbar {
	display: none; /* Chrome, Edge, Safari */
}

.site-modal.is-open .site-modal__dialog {
	transform: translateY(0) scale(1);
}

.site-modal__close {
	position: absolute;
	top: 12px;
	right: 16px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--color-bg-soft);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	transition: background var(--transition);
	z-index: 1;
}

.site-modal__close:hover {
	background: #eee;
}

.site-modal__content {
	padding: 40px 32px 32px;
}

.site-modal__content h2 {
	margin: 0 0 16px;
	color: var(--color-secondary);
}

.site-modal__body {
	line-height: 1.8;
	color: var(--color-text);
}

.site-modal__image {
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 52vh;
	margin: 0 auto 24px;
	border-radius: var(--radius-md);
	object-fit: contain;
}

@media (max-width: 600px) {
	.site-modal {
		padding: 12px;
	}

	.site-modal__content {
		padding: 36px 20px 24px;
	}

	.site-modal__image {
		max-height: 42vh;
		margin: 0 auto 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-modal,
	.site-modal__dialog {
		transition: none;
	}
}
