/* ==========================================================================
   Sistema de reportajes inmersivos — Onlife
   Versión Elementor. Se carga en las páginas marcadas como reportaje
   (Configuración de página → Reportaje inmersivo) y en el editor siempre que
   haya una Portada de reportaje.

   Las clases rp-* se ponen en Avanzado → Clases CSS, y Elementor las aplica
   al envoltorio del elemento (.elementor-widget-…, .e-con), no a su contenido:
   por eso los selectores de contenido son descendientes y no hijos directos.
   Casi todo va prefijado con .rp para ganar a los estilos globales del Kit y
   a los base de Elementor, pero no a lo que se fije a mano en el panel de
   cada elemento, que debe mandar.

   Principio de base: sin JavaScript la pieza tiene que leerse entera y verse
   bien. Todo lo que depende del script cuelga de la clase .rp-js, que añade el
   propio script al arrancar. Si el JS falla, no se rompe: se degrada.
   ========================================================================== */

.rp,
.rp-hero {
	--rp-fondo:        #0b0f17;
	--rp-fondo-suave:  #131a26;
	--rp-acento:       #e10600;
	--rp-dorado:       #8c6b4f;
	--rp-dorado-claro: #d8b48a;
	--rp-texto:        #f1f5f9;
	--rp-texto-suave:  #9aa6b6;

	/* Las familias se declaran aquí para poder cambiarlas en un solo sitio.
	   Cárgalas desde Elementor (Ajustes del sitio → Fuentes personalizadas,
	   o con "Cargar fuentes de Google localmente" en Ajustes → Rendimiento) o
	   en local; este archivo no importa nada de Google Fonts a propósito. */
	--rp-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
	--rp-texto-familia: 'Barlow Semi Condensed', 'Helvetica Neue', Arial, sans-serif;

	--rp-ancho: 52rem;
	--rp-curva: cubic-bezier(.2, .8, .2, 1);
}

/* overflow-x: clip y no hidden. Zeffir pone overflow-x: hidden en <html>, y
   con eso el overflow del <body> deja de propagarse a la ventana: un hidden
   aquí convertiría el body en contenedor de scroll y la portada sticky
   dejaría de pegarse. clip recorta sin crear contenedor de scroll. */
.rp {
	background: var(--rp-fondo);
	color: var(--rp-texto);
	overflow-x: clip;
}

/* Elementor y Zeffir centran el contenido; estos elementos se salen a ancho
   completo. En un contenedor de Elementor es más limpio usar el ancho de
   contenido "Ancho completo", pero la clase sigue funcionando. */
.rp-hero,
.rp .rp-sangre {
	width: 100vw;
	max-width: none;
	margin-left: calc(50% - 50vw);
	margin-right: 0;
}

/* --------------------------------------------------------------------------
   1. Hero
   -------------------------------------------------------------------------- */

.rp-hero {
	position: relative;
	height: 100vh;                 /* sin JS, una sola pantalla */
}

.rp-js .rp-hero {
	height: calc(var(--rp-pasos, 1) * 100vh);
}

.rp-hero__escenario {
	position: sticky;
	top: 0;
	height: 100vh;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Degradado inferior que cose el hero con el primer capítulo. */
.rp-hero__escenario::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 240px;
	z-index: 3;
	pointer-events: none;
	background: linear-gradient(to bottom, transparent 0%, var(--rp-fondo) 100%);
}

.rp-hero__capas {
	position: absolute;
	inset: 0;
}

.rp-hero__capa {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	transform: scale(1.03);
	opacity: 0;
	transition: opacity 1.2s ease;
}

.rp-hero__capa.is-activa {
	opacity: 1;
	z-index: 1;
}

/* Oscurecido progresivo: el JS mueve --rp-oscurecer de 0 a 1 según el scroll. */
.rp-hero__capas::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: rgba(3, 6, 12, calc(var(--rp-oscurecer, 0) * .55));
	transition: background .2s linear;
}

.rp-hero__grano {
	position: absolute;
	inset: 0;
	z-index: 2;
	opacity: .18;
	pointer-events: none;
	background-image:
		radial-gradient(circle at 20% 20%, rgba(255,255,255,.05) 0%, transparent 40%),
		radial-gradient(circle at 80% 40%, rgba(255,255,255,.04) 0%, transparent 45%);
}

.rp-hero__texto {
	position: relative;
	z-index: 4;
	width: min(90%, 60rem);
	text-align: center;
	transition: opacity .6s var(--rp-curva), transform .6s var(--rp-curva);
}

.rp-hero.is-saliendo .rp-hero__texto {
	opacity: 0;
	transform: translateY(-60px) scale(1.08);
}

