/* ==========================================================================
   BASE: reset, tipografía y utilidades
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--fuente-base);
  font-size: var(--texto-md);
  line-height: 1.5;
  color: var(--color-texto);
  background: var(--color-fondo);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Bloquear el scroll cuando hay un modal o drawer abierto */
body.sin-scroll {
  overflow: hidden;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote {
  margin: 0;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: var(--peso-black);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

/* Foco visible y consistente en todos los elementos interactivos */
:focus-visible {
  outline: 3px solid var(--color-secundario);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* ---------- Utilidades ---------- */
.contenedor {
  width: 100%;
  max-width: calc(var(--ancho-max) + var(--margen-lateral) * 2);
  margin-inline: auto;
  padding-inline: var(--margen-lateral);
}

.solo-lectores {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Enlace "Saltar al contenido" */
.saltar-contenido {
  position: absolute;
  top: -100px;
  left: var(--esp-4);
  z-index: 1000;
  background: var(--color-texto);
  color: #fff;
  padding: var(--esp-3) var(--esp-4);
  border-radius: var(--radio-sm);
  font-weight: var(--peso-bold);
}
.saltar-contenido:focus {
  top: var(--esp-2);
}

.icono {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icono--sm { width: 16px; height: 16px; }
.icono--lg { width: 24px; height: 24px; }
.icono--xl { width: 32px; height: 32px; }
.icono--relleno { fill: currentColor; stroke: none; }

.oculto {
  display: none !important;
}

.texto-centro { text-align: center; }

/* Secciones de página */
.seccion {
  padding-block: var(--esp-12);
}
.seccion--alterna {
  background: var(--color-fondo-alterno);
}
.seccion__cabecera {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--esp-4);
  margin-bottom: var(--esp-6);
  flex-wrap: wrap;
}
.seccion__titulo {
  font-size: var(--texto-2xl);
}
.seccion__subtitulo {
  color: var(--color-texto-suave);
  margin-top: var(--esp-1);
}
.seccion__enlace {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-1);
  font-weight: var(--peso-bold);
  color: var(--color-primario);
  font-size: var(--texto-sm);
}
.seccion__enlace:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .seccion { padding-block: var(--esp-16); }
  .seccion__titulo { font-size: var(--texto-3xl); }
}
