/* 
 * Biografía Editorial JLP 
 * GSAP + CSS Avanzado (Fluid Typography, Grid Asimétrico, Inline Media) 
 */

:root {
	--jlp-bg-dark: #0a0a0a;
	--jlp-text-dark: #f5f4f0;
	--jlp-bg-light: #f5f4f0;
	--jlp-text-light: #1c1c1c;
	--jlp-accent: #d95a41; /* Terracota caribeño */
	--jlp-font-display: 'Space Grotesk', sans-serif;
	--jlp-font-body: 'Outfit', sans-serif; /* Migrado de Inter a Outfit por Taste-Skill */
}

/* Base override para aislar la página */
.jlp-main {
	background-color: var(--jlp-bg-dark);
	color: var(--jlp-text-dark);
	font-family: var(--jlp-font-body);
	overflow-x: hidden;
	transition: background-color 0.8s ease, color 0.8s ease;
}

.jlp-main.theme-light {
	background-color: var(--jlp-bg-light);
	color: var(--jlp-text-light);
}

.jlp-main.theme-accent {
	background-color: var(--jlp-accent);
	color: var(--jlp-bg-light);
}

.jlp-container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 4vw;
}

/* Hero Monumental con Inline Images */
.jlp-hero {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	position: relative;
	padding: 12vh 6vw 10vh; /* Añadido padding-top para evitar que el admin bar lo tape */
	overflow: hidden;
	box-sizing: border-box;
}

.jlp-title {
	font-family: var(--jlp-font-display);
	font-size: clamp(3.5rem, 10vw, 12rem);
	font-weight: 700;
	line-height: 0.95;
	letter-spacing: -0.04em;
	margin: 0;
	text-transform: uppercase;
	will-change: transform;
	text-wrap: balance;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1vw;
	padding-top: 10px;
}

.jlp-hero-content {
	position: relative;
	z-index: 2;
}

.jlp-hero-bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	overflow: hidden;
}

.jlp-hero-bg-layer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.05); /* Escala extra para evitar bordes blancos por el blur */
}

.jlp-hero-bg-sharp {
	filter: grayscale(50%); /* Base nítida pero sobria */
}

.jlp-hero-bg-blurred {
	filter: blur(8px) grayscale(50%);
	/* Máscara que mantiene el lado izquierdo y centro sólido (blur aplicado), y lo desvanece a transparente en la derecha (dejando ver el sharp) */
	-webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 90%);
	mask-image: linear-gradient(to right, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 90%);
}

.jlp-hero-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(to bottom, rgba(10,10,10,0.6) 0%, rgba(10,10,10,0.9) 100%);
}

.jlp-title-last {
	color: var(--jlp-accent);
	margin-left: 10vw;
	display: inline-block;
	width: 100%; /* Forzar línea nueva en móviles si es necesario */
}

.jlp-subtitle {
	font-size: clamp(1.1rem, 2vw, 1.8rem);
	max-width: 600px;
	margin-top: 4vh;
	line-height: 1.5;
	font-weight: 400;
	opacity: 0.8;
	margin-left: 10vw;
	will-change: transform, opacity;
	text-wrap: pretty;
}

.jlp-scroll-indicator {
	margin-top: 8vh;
	margin-left: 10vw;
	display: flex;
	align-items: center;
	gap: 20px;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-weight: 600;
	opacity: 0.6;
}

.jlp-line {
	width: 60px;
	height: 1px;
	background-color: currentColor;
}

/* Grilla de Capítulos y Sticky Media */
.jlp-chapter {
	padding: 15vh 0;
	position: relative;
}

.jlp-grid {
	display: grid;
	grid-template-columns: 1fr 2.5fr; /* Más espacio para el texto */
	gap: 6vw;
	align-items: start;
}

@media (max-width: 900px) {
	.jlp-grid {
		grid-template-columns: 1fr;
		gap: 3rem;
		display: flex;
		flex-direction: column;
	}
	
	.jlp-sidebar {
		position: relative !important;
		top: 0 !important;
		height: auto !important;
		width: 100% !important;
		margin-bottom: 2rem;
		order: -1; /* Forzar que la imagen siempre vaya arriba en móvil */
	}
	
	.jlp-sticky-media {
		aspect-ratio: 16/9;
	}

	.jlp-title-last, .jlp-subtitle {
		margin-left: 0;
	}
}

