/*
 * Gastrototem · Page · Home (hero de portada)
 *
 * Pieza 1: estructura + composición editorial. SIN capa de movimiento (el
 * zoom-scroll de la foto, el desvanecido del texto y el grano son una pieza
 * posterior). Depende de assets/css/base.css.
 *
 * Cero hex literales · cero familias tipográficas literales. Todos los colores y
 * tipografías vienen de tokens.css vía var(--gtt-*); las opacidades del overlay
 * se derivan del token de grafito con color-mix (sin canales RGB literales).
 *
 * OVERLAP sin JS: .gtt-hero es sticky (z-index 0) y .gtt-home-contenido es
 * relative (z-index 1) con fondo papel opaco: al hacer scroll el contenido sube
 * y cubre el hero. El <main id="gtt-content"> (que abre header.php) envuelve a
 * ambos como hermanos; no se abre ningún <main> nuevo.
 */

.gtt-hero {
	/* Padding de la composición (a sangre la foto, con aire el texto). El top
	 * deja paso al header fijo (64/80px) más respiración editorial. */
	--hero-pad-x: var(--gtt-space-6);          /* 24px */
	--hero-pad-top: 80px;                       /* despeja el header móvil + aire */
	--hero-pad-bottom: var(--gtt-space-12);    /* 48px */
	--hero-transition: 180ms ease-out;
	--hero-title-tracking: -0.02em;

	position: sticky;
	top: 0;
	height: 100vh;
	width: 100%;                                /* el <main> es full-width → a sangre */
	z-index: 0;
	overflow: hidden;
	background-color: var(--gtt-color-grafito-900);
	color: var(--gtt-color-papel-100);
}

@media (min-width: 768px) {
	.gtt-hero {
		--hero-pad-x: var(--gtt-space-12);     /* 48px */
		--hero-pad-top: 100px;
		--hero-pad-bottom: var(--gtt-space-16); /* 64px */
	}
}

@media (min-width: 1024px) {
	.gtt-hero {
		--hero-pad-x: var(--gtt-space-16);     /* 64px */
	}
}

/* Foto full-bleed --------------------------------------------------------- */

.gtt-hero__foto {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 70% 50%;                  /* móvil: encuadre inferior-derecho */
	opacity: 0.85;                             /* móvil: foto atenuada sobre el grafito */
	transform-origin: center center;           /* zoom (hero.js) desde el centro */
	will-change: transform;                    /* zoom por scroll → capa de composición */
}

@media (min-width: 768px) {
	.gtt-hero__foto {
		object-position: center;
		opacity: 1;
	}
}

/* Overlay de contraste — solo desktop/tablet; en móvil contrasta la opacidad
 * de la foto. Gradiente grafito derivado del token con color-mix (cero RGB). */
.gtt-hero__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	display: none;
}

@media (min-width: 768px) {
	.gtt-hero__overlay {
		display: block;
		background: linear-gradient(
			0deg,
			color-mix(in srgb, var(--gtt-color-grafito-900) 70%, transparent) 0%,
			color-mix(in srgb, var(--gtt-color-grafito-900) 55%, transparent) 35%,
			color-mix(in srgb, var(--gtt-color-grafito-900) 25%, transparent) 60%,
			transparent 100%
		);
	}
}

/* Grano ------------------------------------------------------------------- */
/* Capa de ruido sutil sobre la foto+overlay y por DEBAJO de la composición de
 * texto (z-index 1, mismo plano que el overlay pero pintada después por ser
 * ::after → queda encima de él; la composición es z-index 2 y manda sobre todo).
 * SVG feTurbulence como data-URI; sin colores literales (ruido en escala neutra),
 * estática (no se anima), pointer-events:none. Se mantiene también con
 * prefers-reduced-motion (es textura, no movimiento). */
.gtt-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	opacity: 0.06;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='gtt-grano'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23gtt-grano)'/%3E%3C/svg%3E");
	background-repeat: repeat;
	background-size: 160px 160px;
}

/* Composición editorial --------------------------------------------------- */

.gtt-hero__contenido {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	padding: var(--hero-pad-top) var(--hero-pad-x) var(--hero-pad-bottom);
	will-change: opacity, transform;           /* desvanecido + parallax (hero.js) */
}

