/* ==========================================================================
   UAIII — Base: reset, tipografía global, retícula
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  background: var(--marfil);
  color: var(--texto);
  font-family: var(--ff-texto);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.menu-abierto {
  overflow: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

::selection {
  background: var(--rojo);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--rojo);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Titulares y texto
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-optical-sizing: auto;
  line-height: 1.08;
  letter-spacing: -0.016em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-1);
  line-height: 1;
  letter-spacing: -0.026em;
}

h2 {
  font-size: var(--fs-2);
  line-height: 1.06;
}

h3 {
  font-size: var(--fs-3);
  line-height: 1.16;
}

h4 {
  font-size: var(--fs-4);
  line-height: 1.28;
  letter-spacing: -0.006em;
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 600;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.12em 0.4em;
  border: 1px solid var(--linea);
  border-radius: 4px;
  background: var(--marfil-2);
}

.italic,
.cursiva {
  font-style: italic;
}

/* Palabra o frase destacada con subrayado dorado que se dibuja al entrar */
.marca-oro {
  font-style: italic;
  background-image: linear-gradient(var(--oro), var(--oro));
  background-repeat: no-repeat;
  background-position: 0 86%;
  background-size: calc(var(--marca-scale, 1) * 100%) 0.3em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size 0.9s var(--ease);
  padding-inline: 0.04em;
}

/* --------------------------------------------------------------------------
   Etiquetas y textos de apoyo
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--ff-texto);
  font-size: var(--fs-mini);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rojo);
}

.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: currentColor;
  flex: none;
}

.eyebrow--oro {
  color: var(--oro);
}

.eyebrow--suave {
  color: var(--texto-suave);
}

.eyebrow--linea::before {
  display: none;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--texto-medio);
}

.texto-suave {
  color: var(--texto-medio);
}

.capitular::first-letter {
  float: left;
  font-family: var(--ff-display);
  font-size: 4.4em;
  line-height: 0.82;
  font-weight: 600;
  padding: 0.06em 0.12em 0 0;
  color: var(--rojo);
}

/* --------------------------------------------------------------------------
   Retícula y utilidades
   -------------------------------------------------------------------------- */

.contenedor {
  width: 100%;
  max-width: var(--contenedor);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.contenedor--estrecho {
  max-width: var(--contenedor-estrecho);
}

.seccion {
  position: relative;
  padding-block: var(--seccion-y);
}

.seccion--marfil {
  background: var(--marfil);
}

.seccion--blanco {
  background: var(--blanco);
}

.seccion--rojo {
  background: var(--rojo);
  color: var(--texto-invertido);
}

.seccion--oscura {
  background: var(--tinta);
  color: var(--texto-invertido);
}

.seccion--oscura .lead,
.seccion--rojo .lead,
.seccion--oscura .texto-suave {
  color: var(--texto-invertido-medio);
}

.reglon-superior {
  border-top: 1px solid var(--linea);
}

.seccion--oscura .reglon-superior,
.seccion--rojo .reglon-superior {
  border-color: var(--linea-oscura);
}

/* Textura de papel muy sutil */
.textura::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.seccion--oscura.textura::before,
.seccion--rojo.textura::before {
  mix-blend-mode: soft-light;
  opacity: 0.5;
}

/* Cabecera de sección compartida */
.cabecera-seccion {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 2.75rem);
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

@media (min-width: 900px) {
  .cabecera-seccion--2 {
    grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr);
    align-items: end;
    column-gap: clamp(2rem, 5vw, 5rem);
  }
}

.cabecera-seccion__titulo {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cabecera-seccion__num {
  font-family: var(--ff-texto);
  font-size: var(--fs-mini);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--rojo);
  font-variant-numeric: tabular-nums;
}

.seccion--oscura .cabecera-seccion__num {
  color: var(--oro);
}

/*
   Sobre fondo rojo (#AD1519) el oro y el texto secundario no alcanzan 4,5:1,
   así que las etiquetas pequeñas van en crema puro (6,5:1). El oro se reserva
   para cifras grandes, que exigen 3:1.
*/
.seccion--rojo .cabecera-seccion__num,
.seccion--rojo .eyebrow--oro,
.seccion--rojo .lead,
.seccion--rojo .texto-suave,
.seccion--rojo .texto-oro,
.seccion--rojo .marca-oro,
.ejes .eyebrow--oro,
.ejes .texto-oro,
.ejes .marca-oro,
.tarjeta--roja .texto-oro,
.tarjeta--roja .marca-oro {
  color: var(--texto-invertido);
}

/* Ocultar para lectores si el JS no arranca */
.js .solo-js {
  display: none;
}

/* Utilidades */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.texto-oro {
  color: var(--oro);
}

.texto-rojo {
  color: var(--rojo);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