.jlp-sidebar {
	position: sticky;
	top: 15vh;
	height: 70vh;
}

.jlp-sticky-media {
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: 12px;
}

.jlp-media-asset {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: grayscale(80%) sepia(10%);
	transition: filter 0.5s ease, transform 0.5s ease;
}

.jlp-media-asset:hover {
	filter: grayscale(0%);
	transform: scale(1.02);
}

.jlp-chap-title {
	font-family: var(--jlp-font-display);
	font-size: clamp(2rem, 4vw, 4rem);
	line-height: 1.1;
	letter-spacing: -0.02em;
	margin: 0;
	text-wrap: balance;
}

/* Tipografía de contenido */
.jlp-content p {
	font-size: clamp(1.1rem, 1.6vw, 2rem); /* Letra reducida 5% aprox */
	line-height: 1.6;
	margin-bottom: 2.5em;
	max-width: 85ch; /* Ancho incrementado */
	font-weight: 400;
	text-wrap: pretty;
}

.jlp-content p.jlp-lead {
	font-size: clamp(1.3rem, 2vw, 2.5rem);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.4;
	max-width: 65ch;
}

.jlp-content strong {
	font-weight: 600;
}

/* Citas inmensas (Breakout) */
.jlp-quote-section {
	padding: 15vh 0;
	position: relative;
}

.jlp-huge-quote {
	margin: 0;
	padding: 0;
	position: relative;
	max-width: 1200px;
}

.jlp-quote-mark {
	font-family: var(--jlp-font-display);
	font-size: clamp(10rem, 25vw, 30rem);
	color: var(--jlp-accent);
	position: absolute;
	top: -0.3em;
	left: -0.1em;
	line-height: 1;
	opacity: 0.2;
	z-index: 0;
}

.jlp-quote-body {
	position: relative;
	z-index: 1;
	font-family: var(--jlp-font-display);
	font-size: clamp(2rem, 5vw, 5rem);
	line-height: 1.1;
	font-weight: 700;
	letter-spacing: -0.03em;
	text-wrap: balance;
}

.jlp-quote-author {
	margin-top: 3rem;
	font-size: clamp(1rem, 1.5vw, 1.5rem);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--jlp-accent);
}

/* Epílogo (Text Mask) */
.jlp-epilogue {
	margin-top: 15vh;
	padding-top: 8vh;
	position: relative;
}

.jlp-mask-container {
	width: 100%;
	text-align: center;
	overflow: hidden;
}

.jlp-mask-text-wrapper {
	position: relative;
	display: inline-block;
	margin: 0;
	width: 100%;
}

.jlp-mask-slide {
	font-family: var(--jlp-font-display);
	font-size: clamp(5rem, 20vw, 25rem);
	font-weight: 700;
	line-height: 0.8;
	letter-spacing: -0.05em;
	background-size: cover;
	background-position: center 30%;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	color: transparent;
	
	/* Comportamiento de capas */
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	opacity: 0;
	animation: mask-fade 20s infinite;
}

/* La primera diapositiva debe dictar el alto del contenedor */
.jlp-mask-slide:nth-child(1) {
	position: relative;
	animation-delay: 0s;
}

.jlp-mask-slide:nth-child(2) { animation-delay: 4s; }
.jlp-mask-slide:nth-child(3) { animation-delay: 8s; }
.jlp-mask-slide:nth-child(4) { animation-delay: 12s; }
.jlp-mask-slide:nth-child(5) { animation-delay: 16s; }

@keyframes mask-fade {
	0%   { opacity: 0; }
	5%   { opacity: 0.9; }
	20%  { opacity: 0.9; }
	25%  { opacity: 0; }
	100% { opacity: 0; }
}

/* Footer Bridge */
.jlp-footer-bridge {
	padding: 10vh 0;
	text-align: center;
}

.jlp-bridge-link {
	font-family: var(--jlp-font-display);
	font-size: clamp(1.5rem, 3vw, 3rem);
	color: inherit;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 20px;
	transition: opacity 0.3s;
	font-weight: 700;
}

.jlp-bridge-link:hover {
	opacity: 0.7;
}

.jlp-bridge-arrow {
	color: var(--jlp-accent);
	transition: transform 0.3s;
}

.jlp-bridge-link:hover .jlp-bridge-arrow {
	transform: translateX(10px);
}
