/**
 * Promo pop-up (template-parts/layout/promo-popup.php). Loaded only while the pop-up is set to show.
 * The whole graphic fits the screen: the dialog is as wide as the image can be at 720px at most, within the screen
 * width, and within the height left under the close button (--promo-ratio is the image's width / height).
 */
.promo-popup {
	position: fixed;
	inset: 0;
	z-index: 10001; /* above the mobile nav overlay (10000) */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.promo-popup[hidden] {
	display: none;
}

.promo-popup__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgb(0 0 0 / 0.7);
	cursor: pointer;
}

.promo-popup__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.5rem;
	width: min(100%, 720px, calc((100vh - 5.25rem) * var(--promo-ratio, 0.78)));
	width: min(100%, 720px, calc((100dvh - 5.25rem) * var(--promo-ratio, 0.78)));
}

.promo-popup__close {
	display: grid;
	width: 2.75rem;
	height: 2.75rem;
	flex: none;
	place-items: center;
	border-radius: 9999px;
	background-color: #fff;
	color: #2f2e2e;
	font-size: 1.5rem;
	box-shadow: 0 2px 8px rgb(0 0 0 / 0.3);
	cursor: pointer;
}

.promo-popup__close:hover,
.promo-popup__close:focus-visible {
	background-color: #d92d16;
	color: #fff;
}

.promo-popup__link {
	display: block;
	width: 100%;
}

.promo-popup__link:focus-visible,
.promo-popup__close:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.promo-popup__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 0.5rem;
	box-shadow: 0 10px 30px rgb(0 0 0 / 0.4);
}

html.promo-popup-open {
	overflow: hidden;
}
