/* =================================================================
   Hero Block
   Styles: Centrado | Texto + Imagen (split) | Cover + Overlay
   ================================================================= */

/* --- Base --- */
.hero {
	position: relative;
	overflow: hidden;
	min-height: 50vh;
	display: grid;
	background-attachment: scroll;
}

.hero__container {
	position: relative;
	z-index: 1;
}

.wrap_hero_container {
	padding: 0 100px 0 200px;
}

.hero__content {
	max-width: 792px;
	margin-inline: auto;
}

.hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--32);
	align-items: center;
	height: 100%;
}

/* --- Content elements --- */
.hero__tagline {
	margin: 0 0 var(--wp--preset--spacing--2);
	color: inherit;
	opacity: 1;
	font-size: var(--wp--preset--font-size--22);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.hero__title {
	margin: 0 0 var(--wp--preset--spacing--20);
	font-family: var(--wp--preset--font-family--secondary);
	font-size: var(--wp--preset--font-size--28);
	font-weight: 400;
	line-height: 1.3;
	position: relative;
	text-wrap: pretty;
}

.hero__subtitle {
	margin: 0;
	font-family: var(--wp--preset--font-family--primary);
	text-transform: uppercase;
	font-size: clamp(1.125rem, 2vw, 1.25rem);
	opacity: 0.9;
	line-height: 160%;
}

.hero__text {
	margin-bottom: var(--wp--preset--spacing--20);
}

.hero__actions {
	display: flex;
	gap: var(--wp--preset--spacing--8);
	flex-wrap: wrap;
	/* Los botones van entre el logo y el tagline/título */
	margin-bottom: var(--wp--preset--spacing--40);
}

/* --- Padding variants --- */
.hero--py-sm {
	padding-block: var(--wp--preset--spacing--32);
}
.hero--py-md {
	padding-block: var(--wp--preset--spacing--48);
}
.hero--py-lg {
	padding-block: var(--wp--preset--spacing--64);
}

/* --- Background colors --- */
.hero--bg-default {
	background-color: var(--wp--preset--color--white);
}
.hero--bg-light {
	background-color: var(--wp--preset--color--bg-secondary);
}
.hero--bg-dark {
	background-color: var(--wp--preset--color--secondary-dark);
}
.hero--bg-primary {
	background-color: var(--wp--preset--color--primary);
}
.hero--bg-accent {
	background-color: var(--wp--preset--color--secondary);
}

/* --- Text on dark / media backgrounds --- */
.hero--text-light {
	color: var(--wp--preset--color--bg-secondary);
}

.hero--text-light .hero__title {
	color: var(--wp--preset--color--white);
}

.hero--text-light .hero__subtitle,
.hero--text-light .hero__tagline {
	color: var(--wp--preset--color--bg-secondary);
	opacity: 0.9;
}

.hero--text-light .hero__tagline {
	margin-top: 4rem;
}

.hero--text-light .hero__text,
.hero--text-light .hero__text p,
.hero--text-light .hero__text strong,
.hero--text-light .hero__text p strong {
	color: var(--wp--preset--color--bg-secondary);
	/* opacity: 0.85; */
}

/* --- Vertical alignment --- */
.hero--valign-top .hero__grid {
	align-items: start;
}
.hero--valign-center .hero__grid {
	align-items: center;
}
.hero--valign-bottom .hero__grid {
	align-items: end;
}

/* --- Content alignment --- */
.hero--text-center .hero__grid {
	text-align: center;
}

.hero--text-center .hero__actions {
	justify-content: center;
}

/* --- Overlay --- */
.hero__overlay {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-color: var(--wp--preset--color--black);
	pointer-events: none;
}

.hero__overlay--primary {
	background-color: var(--wp--preset--color--primary);
}

/* --- Logo sobre el título --- */
.hero__logo {
	margin: 100px 0 var(--wp--preset--spacing--24);
}

.hero__logo-img {
	display: block;
	width: auto;
	max-width: min(100%, 22rem);
	height: auto;
	margin-inline: auto;
}

.hero:not(.is-style-centered) .hero__logo-img {
	margin-inline: 0;
	margin: 0 auto;
	/* Fluido hasta 420px: con width fijo se salía en móvil y ensanchaba la
	   columna (título y subtítulo cortados). */
	max-width: min(100%, 420px);
	width: 100%;
	filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.25));
}

/* --- Flecha de scroll --- */
.hero__scroll {
	position: absolute;
	z-index: 2;
	right: var(--wp--preset--spacing--16);
	bottom: var(--wp--preset--spacing--24);
	display: none;
	color: var(--wp--preset--color--white);
	text-decoration: none;
	transition: transform var(--wp--custom--motion--duration--base) var(--wp--custom--motion--easing--standard);
}

.hero__scroll:hover,
.hero__scroll:focus-visible {
	color: var(--wp--preset--color--white);
	transform: translateY(0.25rem);
}

.hero__scroll .hero__scroll-icon {
	width: 0.9375rem;
	height: 5rem;
}

/* --- Style: Centrado --- */
.is-style-centered .hero__grid {
	justify-items: center;
	text-align: center;
	max-width: 100%;
	margin-inline: auto;
}

