/* ============================================================
   Monkeytoe Popup — bundled styles
   Replaces /wp-content/themes/Divi/.../magnific_popup.css
   No external dependency required.
   ============================================================ */

.mfp-hide {
	display: none !important;
}

/* Hide lightbox content areas on the frontend only (not in the Divi Visual Builder).
   body.et-fb = Visual Builder active; body.et_pb_pagebuilder_layout = preview mode.
   Scoped to body:not(.et-fb) so editors can still see and edit these sections. */
body:not(.et-fb):not(.et_pb_pagebuilder_layout) div:not(.et_mobile_menu) .lightbox-content,
body:not(.et-fb):not(.et_pb_pagebuilder_layout) div:not(.et_mobile_menu) [class*="lightbox-content-"] {
	display: none !important;
}

/* Override: when lightbox content is inside the open popup, always show it.
   Specificity must beat the hide rule above (0,3,1) so we use body + div.mfp-content = (0,3,1). */
body div.mfp-content .lightbox-content,
body div.mfp-content [class*="lightbox-content-"] {
	display: block !important;
}

/* Force inline popup content and its Divi containers to fill the full popup width.
   Divi rows/sections have their own max-width which would otherwise make the content
   narrower than the popup wrapper, leaving a gap where the scrollbar and X button float. */
.mfp-content .lightbox-content,
.mfp-content [class*="lightbox-content-"] {
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
}
.mfp-content .et_pb_section,
.mfp-content .et_pb_row,
.mfp-content .et_block_row {
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
}

/* Z-index notes: Divi 5 header/chrome uses very high z-index values (~99999),
   so popup elements need to be higher. We use 999998+ to stay above. */

/* Overlay background */
.mfp-bg {
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999998;
	overflow: hidden;
	position: fixed;
	background: #0b0b0b;
	opacity: 0.8;
	display: none;
}

/* Main wrapper — scrolls for tall content (forms), giving screen-edge scrollbar */
.mfp-wrap {
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	position: fixed;
	outline: none !important;
	-webkit-backface-visibility: hidden;
	display: none;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* Centering container — flex-start so tall content (forms) starts from the top.
   Video vertical centering is handled by JS margin-top on the wrapper. */
.mfp-container {
	position: relative;
	width: 100%;
	min-height: 100vh;
	padding: 24px 16px;
	box-sizing: border-box;
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

/* Wrapper — holds close button via position:relative */
.mfp-popup-wrapper {
	position: relative;
	width: 100%;
	max-width: 1100px;
	isolation: isolate; /* stacking context keeps X above iframe */
}

/* Reduce Divi row horizontal padding inside popups so form fields get max width */
.mfp-content .et_pb_row,
.mfp-content .et_block_row {
	padding-left: 16px !important;
	padding-right: 16px !important;
}

.mfp-content {
	position: relative;
	width: 100%;
	text-align: left;
}

/* Close button — inside top-right corner of the popup box */
.mt-popup-close {
	width: 36px;
	height: 36px;
	line-height: 36px;
	position: absolute;
	right: 8px;
	top: 8px;
	text-decoration: none;
	text-align: center;
	opacity: 0.9;
	padding: 0;
	color: #fff;
	font-style: normal;
	font-size: 22px;
	font-family: Arial, Baskerville, monospace;
	background: rgba(0, 0, 0, 0.7);
	border: 2px solid rgba(255,255,255,0.3);
	border-radius: 50%;
	cursor: pointer;
	z-index: 1000000;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
	transition: background 0.15s ease, opacity 0.15s ease;
}

.mt-popup-close:hover,
.mt-popup-close:focus {
	opacity: 1;
	background: rgba(0, 0, 0, 0.8);
	outline: none;
}

/* -----------------------------------------------------------------------
   Iframe (video) popup
----------------------------------------------------------------------- */

.mfp-iframe-holder {
	line-height: 0;
	width: 100%;
}

.mfp-iframe-scaler {
	position: relative; /* required so the absolute-positioned iframe is contained */
	width: 100%;
	height: 0;
	overflow: hidden;
	padding-top: 56.25%; /* 16:9 aspect ratio */
}

.mfp-iframe-scaler iframe {
	position: absolute;
	display: block;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
	background: #000;
	pointer-events: auto !important; /* prevent Divi scoped CSS overriding click events */
}

/* -----------------------------------------------------------------------
   Fade animation (mainClass: 'mfp-fade')
----------------------------------------------------------------------- */
.mfp-fade.mfp-bg {
	opacity: 0;
	transition: all 0.15s ease-out;
}

.mfp-fade.mfp-bg.mfp-ready {
	opacity: 0.8;
}

.mfp-fade.mfp-bg.mfp-removing {
	opacity: 0;
}

.mfp-fade.mfp-wrap .mfp-content {
	opacity: 0;
	transition: all 0.15s ease-out;
}

.mfp-fade.mfp-wrap.mfp-ready .mfp-content {
	opacity: 1;
}

.mfp-fade.mfp-wrap.mfp-removing .mfp-content {
	opacity: 0;
}

/* Body cursor state */
.mfp-zoom-out-cur,
.mfp-zoom-out-cur .mfp-image-holder .mt-popup-close {
	cursor: zoom-out;
}

/* -----------------------------------------------------------------------
   Responsive
----------------------------------------------------------------------- */
@media screen and (max-width: 800px) and (orientation: landscape),
       screen and (max-height: 300px) {
	.mfp-iframe-holder .mfp-content {
		max-width: 100%;
	}
}

@media (max-width: 600px) {
	.mfp-container {
		padding: 16px 8px;
	}
}