.rp-hero__kicker {
	font-family: var(--rp-texto-familia);
	font-size: clamp(13px, 1.4vw, 16px);
	font-weight: 600;
	letter-spacing: .28em;
	text-transform: uppercase;
	color: var(--rp-dorado-claro);
	margin: 0 0 1.2em;
}

.rp-hero__titulo {
	font-family: var(--rp-display);
	font-size: clamp(52px, 8vw, 130px);
	line-height: .92;
	font-weight: 600;
	letter-spacing: -.02em;
	text-transform: uppercase;
	color: #fff;
	margin: 0;
	text-shadow: 0 10px 40px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.35);
}

.rp-hero__titulo span {
	display: block;
	font-size: clamp(26px, 3vw, 60px);
	margin-bottom: .35em;
	letter-spacing: 0;
	opacity: .92;
}

.rp-hero__subtitulo {
	font-family: var(--rp-texto-familia);
	font-size: clamp(17px, 2vw, 24px);
	line-height: 1.45;
	color: var(--rp-texto-suave);
	max-width: 42rem;
	margin: 1.4em auto 0;
}

.rp-hero__aviso {
	position: absolute;
	left: 50%;
	bottom: 40px;
	z-index: 4;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	font-family: var(--rp-texto-familia);
	font-size: 12px;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: rgba(255,255,255,.65);
	transition: opacity .4s ease;
}

.rp-hero.is-saliendo .rp-hero__aviso {
	opacity: 0;
}

.rp-hero__raton {
	width: 22px;
	height: 34px;
	border: 1px solid rgba(255,255,255,.5);
	border-radius: 999px;
	position: relative;
}

.rp-hero__raton::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 7px;
	width: 3px;
	height: 7px;
	margin-left: -1.5px;
	border-radius: 999px;
	background: #fff;
	animation: rp-raton 1.8s var(--rp-curva) infinite;
}

@keyframes rp-raton {
	0%   { opacity: 0; transform: translateY(0); }
	35%  { opacity: 1; }
	100% { opacity: 0; transform: translateY(11px); }
}

/* --------------------------------------------------------------------------
   2. Barra de progreso y navegación de capítulos (las crea el JS)
   -------------------------------------------------------------------------- */

.rp-progreso {
	position: fixed;
	top: 0;
	left: 0;
	width: 0;
	height: 4px;
	z-index: 9999;
	background: var(--rp-acento);
	transition: width .15s linear;
}

.rp-nav {
	position: fixed;
	right: 22px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 9998;
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rp-nav__punto {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 1px solid rgba(255,255,255,.45);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: background .25s ease, transform .25s ease, border-color .25s ease;
}

.rp-nav__punto:hover,
.rp-nav__punto:focus-visible {
	border-color: #fff;
	transform: scale(1.25);
}

.rp-nav__punto.is-activo {
	background: var(--rp-acento);
	border-color: var(--rp-acento);
	transform: scale(1.3);
}

@media (max-width: 900px) {
	.rp-nav { display: none; }
}

/* --------------------------------------------------------------------------
   3. Capítulos
   -------------------------------------------------------------------------- */

.rp .rp-capitulo {
	padding-block: clamp(70px, 11vw, 150px);
}

.rp .rp-kicker {
	position: relative;
	display: flex;
	align-items: center;
	gap: 18px;
	font-family: var(--rp-display);
	font-size: clamp(20px, 4vw, 30px);
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--rp-dorado-claro);
	margin-bottom: 24px;
}

.rp .rp-kicker :is(p, h1, h2, h3, h4, h5, h6) {
	margin: 0;
	font: inherit;
	color: inherit;
}

.rp .rp-kicker::before {
	content: "";
	flex: 0 0 auto;
	width: 64px;
	height: 6px;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--rp-dorado) 0%, var(--rp-dorado-claro) 100%);
	box-shadow: 0 0 18px rgba(140,107,79,.3);
}

.rp .rp-kicker::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: linear-gradient(90deg, rgba(255,255,255,.35), transparent);
}

/* Titulares de capítulo: grandes de verdad, que es lo que da el aire editorial. */
.rp .rp-capitulo h2,
.rp .rp-capitulo h2.elementor-heading-title {
	font-family: var(--rp-display);
	font-size: clamp(36px, 5vw, 82px);
	line-height: .95;
	font-weight: 600;
	color: #fff;
	max-width: 900px;
	margin-bottom: 28px;
}

.rp .rp-cuerpo {
	font-family: var(--rp-texto-familia);
	font-size: clamp(18px, 1.35vw, 21px);
	line-height: 1.72;
	color: var(--rp-texto);
	max-width: var(--rp-ancho);
}

.rp .rp-cuerpo p {
	margin-bottom: 1.5em;
	color: inherit;
	font: inherit;
}