.is-style-centered .hero__actions {
	justify-content: center;
}

/* --- Style: Split (Texto + Imagen) --- */
.is-style-split .hero__media {
	height: 100%;
}

.is-style-split .hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--wp--custom--radius--8);
}

/* --- Form column (independent of style) --- */
.hero__form {
	width: 100%;
	/* background-color: var(--wp--preset--color--white); */
	border-radius: var(--wp--custom--radius--8, 0.5rem);
	padding: 1.5rem 150px 0 0;
	color: var(--wp--preset--color--text);
	box-sizing: border-box;
}

/* The title/description already live in .hero__content — hide the form
   plugin's own heading if its shortcode renders one (e.g. Gravity Forms
   without title="false"/description="false"). */
.hero__form .gform_heading,
.hero__form .wpcf7-form-title {
	display: none;
}

.hero__form  .gfield_checkbox label.gform-field-label {
	color: white;
}

/* --- Style: Overlay (Cover) --- */
.is-style-overlay .hero__content {
	position: relative;
	z-index: 1;
}

/* --- Background image --- */
.hero[style*="background-image"] {
	background-size: cover;
	background-position: center;
}

/* --- Background video --- */
.hero__bg-video {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}

.hero__bg-video-element {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100vw;
	height: 56.25vw;
	min-height: 100%;
	min-width: 177.77vh;
	transform: translate(-50%, -50%);
	object-fit: cover;
	pointer-events: none;
}

.hero__bg-video-placeholder {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.7);
	color: white;
	padding: var(--wp--preset--spacing--16) var(--wp--preset--spacing--32);
	border-radius: var(--wp--custom--radius--8);
	font-size: var(--wp--preset--font-size--14);
	text-align: center;
	z-index: 1;
}

/* =================================================================
   Responsive
   ================================================================= */

/* Tablet (48rem / 768px) */
@media (min-width: 48rem) {
	.hero__scroll {
		display: block;
	}

	.hero--py-sm {
		padding-block: var(--wp--preset--spacing--32);
	}
	.hero--py-md {
		padding-block: var(--wp--preset--spacing--72);
	}
	.hero--py-lg {
		padding-block: var(--wp--preset--spacing--96);
	}

	.is-style-overlay .hero__grid {
		max-width: 66.666%;
	}

	.hero__subtitle {
		font-size: var(--wp--preset--font-size--20);
	}
}

/* Desktop (64rem / 1024px) */
@media (min-width: 64rem) {
	.wrap_hero_container {
		padding: 0 10px 0 20px;
	}
	.hero__form {
		padding: 1.5rem 10px 0 0;
	}

	.is-style-centered .hero__grid {
		max-width: 66.666%;
		margin-inline: auto;
	}

	.is-style-split .hero__grid {
		grid-template-columns: 1fr 1fr;
		gap: var(--wp--preset--spacing--48);
	}

	.is-style-split.hero--img-left .hero__media {
		order: -1;
	}

	.hero--has-form .hero__grid {
		grid-template-columns: 1fr 1fr;
		gap: var(--wp--preset--spacing--48);
	}

	.hero__subtitle {
		font-size: var(--wp--preset--font-size--18);
	}

	.hero__text p {
		font-size: var(--wp--preset--font-size--18);
	}
}

/* Large desktop (80rem / 1280px) */
@media (min-width: 80rem) {
	.is-style-overlay .hero__grid {
		max-width: 50%;
	}

	.is-style-split .hero__grid {
		gap: var(--wp--preset--spacing--64);
	}
}

/* =================================================================
   Accessibility & Performance
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
	.hero__bg-video {
		display: none;
	}
	.hero[style*="background-image"] {
		/* Keep static image, just no video */
	}
}


@media (max-width: 48rem) {
	.wrap_hero_container {
		padding: 0 20px;
	}
	.hero__form {
		padding: 1.5rem 0 0 0;
	}

	/* Botones: nunca más anchos que la pantalla; si no caben, el texto
	   pasa a dos líneas. */
	.hero__actions .btn {
		max-width: 100%;
		padding-inline: 1.25rem;
		white-space: normal;
		text-align: center;
	}
}
/* Solo en el hero: texto y borde en bg-secondary, siempre, con o
   sin el interruptor «Borde». */
.hero :is(.btn--verde, .btn--marron) {
	--btn-fg: var(--wp--preset--color--bg-secondary);
	--btn-fg-hover: var(--wp--preset--color--bg-secondary);
	--btn-border: var(--wp--preset--color--bg-secondary);
	--btn-border-hover: var(--wp--preset--color--bg-secondary);
}

/* El marrón va al 70% de opacidad sobre el fondo y su borde al 90% */
.hero .btn--marron {
	--btn-bg: color-mix(in srgb, var(--wp--preset--color--secondary) 70%, transparent);
	--btn-border: color-mix(in srgb, var(--wp--preset--color--bg-secondary) 90%, transparent);
	--btn-border-hover: color-mix(in srgb, var(--wp--preset--color--bg-secondary) 90%, transparent);
}
