/* ==========================================================================
   Video Banner module — ECE Video Banner plugin
   Paired with includes/VideoBanner.php
   ========================================================================== */

.et_pb_module.ece_video_banner {
	width: 100%;
}

.ece-video-banner__media {
	position: relative;
	width: 100%;
	height: 500px; /* overridden per-breakpoint by the module's generated CSS */
	overflow: hidden;
	background-color: #1a1a1a; /* shows before the poster paints */
}

.ece-video-banner__video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	display: block;
}

.ece-video-banner__overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

/* --- Pause / play control ------------------------------------------------
   Sits bottom-right. Deliberately not hidden until hover: a control that only
   appears on hover is unreachable by touch and easy to miss by keyboard. */

.ece-video-banner__toggle {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;   /* 44px is the minimum comfortable touch target */
	height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .7);
	border-radius: 50%;
	background-color: rgba(0, 0, 0, .55);
	color: #fff;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}

.ece-video-banner__toggle:hover,
.ece-video-banner__toggle:focus-visible {
	background-color: #cc0000;
	border-color: #cc0000;
}

.ece-video-banner__toggle:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

/* Pause glyph: two bars, drawn in CSS so there is no icon-font dependency. */
.ece-video-banner__icon {
	display: block;
	width: 14px;
	height: 16px;
	border-left: 4px solid currentColor;
	border-right: 4px solid currentColor;
	box-sizing: border-box;
}

/* Play glyph: a triangle, swapped in when the video is paused. */
.ece-video-banner__toggle[data-state="paused"] .ece-video-banner__icon {
	width: 0;
	height: 0;
	border-left: 14px solid currentColor;
	border-right: 0;
	border-top: 9px solid transparent;
	border-bottom: 9px solid transparent;
	margin-left: 4px; /* optically centres the triangle in the circle */
}

/* --- Builder-only empty state ------------------------------------------- */

.ece-video-banner__empty {
	margin: 0;
	padding: 24px;
	background-color: #f2f2f2;
	border: 1px dashed #999;
	color: #666;
	font-size: 15px;
	text-align: center;
}

/* --- Reduced motion ------------------------------------------------------
   The script also refuses to autoplay in this case; this is the visual half.
   Playback still works if the visitor presses play themselves. */

@media (prefers-reduced-motion: reduce) {
	.ece-video-banner__toggle {
		/* Make the affordance more prominent, since nothing is moving to
		   suggest there is a video at all. */
		background-color: rgba(0, 0, 0, .75);
	}
}
