/* =========================================================
   Portada — bloque de presentación ("Hey!" + texto + foto)
   Se apunta al primer bloque de columnas del contenido de la portada,
   así no hace falta tocar el contenido de la página en la base de datos.
   ========================================================= */

.home .wp-block-post-content > .wp-block-columns:first-child {
	--hv-ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
	--hv-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
	--hv-lilac: var(--wp--preset--color--accent-3); /* #D1D0EA */
	--hv-purple: var(--wp--preset--color--accent-2); /* #442369 */
	--hv-olive: var(--wp--preset--color--accent-1); /* #786D0A */
}

/* ---------- "Hey!" ---------- */

.home .wp-block-post-content > .wp-block-columns:first-child h2 {
	line-height: 1.1 !important;
	margin-block-end: 0.15em;
	animation: hv-hey-in 0.9s var(--hv-ease-pop) both;
}

/* La "!" la envuelve el JS: saluda con un meneo de vez en cuando */
.home .hv-bang {
	display: inline-block;
	transform-origin: 50% 90%;
	color: var(--hv-lilac);
	animation: hv-wave 4s 1.6s ease-in-out infinite;
}

/* ---------- Subtítulo ---------- */

.home .wp-block-post-content > .wp-block-columns:first-child .is-style-text-subtitle {
	font-family: var(--wp--preset--font-family--platypi);
	font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
	line-height: 1.25;
	letter-spacing: -0.01em;
	text-wrap: balance;
	animation: hv-rise 0.8s 0.35s var(--hv-ease-out) both;
}

/* "Fidel Lorite" con subrayado de rotulador que se pinta solo (span lo pone el JS) */
.home .hv-name {
	font-style: italic;
	font-weight: 700;
	white-space: nowrap;
	padding-inline: 0.08em;
	background: linear-gradient(var(--hv-purple), var(--hv-purple)) no-repeat 0 88% / 0% 0.45em;
	animation: hv-marker 0.7s 1.1s var(--hv-ease-out) forwards;
}

/* ---------- Párrafos ---------- */

.home .wp-block-post-content > .wp-block-columns:first-child .wp-block-column:first-child p:not(.is-style-text-subtitle) {
	animation: hv-rise 0.8s var(--hv-ease-out) both;
}
.home .wp-block-post-content > .wp-block-columns:first-child .wp-block-column:first-child p:nth-of-type(2) { animation-delay: 0.55s; }
.home .wp-block-post-content > .wp-block-columns:first-child .wp-block-column:first-child p:nth-of-type(3) { animation-delay: 0.7s; }

/* Enlaces del texto: subrayado lila que se rellena al pasar el ratón */
.home .wp-block-post-content > .wp-block-columns:first-child .wp-block-column:first-child p a {
	text-decoration: none;
	background: linear-gradient(var(--hv-lilac), var(--hv-lilac)) no-repeat 0 100% / 100% 1px;
	transition: background-size 0.3s var(--hv-ease-out), color 0.3s;
}
.home .wp-block-post-content > .wp-block-columns:first-child .wp-block-column:first-child p a:hover,
.home .wp-block-post-content > .wp-block-columns:first-child .wp-block-column:first-child p a:focus-visible {
	background-size: 100% 100%;
	color: var(--wp--preset--color--base);
}

/* ---------- Foto: aparece como una mancha de tinta ----------
   El JS le pone una máscara SVG animada cuando la foto entra en pantalla.
   Mientras tanto está oculta; si el JS no llega a ejecutarse, aparece igual a los 2,5 s. */

.home .wp-block-post-content > .wp-block-columns:first-child .wp-block-image img {
	display: block;
	pointer-events: none; /* ni clic ni ampliación (Jetpack incluido) */
	opacity: 0;
	animation: hv-show 0.6s 2.5s forwards;
}

.home .wp-block-post-content > .wp-block-columns:first-child .wp-block-image img.hv-ink-wait {
	animation: none;
}

.home .wp-block-post-content > .wp-block-columns:first-child .wp-block-image img.hv-ink {
	opacity: 1;
	animation: none;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}

/* ---------- Keyframes ---------- */

@keyframes hv-hey-in {
	0%   { opacity: 0; transform: translateY(0.4em) scale(0.85) skewX(-8deg); }
	100% { opacity: 1; transform: none; }
}

@keyframes hv-show {
	to { opacity: 1; }
}

@keyframes hv-wave {
	0%, 70%, 100% { transform: rotate(0); }
	74% { transform: rotate(14deg); }
	78% { transform: rotate(-10deg); }
	82% { transform: rotate(10deg); }
	86% { transform: rotate(-4deg); }
	90% { transform: rotate(0); }
}

@keyframes hv-rise {
	from { opacity: 0; transform: translateY(1.25rem); }
	to   { opacity: 1; transform: none; }
}

@keyframes hv-marker {
	to { background-size: 100% 0.45em; }
}

/* ---------- Móvil ---------- */

@media (max-width: 781px) {
	.home .wp-block-post-content > .wp-block-columns:first-child h2 {
		font-size: clamp(5rem, 22vw, 8rem) !important;
	}
}

/* ---------- Sin animaciones si el usuario lo pide ---------- */

@media (prefers-reduced-motion: reduce) {
	.home .wp-block-post-content > .wp-block-columns:first-child *,
	.home .wp-block-post-content > .wp-block-columns:first-child .wp-block-image img {
		opacity: 1;
		-webkit-mask: none !important;
		mask: none !important;
	}
	.home .wp-block-post-content > .wp-block-columns:first-child *::before {
		animation: none !important;
		transition: none !important;
	}
	.home .hv-name { background-size: 100% 0.45em; }
}
