/**
 * Modal launcher for [oms_afterword_embed style="..."].
 *
 * Nothing here styles the trigger link itself -- the btn-primary /
 * btn-secondary / cta-link + elementor-button-link classes are supplied
 * by the theme and Elementor, on purpose, so the button matches every
 * other button on the site. This file is only the modal shell.
 */

.oms-ae-modal[hidden] {
	display: none !important;
}

.oms-ae-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2vmin;
	box-sizing: border-box;
}

.oms-ae-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.6 );
}

.oms-ae-modal__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	/* Set per-trigger by oms-ae-launch.js from data-oms-ae-boxed (a % of
	   the viewport, Afterword's data-boxed convention). Falls back to 80. */
	width: var( --oms-ae-boxed-w, 80vw );
	max-width: 96vw;
	height: var( --oms-ae-boxed-h, 80vh );
	max-height: 92vh;
	background: #fff;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.35 );
}

/* Small screens: a % box is unusable, so go near-fullscreen. */
@media ( max-width: 782px ) {
	.oms-ae-modal__dialog {
		width: 96vw;
		height: 92vh;
	}
}

/* Close lives in its own bar above the iframe -- not floated over it, so
   it can't cover any of the planner's UI. */
.oms-ae-modal__header {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 6px;
	background: #fff;
	border-bottom: 1px solid #e2e2e2;
}

.oms-ae-modal__close {
	width: 36px;
	height: 36px;
	padding: 0;
	font-size: 24px;
	line-height: 1;
	text-align: center;
	color: #222;
	background: transparent;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
}

.oms-ae-modal__close:hover,
.oms-ae-modal__close:focus {
	background: #ebebeb;
	color: #000;
}

.oms-ae-modal__body {
	flex: 1 1 auto;
	min-height: 0;
}

.oms-ae-modal__iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

body.oms-ae-modal-open {
	overflow: hidden;
}
