/**
 * V&J Works Studio — hero de motion typography (portada, body.vj-home).
 *
 * Estilos del escenario y de la barra inferior. La coreografía vive en
 * vj-hero.js; aquí solo la tipografía, las capas y el estado estático.
 *
 * Identidad: la de DESIGN.md (tinta y papel, Fraunces + Archivo, esquinas 0).
 * Estados:
 *   - sin JS / reduced-motion / Save-Data / fallo → composición estática:
 *     el H1 real se muestra como titular a gran escala;
 *   - .is-live → el escenario se anima y el H1 queda solo para lectores de
 *     pantalla (el visitante ve el mismo texto en las escenas).
 */

.wp-block-group.vjt {
	--vjt-top: 5.5rem;
	--vjt-gut: clamp(1.5rem, 5vw, 4rem);
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: minmax(0, 1fr) auto;
	height: min(calc(100vh - var(--vjt-top)), 54rem);
	height: min(calc(100svh - var(--vjt-top)), 54rem);
	min-height: 30rem;
	background: var(--paper);
	border-bottom: 1px solid var(--rule);
	overflow: hidden;
	isolation: isolate;
}
.wp-block-group.vjt > * {
	margin-block: 0;
}

/* ===== Escenario ===== */
.vjt-stage {
	grid-area: 1 / 1;
	position: relative;
	container-type: size;
	overflow: hidden;
	min-height: 0;
	background: var(--paper);
	/* Tamaño de diseño acotado: al alejar el zoom o en pantallas muy anchas el
	   escenario no sigue creciendo (la tipografía se agrandaba respecto al resto
	   de la página); queda centrado con el papel a los lados. */
	width: 100%;
	max-width: 105rem;
	justify-self: center;
}

