/*
 * Valuation popup (inc/popup.php, assets/js/popup.js): a white card with the
 * calculator over a dark backdrop, like the lightbox's. The dialog fills
 * the viewport so a click beside the card lands on the dialog itself and
 * closes it, as production's overlay did.
 */
.e-popup {
	box-sizing: border-box;
	width: 100vw;
	max-width: none;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 16px;
	background: transparent;
	border: 0;
	overscroll-behavior: contain;
}

.e-popup[open] {
	display: grid;
	place-items: center;
}

.e-popup::backdrop {
	background-color: rgb(14 14 12 / 0.8);
}

.e-popup__card {
	box-sizing: border-box;
	width: 100%;
	max-width: 720px;
	max-height: calc(100dvh - 32px);
	overflow: auto;
	padding: 24px 16px 16px;
	color: var(--wp--preset--color--text-primary);
	background: var(--wp--preset--color--white);
	border-radius: 4px;
	box-shadow: 0 24px 64px rgb(14 14 12 / 0.24);
}

/* The card takes the focus when the popup opens (no ring on the close
 * button for mouse users); Tab moves on to the button and the form. */
.e-popup__card:focus {
	outline: none;
}

.e-popup__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.e-popup__text {
	min-width: 0;
}

.e-popup__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--h-3);
	line-height: 1.2;
	text-wrap: balance;
}

.e-popup__lead {
	margin: 8px 0 0;
	color: var(--wp--preset--color--text-muted);
	text-wrap: pretty;
}

.e-popup__close {
	display: grid;
	flex-shrink: 0;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: -8px -4px 0 auto;
	padding: 0;
	color: inherit;
	cursor: pointer;
	background: transparent;
	border: 1px solid var(--wp--preset--color--border-cream);
	border-radius: 50%;
	transition: background-color 0.2s ease;
}

.e-popup__close:hover {
	background-color: var(--wp--preset--color--cream);
}

.e-popup__close svg {
	width: 20px;
	height: 20px;
}

@media (min-width: 600px) {

	.e-popup {
		padding: 32px;
	}

	.e-popup__card {
		max-height: calc(100dvh - 64px);
		padding: 32px 32px 24px;
	}
}

@media (prefers-reduced-motion: no-preference) {

	.e-popup[open] .e-popup__card {
		animation: e-popup-in 0.25s ease-out;
	}

	@keyframes e-popup-in {

		from {
			opacity: 0;
			transform: translateY(12px);
		}
	}
}