/* Capitular. Se aplica al primer párrafo del widget, no a todos. */
.rp .rp-cuerpo--capitular p:first-of-type {
	border-left: 3px solid var(--rp-dorado);
	padding: 4px 0 4px 24px;
}

.rp .rp-cuerpo--capitular p:first-of-type::first-letter {
	float: left;
	font-family: var(--rp-texto-familia);
	font-size: 6.2rem;
	line-height: .72;
	font-weight: 800;
	color: var(--rp-dorado-claro);
	padding-right: .12em;
	padding-bottom: .04em;
}

/* Destacado dentro del texto. */
.rp .rp-destacado {
	font-family: var(--rp-display);
	font-size: clamp(26px, 3.4vw, 46px);
	line-height: 1.16;
	color: #fff;
	max-width: 46rem;
	margin-block: clamp(40px, 6vw, 80px);
	padding-left: 28px;
	border-left: 4px solid var(--rp-acento);
}

/* --------------------------------------------------------------------------
   4. Foto editorial
   -------------------------------------------------------------------------- */

/* En un contenedor "en caja" Elementor mete los hijos en .e-con-inner: el pie
   se posiciona respecto a ese, no al contenedor exterior con su relleno. */
.rp .rp-figura,
.rp .rp-figura > .e-con-inner {
	position: relative;
}

.rp-figura .rp-figura__img {
	position: relative;
	margin: 0;
	box-shadow: 0 30px 80px rgba(0,0,0,.45);
}

.rp-figura .rp-figura__img img {
	display: block;
	width: 100%;
	height: auto;
}

.rp-figura .rp-figura__img::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(to top,
		rgba(3,6,12,.85) 0%,
		rgba(3,6,12,.25) 35%,
		transparent 60%);
}

.rp-figura .rp-figura__pie {
	position: absolute;
	left: clamp(18px, 3vw, 40px);
	bottom: clamp(18px, 2.6vw, 36px);
	z-index: 2;
	max-width: min(600px, 80%);
	font-family: var(--rp-texto-familia);
	font-size: clamp(16px, 1.6vw, 22px);
	line-height: 1.25;
	font-weight: 500;
	color: #fff;
}

.rp-figura .rp-figura__pie p {
	margin: 0;
	color: inherit;
}

.rp-figura .rp-figura__pie strong,
.rp-figura .rp-figura__pie .rp-etiqueta {
	display: inline-block;
	margin-bottom: 9px;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--rp-acento);
	font-size: .78em;
	font-weight: 500;
	letter-spacing: .12em;
	text-transform: uppercase;
}

/* En móvil el pie sobre la imagen se come la foto: se baja debajo. */
@media (max-width: 640px) {
	.rp-figura .rp-figura__pie {
		position: static;
		max-width: none;
		margin-top: 14px;
		padding-inline: 18px;
	}

	.rp-figura .rp-figura__img::after {
		display: none;
	}
}

/* --------------------------------------------------------------------------
   5. Imágenes ampliables
   -------------------------------------------------------------------------- */

.rp-js .rp-zoom img {
	cursor: zoom-in;
	transition: transform .3s ease;
}

.rp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(3,6,12,.94);
	opacity: 0;
	transition: opacity .25s ease;
}

.rp-lightbox.is-abierto {
	opacity: 1;
}

.rp-lightbox img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.rp-lightbox__cerrar {
	position: absolute;
	top: 18px;
	right: 20px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255,255,255,.12);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

/* --------------------------------------------------------------------------
   6. Entradas animadas
   -------------------------------------------------------------------------- */

.rp-js .rp-reveal {
	opacity: 0;
	transform: translateY(80px) scale(.98);
}

.rp-js .rp-reveal.is-visible {
	opacity: 1;
	transform: none;
	transition: opacity 1.2s var(--rp-curva), transform 1.2s var(--rp-curva);
}

/* --------------------------------------------------------------------------
   7. Accesibilidad y modo nativo
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.rp-js .rp-reveal,
	.rp-js .rp-reveal.is-visible {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.rp-hero__capa,
	.rp-hero__texto,
	.rp-progreso {
		transition: none;
	}

	.rp-hero__raton::after {
		animation: none;
	}
}

/* En modo nativo el hero no encadena imágenes: una pantalla y a leer. */
.rp-modo-nativo .rp-hero {
	height: 100vh;
}

/* --------------------------------------------------------------------------
   8. Editor de Elementor
   En la vista previa no se carga el JS: la portada ocupa una pantalla y todo
   se ve en su sitio para poder seleccionarlo.
   -------------------------------------------------------------------------- */

.elementor-editor-active .rp-hero {
	height: 100vh;
}

.elementor-editor-active .rp-hero__escenario {
	position: relative;
}