/* Rótulos / kicker / folio: pila mono en mayúsculas, papel. */
.gtt-hero__rotulo,
.gtt-hero__kicker,
.gtt-hero__folio {
	margin: 0;
	font-family: var(--gtt-font-mono);
	font-weight: 400;
	font-size: var(--gtt-text-xs);
	text-transform: uppercase;
	letter-spacing: var(--gtt-tracking-wide);
	color: var(--gtt-color-papel-100);
}

.gtt-hero__cabecera {
	display: flex;
	justify-content: space-between;
	gap: var(--gtt-space-4);
}

@media (max-width: 639px) {
	.gtt-hero__cabecera {
		display: none;
	}
}

.gtt-hero__rotulo {
	color: color-mix(in srgb, var(--gtt-color-papel-100) 75%, transparent);
}

.gtt-hero__composicion {
	margin-top: auto;                          /* empuja la composición al pie */
	max-width: var(--gtt-container-content);
}

.gtt-hero__folio {
	margin-bottom: var(--gtt-space-6);
	color: color-mix(in srgb, var(--gtt-color-papel-100) 75%, transparent);
}

.gtt-hero__kicker {
	margin-bottom: var(--gtt-space-8);
	font-weight: 500;
}

.gtt-hero__titulo {
	margin: 0;
	/* Medida para que el titular rompa en 3 líneas como Lovable, sin <br>:
	 * «Donde otros ven una comida,» / «nosotros leemos» / «tu restaurante.».
	 * Debe ser menor que el cap de .gtt-hero__composicion (64rem) para llegar a
	 * actuar, y por debajo del umbral 2→3 líneas (~13.9em a tamaño máximo, medido
	 * en staging). 13.6em deja la línea 1 completa con margen. «tu restaurante.»
	 * va unido por &nbsp; para caer entero a la 3.ª. En em → escala con el clamp
	 * del tamaño (en móviles estrechos rompe natural en más líneas, deseable). */
	max-width: 13.6em;
	font-family: var(--gtt-font-sans);
	font-weight: 600;
	font-size: var(--gtt-text-4xl);
	line-height: var(--gtt-leading-tight);
	letter-spacing: var(--hero-title-tracking);
	color: var(--gtt-color-papel-100);
}

/* Corrección de marca (MARCA §3.3): «leemos» en serif italic PAPEL, nunca tinta
 * sobre fondo oscuro. El acento lo da la cursiva, no el color. */
.gtt-hero__acento {
	font-family: var(--gtt-font-serif);
	font-style: italic;
	font-weight: 400;
	color: var(--gtt-color-papel-100);
}

.gtt-hero__subtitulo {
	margin: var(--gtt-space-6) 0 0;
	max-width: 34em;
	font-family: var(--gtt-font-sans);
	font-weight: 400;
	font-size: var(--gtt-text-lg);
	line-height: var(--gtt-leading-snug);
	color: var(--gtt-color-papel-100);
}

.gtt-hero__precio {
	font-family: var(--gtt-font-mono);
	font-size: var(--gtt-text-sm);
	letter-spacing: .04em;
	color: var(--gtt-color-papel-100);
	opacity: .85;
	margin: var(--gtt-space-4) 0 0;
}

/* CTAs: sobrios sobre el oscuro. Sin exclamaciones, sin urgencia. */
.gtt-hero__ctas {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--gtt-space-3);
	margin-top: var(--gtt-space-8);
}

.gtt-hero__cta {
	font-family: var(--gtt-font-sans);
	text-decoration: none;
	transition: color var(--hero-transition);
}

.gtt-hero__cta--primario {
	/* El color/fondo/borde/padding del botón vienen de .gtt-boton/.gtt-boton--papel
	 * (primitivos.css); aquí solo se ajusta el ritmo interno del CTA. */
	gap: var(--gtt-space-3);
	font-size: var(--gtt-text-lg);
}

.gtt-hero__cta--secundario {
	font-weight: 400;
	font-size: var(--gtt-text-base);
	color: var(--gtt-color-papel-100);
}

.gtt-hero__cta-flecha {
	display: inline-block;
	font-family: var(--gtt-font-serif);
	font-style: italic;
	transition: transform var(--hero-transition);
}

@media (hover: hover) and (pointer: fine) {
	.gtt-hero__cta--secundario:hover {
		color: var(--gtt-color-papel-50);
	}

	.gtt-hero__cta--primario:hover .gtt-hero__cta-flecha {
		transform: translateX(var(--gtt-space-1));
	}
}

/* Banda inferior ---------------------------------------------------------- */

