/* =====================================================
   Sky Hero — módulo WPBakery.
   CSS portado de sky-zone-builder/blocks/hero/style.css (mismas clases
   .hvb-*). v0.2.0: el alto ya no usa aspect-ratio sino un alto mínimo
   proporcional con tope (ver .hvb-section).
   ===================================================== */

.hvb-section {
	display: flex;
	flex-direction: row;
	width: 100%;
	/* Alto proporcional al ancho (referencia: 720px a 1440px de ancho) con
	   TOPE en el alto de referencia: en pantallas más anchas se queda en
	   720px en vez de seguir creciendo. Piso de 320px.
	   Es un alto MÍNIMO: si el texto necesita más espacio, el Hero crece
	   en vez de recortarlo.
	   100vw es el respaldo; 100cqw (ancho real del .hvb-wrap) es lo exacto. */
	min-height: max( 320px, min( calc( var( --hvb-height, 720 ) * 1px ), calc( 100vw * var( --hvb-height, 720 ) / 1440 ) ) );
	min-height: max( 320px, min( calc( var( --hvb-height, 720 ) * 1px ), calc( 100cqw * var( --hvb-height, 720 ) / 1440 ) ) );
	position: relative; /* necesario para que .hvb-bg-full y el separador se posicionen bien */
	/* SIN overflow:hidden a propósito: el separador inferior "bloque"
	   necesita poder desbordar a ancho completo de pantalla (mismo fix
	   que se aplicó a la Fila). Lo que sí necesitaba contención (video,
	   carrusel) ya tiene su propio overflow:hidden en .hvb-col--right. */
}

/* Para que el Hero vaya de borde a borde: en la fila de WPBakery elige
   "Estirar fila y contenido (sin rellenos)". */

/* Fondo de TODA la fila (modo "full_row", el default) */
.hvb-bg-full {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-size: cover; /* mantiene la proporción siempre, sin deformar */
	background-repeat: no-repeat;
	pointer-events: none;
}

.hvb-col {
	flex: 0 0 50%;
	width: 50%;
	position: relative;
	z-index: 1; /* por encima de .hvb-bg-full */
}

.hvb-col--left {
	/* Ancho configurable (--hvb-left-w); la media ocupa el resto. */
	flex: 0 0 var( --hvb-left-w, 50% );
	width: var( --hvb-left-w, 50% );
	overflow: visible; /* permite que bg_scale > 100% se proyecte a la derecha (modo "left_column") */
	background-clip: padding-box;
}

.hvb-content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center; /* centra el contenido verticalmente respecto a la col. derecha */
	padding: var( --hvb-col-padding, 60px );
	height: 100%;
	box-sizing: border-box;
}

