/*
 * Bizkaired · Movimiento
 * Diseño Denocheydia
 *
 * Automático (no hay que poner clases): todos los widgets de las páginas y del pie aparecen con
 * fade in up al entrar en pantalla, escalonados dentro de cada bloque. Las tarjetas (bz-card)
 * entran como una pieza.
 *
 * Clases opcionales desde Elementor (Avanzado > Clases CSS):
 *   bz-no-anim    ese elemento y lo que contiene no se animan
 *   bz-parallax   imagen que se desplaza suave con el scroll (widget Imagen)
 *   bz-count      número que cuenta desde 0 al aparecer (widget Título con una cifra)
 *   bz-hero       portada: fondo en movimiento continuo, luces de color y entrada del texto
 *
 * Accesibilidad: con "reducir movimiento" activado en el sistema todo queda quieto. La portada
 * tiene un botón para pausar su animación continua (WCAG 2.2.2). Sin JavaScript se ve todo.
 */

:root {
	--bz-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--bz-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
	--bz-reveal-dist: 48px;
	--bz-reveal-dur: 0.8s;
	--bz-stagger: 90ms;
}


/* ============= fade in up al hacer scroll ========================================================== */

html.bz-js [data-bz-reveal] {
	opacity: 0;
	transform: translate3d(0, var(--bz-reveal-dist), 0);
	transition:
		opacity var(--bz-reveal-dur) var(--bz-ease-out),
		transform var(--bz-reveal-dur) var(--bz-ease-out);
	transition-delay: calc(var(--bz-i, 0) * var(--bz-stagger));
	will-change: opacity, transform;
}

html.bz-js [data-bz-reveal].is-in {
	opacity: 1;
	transform: none;
}

/* Al terminar la entrada se limpia para que el hover responda al instante */
html.bz-js [data-bz-reveal].is-done {
	transition-delay: 0ms;
	will-change: auto;
}

/* Imágenes: además de subir, se "destapan" con un leve zoom */
html.bz-js .elementor-widget-image[data-bz-reveal] img {
	transform: scale(1.08);
	transition: transform 1.2s var(--bz-ease-out);
	transition-delay: calc(var(--bz-i, 0) * var(--bz-stagger));
}

html.bz-js .elementor-widget-image[data-bz-reveal].is-in img {
	transform: none;
}

/* Franjas de cinco colores: se dibujan de izquierda a derecha */
html.bz-js .bz-bar {
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.9s var(--bz-ease-out) 0.15s;
}

html.bz-js .bz-bar.is-in {
	transform: scaleX(1);
}



/* El desplazamiento inicial de las animaciones no debe alargar la página por abajo */
.elementor-location-footer {
	overflow: hidden;
}


/* ============= portada ============================================================================= */
/* Entrada de menos de 3 s (barrido de colores + zoom de la foto + texto). Después solo se mueve con   */
/* el ratón y con el scroll, así que no hay movimiento automático continuo y no hace falta botón de   */
/* pausa (WCAG 2.2.2). La capa .bz-hero__media y el barrido los crea motion.js.                        */

.bz-hero {
	overflow: hidden;
}

