/* base.css — Reset, tipografía y ritmo vertical.
   Sin valores literales de color, tipografía ni espaciado: solo var(--…) de tokens.css. */

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

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

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

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-display);
  text-wrap: pretty;
}

p, ul, ol, blockquote, figure {
  margin: 0;
}

a {
  color: var(--c-accent);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

a:hover {
  color: var(--c-text);
}

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

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--c-focus-ring);
  outline-offset: 3px;
}

summary {
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

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

.asp-skip {
  position: absolute;
  left: var(--sp-4);
  top: var(--sp-4);
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-accent);
  color: var(--c-accent-ink);
  border-radius: var(--radius-3);
  transform: translateY(-200%);
}

.asp-skip:focus {
  transform: none;
  color: var(--c-accent-ink);
}

/* Rótulos y numerales del sistema */
.asp-label {
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--c-text-faint);
}

.asp-label--muted {
  color: var(--c-text-muted);
}

.asp-label--strong {
  font-weight: var(--fw-semibold);
  color: inherit;
}

.asp-numeral {
  font-family: var(--font-numeral);
  line-height: var(--lh-heading);
}

.asp-muted {
  color: var(--c-text-muted);
}

/* Cuerpo de texto enriquecido (descripciones, artículos, páginas) */
.asp-prose {
  max-width: var(--w-prose);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
}

.asp-prose > * + * {
  margin-top: var(--sp-4);
}

/* Subtítulos: más aire arriba que abajo, para que agrupen con el párrafo
   que presentan y no con el anterior. Los artículos migrados traen h4, así
   que h4 se trata como un subtítulo de sección más. */
.asp-prose h2,
.asp-prose h3,
.asp-prose h4 {
  margin-top: var(--sp-7);
  font-weight: var(--fw-semibold);
  text-wrap: balance;
  scroll-margin-top: calc(var(--header-h) + var(--sp-5));
}

.asp-prose :is(h2, h3, h4) + * {
  margin-top: var(--sp-3);
}

.asp-prose h2 { font-size: var(--fs-xl); }
.asp-prose h3,
.asp-prose h4 { font-size: var(--fs-lg); }

.asp-prose ul,
.asp-prose ol {
  padding-left: 1.2em;
}

.asp-prose li + li {
  margin-top: var(--sp-3);
}

.asp-prose blockquote {
  padding: var(--sp-5);
  background: var(--c-surface-2);
  border-radius: var(--radius-4);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
}

.asp-prose a {
  box-shadow: inset 0 -1px 0 var(--c-accent);
}

.asp-prose img {
  border-radius: var(--radius-4);
}

/* Contenido de WordPress: alineaciones y leyendas nativas */
.alignwide, .alignfull { max-width: none; }
.wp-caption { max-width: 100%; }
.wp-caption-text {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-2);
}
.screen-reader-text { position: absolute; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; }

/* Lectura en serif: un punto más grande en escritorio */
@media (min-width: 1024px) {
  .asp-prose {
    font-size: var(--fs-lg);
  }
  .asp-prose h2 { font-size: var(--fs-2xl); }
  .asp-prose h3,
  .asp-prose h4 { font-size: var(--fs-xl); }
  .asp-prose h2,
  .asp-prose h3,
  .asp-prose h4 { scroll-margin-top: calc(var(--header-h-desktop) + var(--sp-5)); }
}