.hvb-title {
	font-size: var( --hvb-title-size, 56px );
	font-weight: var( --hvb-title-weight, 700 );
	line-height: var( --hvb-title-lh, 1.1 );
	color: var( --hvb-title-color, #000 );
	letter-spacing: var( --hvb-title-spacing, 0 );
	margin: 0 0 var( --hvb-gap-ts, 24px ) 0;
	padding: 0;
}

.hvb-subtitle {
	font-size: var( --hvb-sub-size, 20px );
	font-weight: var( --hvb-sub-weight, 400 );
	line-height: var( --hvb-sub-lh, 1.5 );
	color: var( --hvb-sub-color, #333 );
	letter-spacing: var( --hvb-sub-spacing, 0 );
	margin: 0 0 var( --hvb-gap-sb, 32px ) 0;
	padding: 0;
}

/* Botón: assets/css/button.css (compartido, clase .sz-btn) */

.hvb-col--right {
	flex: 1 1 0;
	width: auto;
	min-width: 0;
	overflow: hidden;
}

/* ── Video ─────────────────────────────────────────── */
.hvb-video-wrap {
	position: relative;
	width: 100%;
	height: 0;
	background: #222;
	overflow: hidden;
}

.hvb-video-wrap iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.hvb-video-placeholder {
	width: 100%;
	height: 100%;
	min-height: 300px;
	background: #333;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hvb-play-icon {
	display: block;
	width: 64px;
	height: 64px;
	border: 2px solid rgba( 255, 255, 255, 0.5 );
	border-radius: 50%;
	position: relative;
}

.hvb-play-icon::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 55%;
	transform: translate( -50%, -50% );
	border-top: 10px solid transparent;
	border-bottom: 10px solid transparent;
	border-left: 16px solid rgba( 255, 255, 255, 0.7 );
}

/* ── Imagen única (nuevo) ──────────────────────────── */
.hvb-media-image,
.hvb-media-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Wrapper que recibe el clip-path (recorte diagonal). Se aplica aquí y no
   en .hvb-col--right para que nunca recorte controles superpuestos (ej.
   las flechas del carrusel, ver .hvb-carousel__clip más abajo). */
.hvb-media-clip {
	width: 100%;
	height: 100%;
	clip-path: var( --hvb-clip, none );
}

/* ── Carrusel (nuevo) ──────────────────────────────── */
.hvb-carousel {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

/* Solo esta capa recibe el clip-path — las flechas/puntos quedan fuera,
   como hermanos sin recortar, superpuestos encima. */
.hvb-carousel__clip {
	width: 100%;
	height: 100%;
	clip-path: var( --hvb-clip, none );
}

.hvb-carousel__track {
	display: flex;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.hvb-carousel__track::-webkit-scrollbar {
	display: none;
}

.hvb-carousel__slide {
	position: relative;
	flex: 0 0 100%;
	overflow: hidden;
	scroll-snap-align: start;
}

.hvb-carousel__slide a,
.hvb-carousel__slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Puntos del Hero: encima de la imagen (el estilo de cada punto está en assets/css/carousel.css) */
.hvb-carousel__dots {
	position: absolute;
	bottom: 18px;
	left: 0;
	right: 0;
	z-index: 3;
	pointer-events: none;
}

.hvb-carousel__dots .sz-car__dot {
	pointer-events: auto;
}

/* ── Tablet + Mobile (≤ 1024px) — Geovani reportó que la versión tablet
   se veía mal en 2 columnas; se apila igual que mobile a partir de acá ── */
@media ( max-width: 1024px ) {
	.hvb-section {
		flex-direction: column;
		min-height: auto; /* apilado: la fila se ajusta al contenido */
	}

	.hvb-col--right {
		min-height: 320px; /* alto propio razonable para el media apilado */
	}

	.hvb-col {
		flex: none;
		width: 100%;
	}

	.hvb-content {
		align-items: center;
		text-align: center;
	}

	.hvb-title,
	.hvb-subtitle {
		text-align: center;
	}

	.hvb-col--left {
		background-size: cover !important;
		background-position: center !important;
	}

	.hvb-col--right {
		width: 100%;
	}
}

/* ── Añadidos del módulo WPBakery ──────────────────── */

/* Contenedor de consulta: permite medir el ancho real del Hero (100cqw) */
.hvb-wrap {
	width: 100%; /* con container-type, sin ancho explícito podría encogerse en filas flex */
	container-type: inline-size;
}

/* Alto de referencia = 0 → alto automático según el contenido (como el plugin original) */
.hvb-section--auto {
	min-height: 320px;
}

/* Escritorio: la imagen/carrusel llenan la columna sin empujar el alto del
   Hero (el alto lo deciden el mínimo proporcional y el texto). */
@media ( min-width: 1025px ) {
	.hvb-col--right[data-media-type="imagen"] > *,
	.hvb-col--right[data-media-type="carrusel"] > * {
		position: absolute;
		inset: 0;
	}
}

/* Separador diagonal: capa absoluta sobre el borde inferior del Hero.
   En la versión Gutenberg quedaba como un hijo más del flex-row y no se veía. */
.hvb-section > .skyzone-row__separator--diagonal {
	position: absolute;
}

/* Enlaces de imagen/carrusel sin subrayado ni borde del tema */
.hvb-media-image,
.hvb-carousel__slide a {
	text-decoration: none;
	border: 0;
}

/* Palabras largas no desbordan la pantalla en móvil */
.hvb-title,
.hvb-subtitle {
	max-width: 100%;
	overflow-wrap: break-word;
}

/* Apilado (≤1024px): la imagen llena el alto mínimo de su columna
   (antes quedaba más baja y se veía el fondo debajo). */
@media ( max-width: 1024px ) {
	.hvb-media-image img,
	.hvb-carousel__slide img {
		min-height: 320px;
	}
}

/* ── Orden al apilar (tablet y móvil) ── */
@media ( max-width: 1024px ) {
	.hvb-section--media-first .hvb-col--right {
		order: -1;
	}
}

/* ── Diapositivas de video (Vimeo) ── */
.hvb-carousel__slide--video {
	background: #000;
	container-type: size;
}

.hvb-slide-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Modo fondo: el video cubre toda la diapositiva (como una imagen con object-fit:cover) */
.hvb-carousel__slide--fondo .hvb-slide-video {
	inset: auto;
	top: 50%;
	left: 50%;
	width: max( 100cqw, 177.78cqh );
	height: max( 100cqh, 56.25cqw );
	transform: translate( -50%, -50% );
	pointer-events: none;
}

/* Portada del video de fondo: se ve mientras carga el reproductor */
.hvb-video-cover,
.hvb-video-cover img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Portada con botón de play (modo reproductor) */
.hvb-video-poster {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: #000;
	cursor: pointer;
}

.hvb-video-poster img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hvb-video-poster__play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.92 );
	color: #1e2033;
	box-shadow: 0 10px 30px rgba( 0, 0, 0, 0.3 );
	transform: translate( -50%, -50% );
	transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.hvb-video-poster__play svg {
	margin-left: 4px;
}

.hvb-video-poster:hover .hvb-video-poster__play,
.hvb-video-poster:focus-visible .hvb-video-poster__play {
	background: var( --sz-arrow-bg-hover, #ff5a00 );
	color: var( --sz-arrow-color-hover, #fff );
	transform: translate( -50%, -50% ) scale( 1.08 );
}

.hvb-video-poster:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -6px;
}

/* Apilado: si todas las diapositivas son videos, necesitan un alto propio */
@media ( max-width: 1024px ) {
	.hvb-carousel__slide--video {
		aspect-ratio: 16 / 9;
		min-height: 320px;
	}
}

/* ── Imagen con versión para móvil (<picture>) ── */
.hvb-media-image picture,
.hvb-carousel__slide picture {
	display: block;
	width: 100%;
	height: 100%;
}

/* ── Posición de los puntos ── */
.hvb-carousel--dots-right .hvb-carousel__dots {
	justify-content: flex-end;
	padding-right: 24px;
}

.hvb-carousel--dots-left .hvb-carousel__dots {
	justify-content: flex-start;
	padding-left: 24px;
}

/* Barra montada: los puntos suben por encima de ella (solo escritorio) */
@media ( min-width: 1025px ) {
	.hvb-wrap--bar-overlap .hvb-carousel__dots {
		bottom: calc( var( --hvb-bar-overlap, 24px ) + 16px );
	}
}

/* Hero tipo "Video" como fondo: sin interacción (no hay controles) */
.hvb-video-wrap--bg iframe {
	pointer-events: none;
}

/* ── Texto en dos colores: *texto* (color propio o el general del tema) ── */
.hvb-title .sz-hl {
	color: var( --hvb-title-hl, var( --sz-hl, #ff5a00 ) );
}

.hvb-subtitle .sz-hl {
	color: var( --hvb-sub-hl, var( --sz-hl, #ff5a00 ) );
}
