/**
 * Hero — video-first layout
 *
 * Full-bleed: width 100% + viewport height + object-fit cover.
 * Do not use isolation/filters on ancestors of <video> — Safari/macOS
 * (esp. Retina iMac) paints a black frame while the video still “plays”.
 *
 * @package esto-es-wm
 */

/* Anula reglas legacy de layout.css (.hero.section-dark con min-height 70vh). */
.hero.hero--video.section-dark {
	position: relative;
	display: block;
	align-items: stretch;
	width: 100%;
	height: auto;
	min-height: 22rem;
	max-height: none;
	padding: 0;
	margin: 0;
	border: 0;
	box-shadow: none;
	outline: none;
	overflow: hidden;
	color: var(--color-white);
	background: transparent !important;
	background-image: none !important;
}

body.home {
	background-color: var(--color-black);
}

.site-main.front-page,
.site-main.front-page .front-page__hero {
	margin: 0;
	padding: 0;
	border: 0;
	box-shadow: none;
	outline: none;
}

/*
 * Full-bleed frame. Explicit height keeps width:100% on every monitor.
 */
.hero--video .hero__media {
	--hero-media-h: clamp(22rem, 62vh, 52rem);
	position: relative;
	z-index: 0;
	width: 100%;
	height: var(--hero-media-h);
	min-height: 22rem;
	max-height: none;
	overflow: hidden;
	background-color: #000;
	border: 0;
	outline: none;
	line-height: 0;
}

@media (max-width: 47.99rem) {
	.hero--video .hero__media {
		--hero-media-h: clamp(24rem, 70vh, 40rem);
	}
}

@media (min-width: 80rem) {
	.hero--video .hero__media {
		--hero-media-h: clamp(28rem, 68vh, 56rem);
	}
}

.hero--video .hero__video,
.hero--video .hero__fallback {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-width: 100%;
	min-height: 100%;
	object-fit: cover;
	object-position: center center;
	border: 0;
	outline: none;
	background: transparent;
}

/*
 * Desktop active video: full-size <video> (no canvas/img paint workaround).
 */
.hero--video .hero__video--desktop {
	display: block !important;
	z-index: 1;
	opacity: 1 !important;
	visibility: visible !important;
}

