/* The newsletter popup (inc/newsletter-popup.php), in the look JetPopup gave it. */
/* Doubled class: the popup sits in the footer's Buttons block, whose layout rule zeroes every child's margin —
   and the browser centres a dialog with margin: auto. */
.df-popup.df-popup {
	margin: auto;
}

.df-popup {
	width: 550px;
	max-width: calc(100% - 32px);
	max-height: calc(100% - 32px);
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--contrast, #002134); /* not the footer's white text it sits in */
	overflow: visible;
}

.df-popup[open] {
	display: block;
	animation: df-popup-in .3s ease-out;
}

.df-popup::backdrop {
	background: rgba(0, 0, 0, .07);
}

.df-popup__box {
	position: relative;
	box-sizing: border-box;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 20px;
	border: 3px dashed #ee297c;
	border-radius: 12px;
	background: #fff;
}

.df-popup__box h2 {
	margin: 0;
	padding-right: 36px; /* clear of the close button */
}

.df-popup__close {
	position: absolute;
	top: 20px;
	right: 20px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #f2f2f2;
	color: #000;
	cursor: pointer;
}

.df-popup__close:hover,
.df-popup__close:focus-visible {
	background: #e0e0e0;
}

body:has(.df-popup[open]) {
	overflow: hidden;
}

@keyframes df-popup-in {
	from {
		opacity: 0;
		transform: translateY(40px);
	}
}

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