/* ==========================================================================
   BASE · reset moderado y elementos de HTML
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem; /* que el header fijo no tape el ancla */
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--fondo-pagina);
  color: var(--texto);
  font-family: var(--fuente-cuerpo);
  font-size: var(--tam-cuerpo);
  line-height: var(--interlinea-cuerpo);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Títulos ------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--e-4);
  font-family: var(--fuente-titulo);
  font-weight: 400;
  line-height: var(--interlinea-titulo);
  letter-spacing: var(--tracking-titulo);
  text-wrap: balance;
}

h1 {
  font-size: var(--tam-h1);
}
h2 {
  font-size: var(--tam-h2);
}
h3 {
  font-size: var(--tam-h3);
}
h4,
h5,
h6 {
  font-size: var(--tam-base);
}

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

p,
ul,
ol,
dl,
blockquote,
figure,
table {
  margin: 0 0 var(--e-4);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--texto);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--transicion);
}

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

strong,
b {
  font-weight: 600;
}

small {
  font-size: var(--tam-chico);
}

hr {
  height: 0;
  margin: var(--e-7) 0;
  border: 0;
  border-top: var(--borde-fino);
}

blockquote {
  margin-inline: 0;
  padding-left: var(--e-5);
  border-left: 2px solid var(--arena);
  color: var(--texto-secundario);
  font-style: italic;
}

code,
kbd,
samp,
pre {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, monospace;
  font-size: 0.9em;
}

/* --- Medios -------------------------------------------------------------- */

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

audio {
  width: 100%;
}

/* --- Formularios --------------------------------------------------------- */

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* --- Foco visible -------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--foco);
  outline-offset: 3px;
  border-radius: var(--radio);
}

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

.contenedor {
  width: 100%;
  max-width: var(--ancho-maximo);
  margin-inline: auto;
  padding-inline: var(--e-5);
}

@media (min-width: 48rem) {
  .contenedor {
    padding-inline: var(--e-6);
  }
}

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

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

/* Salto al contenido: aparece al tabular. */
.salto-contenido {
  position: absolute;
  left: var(--e-4);
  top: var(--e-4);
  z-index: 100;
  padding: var(--e-3) var(--e-5);
  background: var(--fondo-oscuro);
  color: var(--texto-sobre-oscuro);
  font-size: var(--tam-chico);
  text-decoration: none;
  border-radius: var(--radio);
  transform: translateY(-200%);
  transition: transform var(--transicion);
}

.salto-contenido:focus {
  transform: translateY(0);
  color: var(--texto-sobre-oscuro);
}