.hero--video .hero__video--mobile {
	display: block;
	z-index: 0;
	width: 0;
	height: 0;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

@media (max-width: 47.99rem) {
	.hero--video .hero__video--desktop {
		width: 0 !important;
		height: 0 !important;
		min-width: 0 !important;
		min-height: 0 !important;
		overflow: hidden;
		opacity: 0 !important;
		visibility: hidden !important;
		pointer-events: none;
		z-index: 0;
		filter: none;
		transform: none;
	}

	.hero--video .hero__video--mobile {
		inset: 0;
		width: 100% !important;
		height: 100% !important;
		min-width: 100% !important;
		min-height: 100% !important;
		opacity: 1 !important;
		visibility: visible !important;
		pointer-events: none;
		z-index: 1;
		transform: translateZ(0);
		-webkit-transform: translateZ(0);
		filter: opacity(0.999);
		backface-visibility: hidden;
	}
}

.hero--video .hero__fallback {
	z-index: 0;
}

.hero--video.hero--reduced-motion .hero__video,
.hero--video:not(.hero--has-video) .hero__video {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

.hero--video .hero__scrim {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(
		180deg,
		rgb(0 0 0 / 25%) 0%,
		rgb(0 0 0 / 8%) 40%,
		rgb(0 0 0 / 35%) 100%
	);
}

/* Overlays no aportan altura: van encima del media. */
.hero--video .hero__inner {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 0;
	height: auto;
	padding-block: clamp(1.25rem, 4vh, 2.5rem);
	pointer-events: none;
}

.hero--video .hero__brand,
.hero--video .hero__content {
	pointer-events: auto;
}

.hero--video .hero__brand {
	margin-bottom: auto;
	padding-top: 0;
}

.hero--video .hero__logo-image {
	display: block;
	width: auto;
	height: auto;
}

.hero--video .hero__content {
	max-width: 40rem;
}

.hero--video .hero__headline {
	margin: 0 0 var(--space-sm);
	font-size: clamp(1.5rem, 4vw, 2.75rem);
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-heading);
	color: var(--color-white);
}

.hero--video .hero__subheadline {
	margin: 0 0 var(--space-md);
	font-size: clamp(0.9375rem, 2vw, 1.125rem);
	line-height: var(--line-height-base);
	color: var(--fp-hero-subheadline-color, rgb(255 255 255 / 88%));
}

/* ═══════════════════════════════════════════
   UI overlay: CTA + video controls (posicionables por separado)
   ═══════════════════════════════════════════ */
.hero__cta-layer,
.hero__controls-layer {
	position: absolute;
	left: 0;
	right: 0;
	z-index: 3;
	pointer-events: none;
	border: 0;
	outline: none;
	background: transparent;
}

.hero__controls-layer {
	z-index: 4;
}

.hero__cta-row,
.hero__controls-row {
	display: flex;
	align-items: center;
}

.hero__cta-layer .button,
.hero__controls {
	pointer-events: auto;
}

.hero__controls {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	border: 0;
	outline: none;
	background: transparent;
	box-shadow: none;
}

.hero__controls[hidden] {
	display: none;
}

/* Desktop — CTA */
@media (min-width: 48rem) {
	.hero__cta-layer--x-left .hero__cta-row {
		justify-content: flex-start;
	}

	.hero__cta-layer--x-center .hero__cta-row {
		justify-content: center;
	}

	.hero__cta-layer--x-right .hero__cta-row {
		justify-content: flex-end;
	}

	.hero__cta-layer--y-top {
		top: var(--hero-cta-offset, 1.5rem);
	}

	.hero__cta-layer--y-middle {
		top: 50%;
		transform: translateY(-50%);
	}

	.hero__cta-layer--y-bottom {
		bottom: var(--hero-cta-offset, 1.5rem);
	}

	.hero__controls-layer--x-left .hero__controls-row {
		justify-content: flex-start;
	}

	.hero__controls-layer--x-center .hero__controls-row {
		justify-content: center;
	}

	.hero__controls-layer--x-right .hero__controls-row {
		justify-content: flex-end;
	}

	.hero__controls-layer--y-top {
		top: var(--hero-ctrl-offset, 1.5rem);
	}

	.hero__controls-layer--y-middle {
		top: 50%;
		transform: translateY(-50%);
	}

	.hero__controls-layer--y-bottom {
		bottom: var(--hero-ctrl-offset, 1.5rem);
	}

	.hero--video .hero__content {
		max-width: 48rem;
	}
}

/* Mobile — CTA + controls */
@media (max-width: 47.99rem) {
	.hero__cta-layer--mx-left .hero__cta-row {
		justify-content: flex-start;
	}

	.hero__cta-layer--mx-center .hero__cta-row {
		justify-content: center;
	}

	.hero__cta-layer--mx-right .hero__cta-row {
		justify-content: flex-end;
	}

	.hero__cta-layer--my-top {
		top: var(--hero-cta-offset-mobile, 1rem);
	}

	.hero__cta-layer--my-middle {
		top: 50%;
		transform: translateY(-50%);
	}

	.hero__cta-layer--my-bottom {
		bottom: var(--hero-cta-offset-mobile, 1rem);
	}

	.hero__controls-layer--mx-left .hero__controls-row {
		justify-content: flex-start;
	}

	.hero__controls-layer--mx-center .hero__controls-row {
		justify-content: center;
	}

	.hero__controls-layer--mx-right .hero__controls-row {
		justify-content: flex-end;
	}

	.hero__controls-layer--my-top {
		top: var(--hero-ctrl-offset-mobile, 1rem);
	}

	.hero__controls-layer--my-middle {
		top: 50%;
		transform: translateY(-50%);
	}

	.hero__controls-layer--my-bottom {
		bottom: var(--hero-ctrl-offset-mobile, 1rem);
	}
}

/* ─── Botón CTA ─── */
.hero--video .button--hero-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	border: var(--hero-cta-border-width, 2px) solid var(--hero-cta-border-color, var(--color-purple));
	border-radius: var(--hero-cta-radius, var(--radius-pill));
	background: var(--hero-cta-bg, var(--gradient-2));
	color: var(--hero-cta-text, var(--color-white));
	font-weight: var(--font-weight-bold);
	letter-spacing: 0.02em;
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.hero--video .button--cta-bg-transparent {
	background: transparent;
}

.hero--video .button--cta-glow-brand {
	box-shadow: 0 -2px 18px rgb(110 36 229 / 28%), 0 4px 14px rgb(110 36 229 / 18%);
}

.hero--video .button--cta-glow-soft {
	box-shadow: 0 6px 18px rgb(0 0 0 / 35%);
}

.hero--video .button--cta-glow-none {
	box-shadow: none;
}

.button--hero-sm {
	min-height: 2.5rem;
	padding: 0.55rem 1.4rem;
	font-size: 0.8125rem;
}

.button--hero-md {
	min-height: 3rem;
	padding: 0.85rem 1.85rem;
	font-size: var(--font-size-sm);
}

.button--hero-lg {
	min-height: 3.5rem;
	padding: 1.05rem 2.4rem;
	font-size: 1.0625rem;
}

.button--text-uppercase {
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.button--text-none {
	text-transform: none;
}

.button--text-capitalize {
	text-transform: capitalize;
}

.hero--video .button--hero-cta:hover,
.hero--video .button--hero-cta:focus-visible {
	transform: translateY(-1px);
	opacity: 0.95;
}

.hero--video .button--cta-glow-brand:hover,
.hero--video .button--cta-glow-brand:focus-visible {
	box-shadow: 0 12px 32px rgb(110 36 229 / 42%);
	opacity: 1;
}

.hero--video .button--cta-bg-transparent:hover,
.hero--video .button--cta-bg-transparent:focus-visible {
	background-color: var(--hero-cta-border-color, var(--color-purple));
	color: var(--color-white);
}

.button--hero-cta .button__icon {
	width: 1em;
	height: 1em;
	flex: none;
	fill: currentColor;
	transition: transform 0.2s ease;
}

.button--hero-cta:hover .button__icon {
	transform: translateY(2px);
}

.hero__control {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 1px solid rgb(255 255 255 / 45%);
	border-radius: 50%;
	background-color: rgb(0 0 0 / 55%);
	color: var(--color-white);
	cursor: pointer;
	backdrop-filter: blur(4px);
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.hero__control:hover,
.hero__control:focus-visible {
	background-color: rgb(0 0 0 / 80%);
	border-color: var(--color-white);
}

.hero__control:focus-visible {
	outline: 2px solid var(--color-white);
	outline-offset: 2px;
}

.hero__icon {
	width: 1.35rem;
	height: 1.35rem;
	fill: currentColor;
	pointer-events: none;
}

.hero__icon--play,
.hero__icon--sound-on {
	display: none;
}

.hero--paused .hero__icon--pause {
	display: none;
}

.hero--paused .hero__icon--play {
	display: block;
}

.hero--sound-on .hero__icon--sound-off {
	display: none;
}

.hero--sound-on .hero__icon--sound-on {
	display: block;
}

@media (prefers-reduced-motion: reduce) {
	.hero--video .button--hero-cta,
	.hero__control {
		transition: none;
	}
}
