/**
 * Background-video hero.
 *
 * Loaded only on pages that use the [hero_video] shortcode. Sizing, overlay
 * opacity, and the poster image come in as CSS custom properties set inline on
 * .hero-video (see template-parts/hero-video.php).
 */

.hero-video {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--hero-height, 70vh);
	min-height: var(--hero-min-height, 420px);
	overflow: hidden;

	/* Poster is the always-visible fallback: it shows before the video plays,
	   and remains visible whenever the <video> is hidden (mobile / reduced
	   motion). #00a7b9 is the theme's brand teal as a last-resort backdrop. */
	background-color: #00a7b9;
	background-image: var(--hero-poster, none);
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
}

.hero-video__media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
	pointer-events: none;
}

.hero-video__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background-color: rgba(0, 0, 0, var(--hero-overlay, 0.35));
}

.hero-video__content {
	position: relative;
	z-index: 2;
	max-width: 900px;
	padding: 2rem 1.5rem;
	text-align: center;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.hero-video__content :where(h1, h2, h3, p) {
	color: inherit;
}

/* Small screens: skip the video entirely (bandwidth + battery), show poster. */
@media (max-width: 768px) {
	.hero-video__media {
		display: none;
	}
}

/* Honor reduced-motion: no autoplaying video, poster only. */
@media (prefers-reduced-motion: reduce) {
	.hero-video__media {
		display: none;
	}
}
