/* =====================================================================
   Base compartida (inicio y memorama): colores, letra, encabezado,
   herramientas de accesibilidad y botones.
   Contrastes medidos (WCAG 2.2): texto tinta/papel 16:1, blanco sobre
   talavera 9.7:1, rosa 6.9:1, jade 6.2:1, tinta sobre cempasúchil 8.8:1.
   ===================================================================== */
:root {
  --tinta: #14213D;        /* texto principal */
  --tinta-2: #3A4660;      /* texto secundario: 9.4:1 sobre blanco */
  --papel: #FFFFFF;
  --cielo: #EEF3FA;        /* fondo de página */
  --talavera: #12408F;     /* azul: carrera */
  --rosa: #B0124F;         /* rosa mexicano: memorama */
  --jade: #0E6E5A;         /* acierto */
  --cempasuchil: #F2B705;  /* acento (siempre con texto tinta) */
  --sobre-color: #FFFFFF;  /* texto encima de talavera / rosa / jade */
  --borde: var(--tinta);
  --sombra: var(--tinta);
  --foco: #F2B705;
  color-scheme: light;
}
html[data-contraste="alto"] {
  --tinta: #FFFFFF;
  --tinta-2: #FFFFFF;
  --papel: #000000;
  --cielo: #000000;
  --talavera: #FFD43B;
  --rosa: #FFD43B;
  --jade: #7CFFB2;
  --cempasuchil: #FFD43B;
  --sobre-color: #000000;
  --borde: #FFFFFF;
  --sombra: transparent;
  --foco: #00E5FF;
  color-scheme: dark;
}
/* Tamaño del texto de TODO el sitio (botones A, A+ y A++ del encabezado).
   A = 75% (12 px de base), A+ = 87.5%, A++ = 100%. */
html { font-size: 75%; }
html[data-texto="grande"] { font-size: 87.5%; }
html[data-texto="muy-grande"] { font-size: 100%; }

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--cielo); color: var(--tinta);
  font-family: "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;
  font-size: 1.125rem; line-height: 1.6;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
img { max-width: 100%; }
.oculto { display: none !important; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--tinta); outline-offset: 3px; box-shadow: 0 0 0 7px var(--foco); }

.saltar { position: absolute; left: 1rem; top: -100px; z-index: 20; background: var(--tinta); color: var(--papel);
  padding: .75rem 1rem; border-radius: 10px; font-weight: 700; }
.saltar:focus { top: 1rem; }

/* Encabezado */
.encabezado { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem clamp(1rem, 4vw, 3rem); background: var(--papel); border-bottom: 3px solid var(--borde); }
.marca { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; }
.marca-icono { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 12px;
  background: var(--talavera); color: var(--sobre-color); font-weight: 700; font-size: 1.5rem; }
.marca-icono.con-imagen { width: 3.6rem; height: 3.6rem; background: var(--papel); border: 3px solid var(--borde); padding: 3px; overflow: hidden; }
.marca-icono img { width: 100%; height: 100%; object-fit: contain; }
.marca-texto { display: flex; flex-direction: column; line-height: 1.2; }
.marca-texto strong { font-size: 1.25rem; }
.marca-texto span { color: var(--tinta-2); font-size: .95rem; }

.herramientas { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.grupo { display: flex; align-items: center; gap: .3rem; }
.etiqueta { font-weight: 700; margin-right: .2rem; }
.opcion { display: inline-flex; align-items: center; gap: .4rem; min-width: 48px; min-height: 48px; padding: .35rem .75rem;
  font: inherit; font-weight: 700; color: var(--tinta); background: var(--papel);
  border: 2px solid var(--borde); border-radius: 12px; cursor: pointer; }
.opcion.grande { font-size: 1.2rem; }
.opcion.muy-grande { font-size: 1.4rem; }
.opcion[aria-pressed="true"] { background: var(--tinta); color: var(--papel); text-decoration: underline; text-underline-offset: 4px; }

/* Botones */
.boton { display: inline-flex; justify-content: center; align-items: center; gap: .5rem;
  min-height: 56px; padding: .7rem 1.4rem; border-radius: 14px;
  font: inherit; font-weight: 700; font-size: 1.2rem; text-decoration: none; cursor: pointer;
  color: var(--sobre-color); background: var(--talavera); border: 3px solid var(--borde);
  box-shadow: 4px 4px 0 var(--sombra); }
.boton:hover { text-decoration: underline; text-underline-offset: 4px; }
.boton:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--sombra); }
.boton.rosa { background: var(--rosa); }
.boton.jade { background: var(--jade); }
.boton.morado { background: #6A2C91; }  /* texto blanco: 9.6:1 */
html[data-contraste="alto"] .boton.morado { background: var(--talavera); }  /* amarillo con texto negro */
.boton.amarillo { background: var(--cempasuchil); color: #14213D; }  /* texto oscuro: 8.8:1 */
.boton.contorno { background: var(--papel); color: var(--tinta); }
.boton:disabled { opacity: .55; cursor: wait; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
