/**
 * Media Video — a video overlapping a copy card. The card runs full width
 * (under the video); the video sits on top, taller than the card by the
 * overhang on top & bottom. Copy is padded so it stays on the visible side.
 */

.elementor-column > .elementor-element-populated:has(.elementor-widget-agency-media-video) {
	padding: 0 !important;
}

.aew-media-video {
	--aew-mv-overhang: 30px;   /* video sticks out top & bottom by this much */
	--aew-mv-card-edge: 30px;  /* card sticks out beside the video (left/right) */
	--aew-mv-media-w: 42%;     /* video width (share of the row) */
	--aew-mv-gap: 40px;        /* owned by gap control; space between video and the copy */
	--aew-mv-radius: 40px;     /* owned by media_radius control */
	--aew-mv-panel-bg: #ece8e3;
	width: 100%;
	box-sizing: border-box;
}

.aew-media-video__inner {
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
	box-sizing: border-box;
}

.aew-media-video__row {
	position: relative;
	width: 100%;
}

/* ── Copy card (runs under the video) ──────────────────────────── */
.aew-media-video__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	/* Text alignment — driven by the "Text alignment" control via --aew-mv-align
	   (start | center | end), valid for both align-items and text-align. */
	align-items: var(--aew-mv-align, flex-start);
	text-align: var(--aew-mv-align, left);
	gap: 20px;
	box-sizing: border-box;
	min-height: 360px;
	background-color: var(--aew-mv-panel-bg);
	border-radius: var(--aew-mv-radius);
	/* left padding clears the video (which is inset by card-edge); right side holds the content */
	padding: 56px 56px 56px calc(var(--aew-mv-card-edge) + var(--aew-mv-media-w) + var(--aew-mv-gap));
}

.aew-media-video__row--media-right .aew-media-video__panel {
	padding: 56px calc(var(--aew-mv-card-edge) + var(--aew-mv-media-w) + var(--aew-mv-gap)) 56px 56px;
}

/* ── Video (on top, taller than the card) ──────────────────────── */
.aew-media-video__media {
	position: absolute;
	top: calc(-1 * var(--aew-mv-overhang));
	bottom: calc(-1 * var(--aew-mv-overhang));
	left: var(--aew-mv-card-edge);
	width: var(--aew-mv-media-w);
	z-index: 2;
	border-radius: var(--aew-mv-radius);
	overflow: hidden;
	background: #000;
}

.aew-media-video__row--media-right .aew-media-video__media {
	left: auto;
	right: var(--aew-mv-card-edge);
}

.aew-media-video__trigger {
	position: absolute;
	inset: 0;
	display: block;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.aew-media-video .aew-media-video__poster {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
}

.aew-media-video__embed {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.aew-media-video__embed iframe,
.aew-media-video__embed video {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	object-fit: cover;
}

/* ── Copy ──────────────────────────────────────────────────────── */
.aew-media-video__title {
	/* font-size, font-weight owned by heading_typography control */
	margin: 0;
	font-family: var(--aew-font-heading, 'DM Serif Display', serif);
	line-height: 1.15;
	color: #252f37;
}

.aew-media-video__body {
	/* font-size owned by body_typography control */
	margin: 0;
	font-family: var(--aew-font-body, Poppins, sans-serif);
	line-height: 1.6;
	color: #252f37;
}

.aew-media-video__body p {
	margin: 0 0 1em;
}

.aew-media-video__body p:last-child {
	margin-bottom: 0;
}

.aew-media-video__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 16px 24px;
	border-radius: 8px;
	background-color: var(--e-global-color-aew-cta, #f3c400);
	color: #252f37;
	font-family: var(--aew-font-body, Poppins, sans-serif);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.aew-media-video__button:hover,
.aew-media-video__button:focus-visible {
	opacity: 0.92;
	color: #252f37;
}

/* ── Tablet / mobile: stack (no overlap) ───────────────────────── */
@media (max-width: 1024px) {
	.aew-media-video__media {
		position: relative;
		top: auto;
		bottom: auto;
		left: auto;
		right: auto;
		width: 100%;
		height: 650px;
		margin: 0 0 24px;
	}
	.aew-media-video__panel,
	.aew-media-video__row--media-right .aew-media-video__panel {
		min-height: 0;
		padding: 32px 24px;
		/* Follow the "Text alignment" control; default to center on mobile. */
		text-align: var(--aew-mv-align, center);
		align-items: var(--aew-mv-align, center);
	}
}