.bz-hero__media {
	position: absolute;
	inset: -8%;
	z-index: 0;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	will-change: transform, opacity;
	backface-visibility: hidden;
	animation: bz-hero-in 2.6s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

@keyframes bz-hero-in {
	from { opacity: 0; scale: 1.35; }
	to   { opacity: 1; scale: 1.06; }
}

/* La capa de color de Elementor por encima de la foto; el contenido por encima de todo */
.elementor .bz-hero.e-con::before {
	z-index: 1;
}

.bz-hero > .e-con-inner {
	position: relative;
	z-index: 4;
	will-change: transform, opacity;
}

/* Barrido de entrada: cinco barras con los colores del logo cruzan la portada */
.bz-hero__sweep {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	overflow: hidden;
}

.bz-hero__sweep span {
	position: absolute;
	top: -20%;
	bottom: -20%;
	left: -10%;
	width: 34%;
	transform: translate3d(-120%, 0, 0) skewX(-14deg);
	will-change: transform;
	animation: bz-sweep 1.25s cubic-bezier(0.77, 0, 0.175, 1) both;
}

.bz-hero__sweep span:nth-child(1) { background: #E95910; animation-delay: 0.00s; }
.bz-hero__sweep span:nth-child(2) { background: #F39C36; animation-delay: 0.07s; }
.bz-hero__sweep span:nth-child(3) { background: #F9E000; animation-delay: 0.14s; }
.bz-hero__sweep span:nth-child(4) { background: #92BD10; animation-delay: 0.21s; }
.bz-hero__sweep span:nth-child(5) { background: #0A3385; animation-delay: 0.28s; }

@keyframes bz-sweep {
	0%   { transform: translate3d(-120%, 0, 0) skewX(-14deg); }
	100% { transform: translate3d(420%, 0, 0) skewX(-14deg); }
}

/* Luces de color: quietas, se desplazan con el ratón (profundidad) */
.bz-hero__glow {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	overflow: hidden;
	animation: bz-fade 1.6s var(--bz-ease-out) 1.2s both;
}

.bz-hero__glow span {
	position: absolute;
	border-radius: 50%;
	will-change: transform;
	backface-visibility: hidden;
}

.bz-hero__glow span:nth-child(1) {
	width: 700px; height: 700px; right: -200px; top: -200px;
	background: radial-gradient(closest-side, rgba(243, 156, 54, 0.34), rgba(243, 156, 54, 0));
}

.bz-hero__glow span:nth-child(2) {
	width: 600px; height: 600px; right: 14%; bottom: -280px;
	background: radial-gradient(closest-side, rgba(146, 189, 16, 0.26), rgba(146, 189, 16, 0));
}

.bz-hero__glow span:nth-child(3) {
	width: 480px; height: 480px; right: 2%; top: 30%;
	background: radial-gradient(closest-side, rgba(249, 224, 0, 0.18), rgba(249, 224, 0, 0));
}

/* Entrada del texto, después del barrido */
.bz-hero .bz-hero__item {
	animation: bz-rise 1s var(--bz-ease-out) both;
}

.bz-hero .bz-hero__item--1 { animation-delay: 0.95s; }
.bz-hero .bz-hero__item--2 { animation-delay: 1.08s; }
.bz-hero .bz-hero__item--3 { animation-delay: 1.24s; }
.bz-hero .bz-hero__item--4 { animation-delay: 1.38s; }

@keyframes bz-rise {
	from { opacity: 0; transform: translate3d(0, 64px, 0); }
	to   { opacity: 1; transform: none; }
}

.bz-hero .bz-hero__bar {
	transform-origin: left center;
	animation: bz-draw 0.9s var(--bz-ease-out) 0.8s both;
}

@keyframes bz-draw {
	from { transform: scaleX(0); }
	to   { transform: scaleX(1); }
}

/* Indicador para bajar (los enlaces de Elementor son azules: aquí se fuerza el blanco) */
.bz-hero a.bz-hero__scroll {
	position: absolute;
	left: 50%;
	bottom: 116px; /* por encima de la tarjeta de cifras, que monta 88px sobre la portada */
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin-left: -24px;
	border-radius: 50%;
	border: 2px solid #FFFFFF;
	background-color: rgba(7, 31, 82, 0.45);
	color: #FFFFFF !important;
	text-decoration: none;
	box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
	animation: bz-fade 0.8s var(--bz-ease-out) 1.8s both;
	transition: background-color 0.2s var(--bz-ease-out), border-color 0.2s var(--bz-ease-out), color 0.2s var(--bz-ease-out);
}

.bz-hero a.bz-hero__scroll svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
	animation: bz-bounce 1.2s cubic-bezier(0.45, 0, 0.55, 1) 2.2s 2;
}

.bz-hero a.bz-hero__scroll:hover {
	background-color: #F9E000;
	border-color: #F9E000;
	color: #071F52 !important;
}

.bz-hero a.bz-hero__scroll:focus-visible {
	outline: 3px solid #F9E000;
	outline-offset: 3px;
}

@keyframes bz-bounce {
	0%, 100% { transform: translate3d(0, -3px, 0); }
	50%      { transform: translate3d(0, 5px, 0); }
}

@keyframes bz-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@media screen and (max-width: 1024px) {

	.bz-hero a.bz-hero__scroll {
		display: none;
	}

	.bz-hero__glow span:nth-child(2),
	.bz-hero__glow span:nth-child(3) {
		display: none;
	}
}


/* ============= tarjeta de cifras =================================================================== */

.bz-stats {
	position: relative;
	z-index: 5;
}

.bz-stats-card .bz-stat {
	transition: background-color 0.2s var(--bz-ease-out);
}

@media (hover: hover) and (pointer: fine) {
	.bz-stats-card .bz-stat:hover {
		background-color: #F5F7FB !important;
	}
}


/* ============= imágenes ============================================================================ */

.bz-parallax {
	overflow: hidden;
	border-radius: 24px;
}

@supports (animation-timeline: view()) {

	.bz-parallax img {
		scale: 1.16;
		animation: bz-parallax linear both;
		animation-timeline: view();
		animation-range: cover 0% cover 100%;
	}

	@keyframes bz-parallax {
		from { translate: 0 -7%; }
		to   { translate: 0 7%; }
	}
}

.bz-zoom {
	overflow: hidden;
}

.bz-zoom img {
	transition: transform 0.4s var(--bz-ease-out);
}

@media (hover: hover) and (pointer: fine) {

	.bz-card:hover .bz-zoom img {
		transform: scale(1.06);
	}

	.bz-card:hover {
		transform: translate3d(0, -6px, 0);
	}

	html.bz-js .bz-card[data-bz-reveal].is-done {
		transition: opacity 0.2s, transform 0.25s var(--bz-ease-out), border-color 0.2s, box-shadow 0.25s var(--bz-ease-out);
	}
}

/* Logos de la red: aparecen apagados y se encienden al pasar el ratón */
.bz-asoc img {
	opacity: 0.78;
	transition: opacity 0.2s var(--bz-ease-out), transform 0.2s var(--bz-ease-out);
}

.bz-asoc:hover img {
	opacity: 1;
	transform: translate3d(0, -2px, 0);
}


/* ============= editor de Elementor: todo visible y quieto ========================================== */

.elementor-editor-active [data-bz-reveal],
.elementor-editor-active .bz-hero__item,
.elementor-editor-active .bz-hero__bar,
.elementor-editor-active .bz-bar,
.elementor-editor-active .bz-hero__media {
	opacity: 1 !important;
	transform: none !important;
	animation: none !important;
}

.elementor-editor-active .bz-hero__glow,
.elementor-editor-active .bz-hero__sweep,
.elementor-editor-active .bz-hero__scroll {
	display: none !important;
}


/* ============= reducir movimiento ================================================================== */

@media (prefers-reduced-motion: reduce) {

	html.bz-js [data-bz-reveal],
	html.bz-js [data-bz-reveal] img,
	html.bz-js .bz-bar,
	.bz-hero .bz-hero__item,
	.bz-hero .bz-hero__bar,
	.bz-hero__media,
	.bz-parallax img {
		opacity: 1 !important;
		transform: none !important;
		animation: none !important;
		scale: none !important;
		translate: none !important;
		transition: none !important;
	}

	.bz-hero__glow,
	.bz-hero__sweep,
	.bz-hero__scroll svg {
		display: none !important;
	}

	.bz-card:hover {
		transform: none !important;
	}
}
