/* Reset corto, tipografía y primitivas de maquetación. */

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

* { margin: 0; }

html {
  scroll-behavior: smooth;
  /* Para que un ancla no quede tapada por la cabecera fija. */
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--tipo-texto);
  font-size: var(--t-base);
  line-height: var(--interlinea);
  font-weight: 400;
  min-height: 100vh;
  /* La web anterior tenía `overflow-y: hidden` y `height: 100vh`: en escritorio
   * la página no podía desplazarse y todo el contenido vivía en modales. */
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

/* Si el CSS le pone ancho y proporción a una imagen, hay que darle también
 * height:auto. Si no, el atributo `height` del HTML gana y la proporción se
 * ignora sin avisar. */
img, video { height: auto; }

h1, h2, h3, h4 {
  font-family: var(--tipo-titulo);
  line-height: var(--interlinea-titulo);
  font-weight: 700;
  text-wrap: balance;
}

h1 { font-size: var(--t-3xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); }

p { text-wrap: pretty; }

a {
  color: var(--acento);
  text-decoration-color: color-mix(in srgb, var(--acento) 40%, transparent);
  text-underline-offset: 0.2em;
  transition: color var(--rapido);
}

a:hover { color: var(--acento-hover); }

/* El foco tiene que verse. Se quitó de la web anterior sin sustituirlo, y
 * navegar con teclado era ir a ciegas. */
:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 3px;
  border-radius: 2px;
}

button { font: inherit; color: inherit; cursor: pointer; }

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

/* ── Primitivas ─────────────────────────────────────────────────────────── */

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

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

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

.seccion--alta { background: var(--fondo-alto); }

/* Antetítulo: la línea pequeña en versales sobre un titular.
 * En monoespaciada y en el azul de marca. Es el detalle que más cambia el
 * carácter de la página por menos código: aparece en todas las secciones. */
.antetitulo {
  font-family: var(--tipo-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--acento);
  margin-bottom: var(--e-3);
}

.entradilla {
  font-size: var(--t-md);
  color: var(--texto-suave);
  max-width: var(--ancho-texto);
}

.eu {
  font-style: italic;
  color: var(--texto-tenue);
}

/* Solo para lectores de pantalla. */
.oculto-visual {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Saltar al contenido: lo primero que encuentra quien navega con teclado. */
.saltar {
  position: absolute;
  top: -100%;
  left: var(--gutter);
  z-index: 999;
  background: var(--acento);
  color: var(--fondo);
  padding: var(--e-3) var(--e-4);
  border-radius: var(--radio);
  font-weight: 600;
}

.saltar:focus {
  top: var(--e-3);
  color: var(--fondo);
}