.gtt-hero__banda {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: var(--gtt-space-4);
	margin-top: var(--gtt-space-12);
	pointer-events: none;
}

/* ========================================================================
 * CONTENIDO · sube por encima del hero (overlap CSS puro)
 * ===================================================================== */

.gtt-home-contenido {
	position: relative;
	z-index: 1;
	background-color: var(--gtt-color-papel-100);
	color: var(--gtt-color-grafito-900);
	padding: var(--gtt-space-24) var(--gtt-space-6);
}

@media (min-width: 768px) {
	.gtt-home-contenido {
		padding-inline: var(--gtt-space-12);
	}
}

@media (min-width: 1024px) {
	.gtt-home-contenido {
		padding-inline: var(--gtt-space-16);
	}
}

/* Sentinel del observer del header: marcador invisible en el tope del contenido. */
.gtt-hero__sentinel {
	display: block;
	width: 1px;
	height: 1px;
}

/* ========================================================================
 * prefers-reduced-motion · accesibilidad sobre estética
 * ===================================================================== */

@media (prefers-reduced-motion: reduce) {
	.gtt-hero__cta,
	.gtt-hero__cta-flecha {
		transition: none;
	}

	/* Sin movimiento: hero.js ya no instala listeners, pero blindamos por si
	 * hubiera estilo inline previo. El grano (::after) NO se toca: es textura. */
	.gtt-hero__foto {
		transform: none !important;
	}

	.gtt-hero__contenido {
		opacity: 1 !important;
		transform: none !important;
	}
}

/* ========================================================================
 * CUERPO DE LA HOME · secciones dentro de .gtt-home-contenido (papel)
 *
 * Cada sección es un <section> bajo el sentinel. Ritmo vertical editorial por
 * margen entre secciones. Medida de lectura acotada por sección. Todo papel/
 * grafito/tinta vía tokens; mono uppercase con --gtt-tracking-wide.
 * ===================================================================== */

.gtt-home-section {
	max-width: var(--gtt-container-content);
}

.gtt-home-section + .gtt-home-section {
	margin-top: var(--gtt-space-24);
}

/* Kicker mono (etiqueta de sección y de estado). */
.gtt-home-kicker {
	margin: 0;
	font-family: var(--gtt-font-mono);
	font-weight: 500;
	font-size: var(--gtt-text-xs);
	text-transform: uppercase;
	letter-spacing: var(--gtt-tracking-wide);
	color: var(--gtt-color-grafito-900);
}

/* Sección 1 · Qué hacemos -------------------------------------------------- */

.gtt-home-lede {
	margin: var(--gtt-space-6) 0 0;
	max-width: 42rem;
	font-family: var(--gtt-font-sans);
	font-weight: 400;
	font-size: var(--gtt-text-lg);
	line-height: var(--gtt-leading-normal);
	color: var(--gtt-color-grafito-900);
}

/* Sección 3 · Precio y zonas (#zonas) -------------------------------------- */

.gtt-home-precio {
	margin: var(--gtt-space-6) 0 0;
	font-family: var(--gtt-font-sans);
	font-weight: 500;
	font-size: var(--gtt-text-2xl);
	line-height: var(--gtt-leading-snug);
	color: var(--gtt-color-grafito-900);
}

/* .gtt-home-link se define con .gtt-enlace en components/primitivos.css:
 * es el mismo enlace de continuación en toda la web (un solo criterio). */

/* Costes → qué incluye: el botón va pegado al precio (otra sección, pero sin
 * el aire completo entre secciones) y más grande que un botón de formulario:
 * es la puerta a /afinacion desde la portada. */
.gtt-home-section--costes + .gtt-home-section--incluye {
	margin-top: var(--gtt-space-8);
}

.gtt-home-incluye {
	max-width: 100%;
	padding: var(--gtt-space-4) var(--gtt-space-8);
	font-size: var(--gtt-text-lg);
}

.gtt-home-zonas-intro {
	margin: var(--gtt-space-6) 0 0;
	font-family: var(--gtt-font-sans);
	font-weight: 400;
	font-size: var(--gtt-text-lg);
	line-height: var(--gtt-leading-normal);
	color: var(--gtt-color-grafito-900);
}

.gtt-home-firma {
	display: flex;
	flex-direction: column;
	gap: var(--gtt-space-4);
	margin-top: var(--gtt-space-8);
}

@media (min-width: 768px) {
	.gtt-home-firma {
		flex-direction: row;
		gap: var(--gtt-space-8);
	}
}
