/* ==========================================================================
   base.css — Reset ligero, maquetación principal y accesibilidad base
   Depende de: temas.css (variables globales y de tema).
   Reemplaza las utilidades de Tailwind usadas en la maqueta sin usar CDN.
   ========================================================================== */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--page-bg);
  background-image: var(--page-pattern);
  background-size: 24px 24px;
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.28s ease, color 0.24s ease;
  overflow-x: hidden;
}

body[data-tema="cajas-noche"] {
  background-size: 210px 140px;
}

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

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

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

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

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

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

[hidden],
.oculto {
  display: none !important;
}

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

/* Contenedor principal (máx. 1020 px, respiro en escritorio) */
.contenedor {
  width: 100%;
  max-width: 1020px;
  margin-inline: auto;
  padding-inline: 14px;
}

@media (min-width: 640px) {
  .contenedor {
    padding-inline: 28px;
  }
}

@media (min-width: 1024px) {
  .contenedor {
    padding-inline: 44px;
  }
}

/* Contenedor del tablero de 24 casillas (máx. 840 px) */
.tablero {
  width: 100%;
  max-width: 840px;
  margin-inline: auto;
}

.principal {
  padding-bottom: 3.5rem;
}

/* Familias tipográficas */
.fuente-display {
  font-family: var(--font-display);
  letter-spacing: -0.012em;
}

.fuente-serif {
  font-family: var(--font-serif);
}

.texto-atenuado {
  color: var(--text-muted);
}

.hero-titulo {
  color: var(--hero-text);
  font-family: var(--font-display);
  letter-spacing: -0.012em;
  font-size: 1.875rem;
  line-height: 1.22;
  font-weight: 700;
  max-width: 42rem;
  margin-inline: auto;
  margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
  .hero-titulo {
    font-size: 3rem;
    line-height: 1.12;
  }
}

.hero-subtitulo {
  color: var(--hero-muted);
  font-size: 0.875rem;
  line-height: 1.55;
  font-weight: 500;
  max-width: 36rem;
  margin-inline: auto;
}

@media (min-width: 640px) {
  .hero-subtitulo {
    font-size: 1rem;
  }
}

/* Posiciones de esquina para números de casillas (Postal y Artesanal) */
.pos-arriba-izq {
  top: 0.5rem;
  left: 0.625rem;
}

.pos-arriba-der {
  top: 0.5rem;
  right: 0.625rem;
}

.pos-abajo-der {
  bottom: 0.5rem;
  right: 0.625rem;
}

.pos-arriba-der-lg {
  top: 0.625rem;
  right: 0.875rem;
}

/* Foco de teclado global visible */
:focus-visible {
  outline: 3px solid #FACC15;
  outline-offset: 2px;
}

/* Respeto obligatorio a prefers-reduced-motion */
@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;
  }
}
