/* =============================================================================
   RV Aluminum — Base tipográfica, layout y utilidades
   Todos los valores salen de tokens.css.
   ========================================================================== */

body {
	font-family: var(--rv-font-cuerpo);
	font-weight: var(--rv-fw-regular);
	font-size: var(--rv-fs-17);
	line-height: var(--rv-lh-cuerpo);
	color: var(--rv-color-texto);
	background-color: var(--rv-superficie-pagina);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

/* --- Titulares ------------------------------------------------------------ */

h1, h2, h3,
.rv-h1, .rv-h2, .rv-h3 {
	font-family: var(--rv-font-titulo);
	font-weight: var(--rv-fw-bold);
	line-height: var(--rv-lh-titulo);
	letter-spacing: var(--rv-ls-titular);
	color: var(--rv-color-titulo);
	text-transform: uppercase;
}

h1, .rv-h1 { font-size: var(--rv-fs-55); }
h2, .rv-h2 { font-size: var(--rv-fs-38); }
h3, .rv-h3 { font-size: var(--rv-fs-32); }

.rv-h1--hero { font-size: var(--rv-fs-77); }

h4, h5, h6,
.rv-h4, .rv-h5, .rv-h6 {
	font-family: var(--rv-font-cuerpo);
	font-weight: var(--rv-fw-semibold);
	line-height: var(--rv-lh-medio);
	color: var(--rv-color-titulo);
}

h4, .rv-h4 { font-size: var(--rv-fs-25); }
h5, .rv-h5 { font-size: var(--rv-fs-22); }
h6, .rv-h6 { font-size: var(--rv-fs-20); }

/* --- Texto ---------------------------------------------------------------- */

p {
	margin-bottom: var(--rv-space-16);
}

p:last-child {
	margin-bottom: 0;
}

.rv-lead {
	font-size: var(--rv-fs-20);
	line-height: var(--rv-lh-suelto);
}

.rv-small {
	font-size: var(--rv-fs-16);
}

.rv-eyebrow {
	font-family: var(--rv-font-cuerpo);
	font-weight: var(--rv-fw-medium);
	font-size: var(--rv-fs-16);
	letter-spacing: var(--rv-ls-mayuscula);
	text-transform: uppercase;
	color: var(--rv-color-primario);
}

strong, b { font-weight: var(--rv-fw-fuerte); }

/*
 * El color del enlace va envuelto en :where() a propósito: así pesa cero y
 * cualquier componente que fije su propio color —una tarjeta con foto, un
 * bloque sobre fondo oscuro— no tiene que pelear contra `a:hover`. Sin esto,
 * el texto blanco sobre una imagen se volvía rojo al pasar el cursor.
 */
:where(a) {
	color: var(--rv-color-primario);
	transition: color var(--rv-dur-rapida) var(--rv-ease);
}

:where(a:hover),
:where(a:focus-visible) {
	color: var(--rv-color-primario-hover);
}

/* --- Contenedor y secciones ----------------------------------------------- */

.rv-container {
	width: 100%;
	max-width: calc(var(--rv-container) + (var(--rv-gutter) * 2));
	margin-inline: auto;
	padding-inline: var(--rv-gutter);
}

.rv-container--ancho {
	max-width: var(--rv-lienzo);
}

.rv-container--estrecho {
	max-width: calc(930px + (var(--rv-gutter) * 2));
}

.rv-section {
	padding-block: var(--rv-space-100);
}

.rv-section--compacta { padding-block: var(--rv-space-60); }
.rv-section--alt      { background-color: var(--rv-superficie-alt); }
.rv-section--oscura   { background-color: var(--rv-superficie-oscura); color: var(--rv-color-blanco); }

.rv-section--oscura h1,
.rv-section--oscura h2,
.rv-section--oscura h3 {
	color: var(--rv-color-blanco);
}

.rv-section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--rv-space-24);
	margin-bottom: var(--rv-space-40);
}

.rv-section__title {
	margin: 0;
}

/* --- Grid ----------------------------------------------------------------- */

.rv-grid {
	display: grid;
	gap: var(--rv-grid-gap);
}

.rv-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rv-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rv-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.rv-flex {
	display: flex;
	gap: var(--rv-space-16);
}

.rv-flex--centro { align-items: center; }
.rv-flex--entre  { justify-content: space-between; }
.rv-flex--wrap   { flex-wrap: wrap; }

/* --- Media ---------------------------------------------------------------- */

.rv-media {
	position: relative;
	overflow: hidden;
	background-color: var(--rv-color-fondo-gris);
}

.rv-media > img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rv-media--overlay::after {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--rv-overlay-degradado);
	pointer-events: none;
}

/* --- Accesibilidad -------------------------------------------------------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
	word-wrap: normal !important;
}

.skip-link {
	position: absolute;
	top: -100px;
	left: var(--rv-space-16);
	z-index: var(--rv-z-modal);
	padding: var(--rv-space-8) var(--rv-space-16);
	background-color: var(--rv-color-primario);
	color: var(--rv-color-blanco);
	font-weight: var(--rv-fw-medium);
	border-radius: var(--rv-radius-4);
	transition: top var(--rv-dur-rapida) var(--rv-ease);
}

.skip-link:focus {
	top: var(--rv-space-16);
	color: var(--rv-color-blanco);
}

/* --- Utilidades ----------------------------------------------------------- */

.rv-icon {
	display: inline-block;
	flex: 0 0 auto;
	vertical-align: middle;
	fill: currentColor;
}

.rv-txt-centro  { text-align: center; }
.rv-txt-derecha { text-align: right; }
.rv-mayus       { text-transform: uppercase; }
.rv-capital     { text-transform: none; }
.rv-nowrap      { white-space: nowrap; }

.rv-mt-0  { margin-top: 0; }
.rv-mb-0  { margin-bottom: 0; }
.rv-mb-16 { margin-bottom: var(--rv-space-16); }
.rv-mb-24 { margin-bottom: var(--rv-space-24); }
.rv-mb-40 { margin-bottom: var(--rv-space-40); }
.rv-mb-60 { margin-bottom: var(--rv-space-60); }

.rv-solo-movil    { display: none; }
.rv-solo-desktop  { display: revert; }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 1024px) {

	.rv-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.rv-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {

	.rv-grid--2,
	.rv-grid--3,
	.rv-grid--4 { grid-template-columns: minmax(0, 1fr); }

	.rv-section__head {
		align-items: flex-start;
		flex-direction: column;
	}

	.rv-solo-movil   { display: revert; }
	.rv-solo-desktop { display: none; }
}
