/* ============================================================
   REINICIO / NORMALIZACIÓN
   Base mínima y predecible para todos los navegadores.
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;   /* iOS no agranda el texto al girar */
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--alto-cabecera) + var(--espacio-5));
}

body {
  margin: 0;
  font-family: var(--fuente-texto);
  font-size: var(--texto-base);
  font-weight: 300;
  line-height: 1.7;
  color: var(--color-texto);
  background-color: var(--color-fondo);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;               /* nunca scroll horizontal */
}

h1, h2, h3, h4 {
  margin: 0 0 var(--espacio-4);
  font-family: var(--fuente-titulos);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: var(--interletrado-titulo);
  text-wrap: balance;
  overflow-wrap: break-word;   /* una palabra larga nunca desborda la pantalla */
  color: var(--color-texto);
}

h1 { font-size: var(--texto-xxl); }
h2 { font-size: var(--texto-xl); }
h3 { font-size: var(--texto-lg); }
h4 { font-size: var(--texto-md); }

p { margin: 0 0 var(--espacio-4); }

a {
  color: var(--color-marca);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color var(--transicion), opacity var(--transicion);
}
a:hover { opacity: 0.7; }

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

ul, ol { margin: 0 0 var(--espacio-4); padding-left: var(--espacio-5); }

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

table { border-collapse: collapse; width: 100%; }

/* Foco visible siempre: requisito de accesibilidad */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Respeta a quien pidió menos animación */
@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;
  }
}

/* Utilidad: visible solo para lectores de pantalla */
.solo-lectores {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

