/**
 * Welcome popup (template-parts/global/popup.php): a photo with a painted
 * edge, then a centred heading, text and button. The accent colour is
 * Customize → Popup → Accent colour, else the brand button colour.
 */

.hm-popup {
	--hm-popup-accent: var(--hm-color-button);

	width: min(520px, calc(100% - 32px));
	max-width: none;
	max-height: calc(100dvh - 48px);
	margin: auto;
	padding: 0;
	overflow: visible;
	border: 0;
	background: none;
	color: var(--hm-color-text);
}

.hm-popup[open] {
	animation: hm-popup-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hm-popup::backdrop {
	background: rgb(6 25 52 / 0.62);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	animation: hm-popup-fade 0.35s ease both;
}

@keyframes hm-popup-in {
	from {
		opacity: 0;
		transform: translateY(18px) scale(0.97);
	}
}

@keyframes hm-popup-fade {
	from {
		opacity: 0;
	}
}

html:has(.hm-popup[open]) {
	overflow: hidden;
}

.hm-popup__card {
	position: relative;
	max-height: calc(100dvh - 48px);
	overflow: auto;
	overscroll-behavior: contain;
	border-radius: 20px;
	background: var(--hm-color-white);
	box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.55);
}

.hm-popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 2px solid var(--hm-color-white);
	border-radius: 50%;
	background: var(--hm-popup-accent);
	color: var(--hm-color-white);
	box-shadow: 0 8px 18px -8px rgb(0 0 0 / 0.5);
	cursor: pointer;
	transition: transform 0.2s ease;
}

.hm-popup__close:hover {
	transform: rotate(90deg);
}

.hm-popup__close svg {
	width: 18px;
	height: 18px;
}

.hm-popup__media {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 20px 20px 0 0;
	background: linear-gradient(135deg, #cfe3fa, #8fbaea);
}

.hm-popup__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Painted band across the bottom of the photo, then the white edge. */
.hm-popup__stroke {
	position: absolute;
	right: 0;
	bottom: -1px;
	left: 0;
	width: 100%;
	height: 34px;
}

.hm-popup__stroke-paint {
	fill: var(--hm-popup-accent);
	opacity: 0.92;
}

.hm-popup__stroke-edge {
	fill: var(--hm-color-white);
}

.hm-popup__body {
	padding: 18px 28px 30px;
	text-align: center;
}

.hm-popup__card > .hm-popup__body:first-of-type {
	padding-top: 44px;
}

.hm-popup__title {
	margin: 0;
	font-family: var(--hm-font-heading);
	font-size: clamp(22px, 1.2vw + 16px, 28px);
	font-weight: 700;
	line-height: 1.2;
	color: #0b2a5e;
	text-wrap: balance;
}

.hm-popup__text {
	max-width: 30em;
	margin: 10px auto 0;
	font-size: 15.5px;
	line-height: 1.55;
	color: #3c4f6b;
	text-wrap: pretty;
}

.hm-popup__btn {
	margin-top: 22px;
	min-height: 50px;
	padding-inline: 30px;
	background: var(--hm-popup-accent);
	color: var(--hm-color-white);
	box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--hm-popup-accent) 70%, #000);
}

.hm-popup__btn:hover {
	background: color-mix(in srgb, var(--hm-popup-accent) 82%, #000);
	color: var(--hm-color-white);
	transform: translateY(-1px);
}

.hm-popup__btn .hm-btn__icon {
	width: 18px;
}

@media (max-width: 479px) {
	.hm-popup__body {
		padding: 14px 20px 24px;
	}

	.hm-popup__text {
		font-size: 15px;
	}

	.hm-popup__btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hm-popup[open],
	.hm-popup::backdrop {
		animation: none;
	}
}
