/* MQ pop-ups for Divi (js/mq-popup.js): Divi Section with class "mq-popup" + a CSS ID, opened by links to #that-id. */
body:not(.et-fb) .mq-popup:not(.is-open) {
	display: none !important;
}

.mq-popup.is-open {
	position: fixed !important;
	z-index: 2147483001 !important;
	top: 50% !important;
	left: 50% !important;
	transform: translate(-50%, -50%) !important;
	width: min(720px, calc(100vw - 32px)) !important;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	margin: 0 !important;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-top: 56px;
	padding-bottom: 40px;
	border-radius: 12px;
	box-shadow: 0 24px 64px rgba(10, 30, 60, 0.35);
	outline: none;
}

.mq-popup.is-open .et_pb_row {
	width: 100%;
	max-width: none;
	padding-left: 32px;
	padding-right: 32px;
}

.mq-pop-backdrop {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	background: rgba(10, 25, 45, 0.6);
}

.mq-pop-backdrop[hidden] {
	display: none;
}

html.mq-pop-open,
html.mq-pop-open body {
	overflow: hidden !important;
}

.mq-pop-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 5;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	color: #1d2b3a;
	font: 400 28px/40px Arial, sans-serif;
	text-align: center;
	cursor: pointer;
}

.mq-pop-close:hover,
.mq-pop-close:focus-visible {
	background: #f1f5fa;
	outline: 2px solid #1a6fd0;
}

@media (max-width: 600px) {
	.mq-popup.is-open .et_pb_row {
		padding-left: 20px;
		padding-right: 20px;
	}
}

/* Text links that open a pop-up (class added by mq-popup.js): look like links. Buttons keep their own style. */
a.mq-popup-link:not([class*="btn"]):not([class*="button"]):not(.mq-link) {
	color: #366daa;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

a.mq-popup-link:not([class*="btn"]):not([class*="button"]):not(.mq-link):hover {
	color: #4a90e2;
}

/* Divi Builder: show where the pop-up sections are. */
body.et-fb .mq-popup {
	outline: 2px dashed #e09b00;
	outline-offset: -2px;
}

body.et-fb .mq-popup::before {
	content: "Pop-up section #" attr(id) " - hidden on the page, opens from a link to #" attr(id);
	display: block;
	padding: 6px 12px;
	background: #fff4d6;
	color: #6b4a00;
	font: 600 13px/1.4 Arial, sans-serif;
}