/* ===== H1 real: titular estático o solo para lectores de pantalla ===== */
.vjt-h1 {
	grid-area: 1 / 1;
	align-self: end;
	position: relative;
	z-index: 1;
	margin: 0;
	padding: 0 var(--vjt-gut) clamp(1.8rem, 5vh, 3.4rem);
	font-size: clamp(2.6rem, 7.6vw, 8rem);
	line-height: 0.98;
	letter-spacing: -0.03em;
	color: var(--ink);
}
.vjt-h1 em {
	display: block;
	font-style: italic;
}
@media (prefers-reduced-motion: no-preference) {
	html.vjt-js .vjt:not(.is-static) .vjt-h1 {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}
@media (prefers-reduced-motion: reduce) {
	.vjt-stage,
	.vjt .vjt-ctl {
		display: none !important;
	}
}

/* ===== Capas de escena ===== */
.vjt-sc {
	--bg: var(--paper);
	--fg: var(--ink);
	--fg-soft: rgba(10, 10, 10, 0.55);
	position: absolute;
	inset: 0;
	overflow: hidden;
	color: var(--fg);
}
.vjt-sc.is-ink {
	--bg: var(--ink);
	--fg: var(--paper);
	--fg-soft: rgba(255, 255, 255, 0.6);
}
.vjt-bgp {
	position: absolute;
	inset: 0;
	background: var(--bg);
	transform-origin: center;
}

/* ===== Palabras ===== */
.vjt-w {
	position: absolute;
	margin: 0;
	line-height: 1;
	pointer-events: none;
	-webkit-user-select: none;
	user-select: none;
}
.vjt-m.is-clip {
	overflow: hidden;
	padding: 0.16em 0.08em 0.2em;
	margin: -0.16em -0.08em -0.2em;
}
.vjt-t {
	display: block;
	white-space: nowrap;
	font-size: 1em;
	font-synthesis: none;
	color: var(--fg);
}
.vjt-l {
	display: inline-block;
}
.vjt-serif {
	font-family: var(--wp--preset--font-family--fraunces);
	font-weight: 400;
	letter-spacing: -0.035em;
	line-height: 0.92;
}
.vjt-ital {
	font-family: var(--wp--preset--font-family--fraunces);
	font-style: italic;
	font-weight: 400;
	letter-spacing: -0.03em;
	line-height: 0.92;
}
.vjt-sans {
	font-family: var(--wp--preset--font-family--archivo);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.26em;
	line-height: 1;
}
.vjt-out {
	font-family: var(--wp--preset--font-family--fraunces);
	font-weight: 400;
	letter-spacing: -0.03em;
	line-height: 0.92;
	color: transparent;
	-webkit-text-stroke: max(1px, 0.011em) var(--fg);
}
.vjt-t.is-v {
	writing-mode: vertical-rl;
}
.vjt-tag .vjt-t {
	letter-spacing: 0.22em;
	color: var(--fg-soft);
}
.vjt-rule {
	position: absolute;
	height: 1px;
	background: var(--fg);
	transform-origin: left center;
	pointer-events: none;
}
.vjt-rule.is-soft {
	background: var(--fg-soft);
}

/* ===== Barra inferior ===== */
.vjt-bar {
	grid-area: 2 / 1;
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 1rem 2.2rem;
	padding: 1.05rem var(--vjt-gut);
	background: var(--paper);
	border-top: 1px solid var(--rule);
}
.vjt-sub {
	margin: 0;
	max-width: 68ch;
	font-size: 0.88rem;
	line-height: 1.5;
	color: var(--mid);
}
.vjt-cta {
	margin: 0 !important;
	gap: 0.7rem;
	flex-wrap: nowrap;
}
.vjt-cta .wp-block-button {
	margin: 0;
}
.vjt-prog {
	position: absolute;
	left: 0;
	right: 0;
	top: -1px;
	height: 2px;
	pointer-events: none;
}
.vjt-prog i {
	display: block;
	height: 100%;
	background: var(--ink);
	transform-origin: left center;
	transform: scaleX(0);
}
.vjt-ctl {
	display: none;
	align-items: center;
	gap: 1.1rem;
}
.vjt.is-live .vjt-ctl {
	display: flex;
}
/* Rótulo de escena: Fraunces cursiva, la misma voz que los titulares animados. */
.vjt-lbls {
	position: relative;
	display: block;
	min-width: 16rem;
	height: 1.3em;
	font-family: var(--wp--preset--font-family--fraunces);
	font-style: italic;
	font-size: 1.1rem;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: var(--ink);
}
.vjt-lbl {
	position: absolute;
	left: 0;
	top: 0;
	white-space: nowrap;
	opacity: 0;
}
/* Botón de pausa: píldora de tinta con una ficha circular de papel que lleva
   el icono. Al pasar el cursor (o enfocar) el relleno de papel barre el botón
   y la ficha se invierte; en pausa, un anillo late alrededor del icono para
   que se note que la animación está detenida. Solo transform y opacity. */
.vjt-pause {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	gap: 0.95rem;
	min-height: 56px;
	padding: 0 1.6rem 0 0.55rem;
	background: var(--ink);
	color: var(--paper);
	border: 1px solid var(--ink);
	border-radius: 999px;
	font-family: var(--wp--preset--font-family--archivo);
	font-size: 0.74rem;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: color 260ms var(--vj3-out, cubic-bezier(0.23, 1, 0.32, 1)), transform 160ms ease;
}
.vjt-pause::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--paper);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 380ms var(--vj3-out, cubic-bezier(0.23, 1, 0.32, 1));
}
.vjt-pause:active {
	transform: scale(0.96);
}
.vjt-pause:focus-visible {
	outline: 3px solid var(--ink);
	outline-offset: 4px;
	color: var(--ink);
}
.vjt-pause:focus-visible::before {
	transform: scaleX(1);
}
.vjt-pause-t {
	padding-right: 0.15rem;
}
/* Ficha circular del icono */
.vjt-ic {
	position: relative;
	flex: none;
	box-sizing: border-box;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0.68rem 0.76rem;
	border-radius: 50%;
	background: var(--paper);
	color: var(--ink);
	transition: background-color 260ms ease, color 260ms ease, transform 340ms var(--vj3-out, cubic-bezier(0.23, 1, 0.32, 1));
}
.vjt-ic-play {
	display: none;
	padding-left: 0.9rem;
}
.vjt-pause.is-paused .vjt-ic-play {
	display: block;
}
.vjt-pause.is-paused .vjt-ic-pause {
	display: none;
}
.vjt-pause:focus-visible .vjt-ic {
	background: var(--ink);
	color: var(--paper);
}
@media (hover: hover) and (pointer: fine) {
	.vjt-pause:hover {
		color: var(--ink);
	}
	.vjt-pause:hover::before {
		transform: scaleX(1);
	}
	.vjt-pause:hover .vjt-ic {
		background: var(--ink);
		color: var(--paper);
		transform: scale(1.08);
	}
}
/* En pausa: anillo que late alrededor de la ficha. */
.vjt-pause.is-paused .vjt-ic::after {
	content: "";
	position: absolute;
	inset: -1px;
	border: 1px solid currentColor;
	border-radius: 50%;
	opacity: 0;
	animation: vjt-ring 1.9s ease-out infinite;
}
@keyframes vjt-ring {
	0% { transform: scale(1); opacity: 0.7; }
	100% { transform: scale(1.55); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.vjt-pause,
	.vjt-pause::before,
	.vjt-ic { transition: none; }
	.vjt-pause.is-paused .vjt-ic::after { animation: none; opacity: 0.5; transform: scale(1.25); }
}

/* ===== Responsive ===== */
/* Hasta 1366 px (móvil, tablet y portátiles pequeños): el párrafo descriptivo
   queda solo para lectores de pantalla (el mensaje lo llevan el titular
   animado y el rótulo); así la barra cabe en una fila y el escenario conserva
   su altura. */
@media (max-width: 1366px) {
	.vjt-sub {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}
@media (min-width: 901px) and (max-width: 1366px) {
	.vjt-bar {
		grid-template-columns: auto minmax(0, 1fr);
	}
	.vjt-ctl {
		justify-self: end;
	}
	/* El rótulo más largo («04 — Lo que buscas») mide ~11 rem; con 16 rem de mínimo los dos botones, el rótulo y la
	   pausa no caben en una fila y el rótulo se monta sobre el botón de Servicios. */
	.vjt-lbls {
		min-width: 11rem;
	}
}
/* Entre 901 y 1020 px ni así caben en una fila: barra apilada (botones arriba; rótulo y pausa debajo), como en móvil. */
@media (min-width: 901px) and (max-width: 1020px) {
	.vjt-bar {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.7rem;
		padding-block: 0.85rem 1rem;
	}
	.vjt-ctl {
		justify-self: stretch;
		justify-content: space-between;
	}
	.vjt-lbls {
		min-width: 0;
		flex: 1;
	}
}
/* Móvil y tablet vertical (hasta 900 px): titular estático más contenido y barra apilada (CTAs, luego rótulo + pausa). */
@media (max-width: 900px) {
	.vjt-h1 {
		font-size: clamp(2.5rem, 12.4vw, 4.4rem);
	}
	.vjt-bar {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.7rem;
		padding-block: 0.85rem 1rem;
	}
	.vjt-cta {
		display: grid !important;
		grid-template-columns: 1fr 1fr;
		width: 100%;
	}
	.vjt-cta .wp-element-button {
		width: 100%;
		padding-inline: 0.7rem;
		font-size: 0.66rem;
		letter-spacing: 0.08em;
		line-height: 1.15;
		text-align: center;
	}
	.vjt-ctl {
		justify-content: space-between;
	}
	.vjt-lbls {
		min-width: 0;
		flex: 1;
	}
}
