/* ============================================================
   base.css — tokens de diseño, reset y tipografía
   Se carga en TODAS las páginas del sitio.
   ============================================================ */

:root {
  /* --- Color: neutros de sala de museo. El color lo ponen las obras. --- */
  --c-fondo:          #faf9f7;   /* muro de la sala */
  --c-superficie:     #ffffff;
  --c-tinta:          #1b1a18;   /* texto principal */
  --c-tinta-media:    #4a4742;   /* texto secundario */
  --c-tinta-suave:    #6f6b63;   /* cédulas, metadatos */
  --c-linea:          #e0dcd4;   /* filetes y separadores */
  --c-linea-fuerte:   #c3bdb2;
  --c-foco:           #2f6f6b;   /* solo para el anillo de foco (accesibilidad) */

  /* --- Tipografía --- */
  --f-titulo: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --f-texto:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --t-xs:   0.75rem;
  --t-sm:   0.875rem;
  --t-base: 1rem;
  --t-md:   clamp(1.05rem, 0.98rem + 0.35vw, 1.25rem);
  --t-lg:   clamp(1.4rem,  1.2rem  + 0.9vw,  2rem);
  --t-xl:   clamp(1.9rem,  1.5rem  + 1.8vw,  3rem);

  --track-ancho: 0.18em;  /* interletrado de las versalitas */

  /* --- Ritmo vertical y medidas --- */
  --esp-1: 0.5rem;
  --esp-2: 1rem;
  --esp-3: 1.5rem;
  --esp-4: 2.5rem;
  --esp-5: 4rem;
  --esp-6: 6rem;
  --esp-7: clamp(5rem, 10vw, 9rem);   /* aire entre secciones */

  --ancho-max:   1280px;
  --ancho-texto: 62ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);

  --borde-fino: 1px solid var(--c-linea);
  --transicion: 200ms ease;
}

/* --- Reset acotado --- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body,
h1, h2, h3, h4, p, figure, figcaption, blockquote, dl, dd, ul, ol {
  margin: 0;
  padding: 0;
}

ul[class], ol[class] { list-style: none; }

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

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

body {
  background-color: var(--c-fondo);
  color: var(--c-tinta);
  font-family: var(--f-texto);
  font-size: var(--t-base);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* --- Tipografía base --- */
h1, h2, h3 {
  font-family: var(--f-titulo);
  font-weight: 400;
  line-height: 1.18;
  text-wrap: balance;
}

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

p { text-wrap: pretty; }

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

a:not([class]) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--c-linea-fuerte);
  transition: text-decoration-color var(--transicion);
}

a:not([class]):hover { text-decoration-color: currentColor; }

/* --- Accesibilidad --- */
:focus-visible {
  outline: 2px solid var(--c-foco);
  outline-offset: 3px;
}

.salto-contenido {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--c-superficie);
  border: 1px solid var(--c-tinta);
  transform: translateY(-140%);
  transition: transform var(--transicion);
}

.salto-contenido:focus-visible { transform: translateY(0.5rem); }

/* 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;
}

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