/* Mi Ruta de Salud · estilos base compartidos (portada y agenda).
   Sin estilos en línea ni recursos externos. Rutas relativas a este archivo. */

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Paleta aprobada */
  --azul: #203e78;
  --azul-hover: #172d58;
  --tinta: #192a3a;
  --apoyo: #0f74a8;
  --niebla: #eff7fa;
  --blanco: #ffffff;
  --borde: #dce6ee;
  --suave: #4a5b6c; /* texto secundario, 7:1 sobre blanco */
  --alerta-fondo: #fdf1e7;
  --alerta-texto: #8a3b12;

  --fuente-titulo: "Nunito", "Segoe UI", system-ui, sans-serif;
  --fuente-texto: "Nunito Sans", "Segoe UI", system-ui, sans-serif;

  /* Escala de espaciado 4/8 */
  --e1: 4px;
  --e2: 8px;
  --e3: 12px;
  --e4: 16px;
  --e5: 24px;
  --e6: 32px;
  --e7: 48px;
  --e8: 64px;

  --radio: 14px;
  --radio-sm: 10px;
  --sombra: 0 1px 2px rgba(25, 42, 58, 0.05), 0 4px 16px rgba(25, 42, 58, 0.05);

  --mov: 180ms;
  --curva: cubic-bezier(0.23, 1, 0.32, 1);
  --ancho: 1080px;
}

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

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

body {
  margin: 0;
  background: var(--blanco);
  color: var(--tinta);
  font-family: var(--fuente-texto);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  font-family: var(--fuente-titulo);
  color: var(--azul);
  line-height: 1.2;
  margin: 0;
  font-weight: 800;
}
h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.375rem;
}
h3 {
  font-size: 1.0625rem;
}
p {
  margin: 0;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--apoyo);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}

/* Foco visible: 2 px azul de apoyo con separación */
:focus-visible {
  outline: 2px solid var(--apoyo);
  outline-offset: 2px;
  border-radius: 4px;
}
[tabindex="-1"]:focus {
  outline: none;
}

.solo-lector {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.saltar {
  position: absolute;
  left: var(--e4);
  top: -100px;
  z-index: 100;
  background: var(--azul);
  color: var(--blanco);
  padding: var(--e3) var(--e4);
  border-radius: var(--radio-sm);
}
.saltar:focus {
  top: var(--e2);
}

/* Botones */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--e2);
  min-height: 48px;
  padding: 0 var(--e5);
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: 700 1rem/1.2 var(--fuente-titulo);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--mov) var(--curva), border-color var(--mov) var(--curva),
    transform var(--mov) var(--curva), color var(--mov) var(--curva);
}
.boton:active {
  transform: scale(0.98);
}
.boton-principal {
  background: var(--azul);
  color: var(--blanco);
}
.boton-principal:hover {
  background: var(--azul-hover);
}
.boton-secundario {
  background: var(--blanco);
  color: var(--azul);
  border-color: var(--azul);
}
.boton-secundario:hover {
  background: var(--niebla);
}
.boton-texto {
  background: transparent;
  color: var(--apoyo);
  min-height: 44px;
  padding: 0 var(--e3);
  border-radius: var(--radio-sm);
}
.boton-texto:hover {
  background: var(--niebla);
}
.boton-peligro {
  background: var(--blanco);
  color: var(--alerta-texto);
  border-color: var(--alerta-texto);
}
.boton-peligro:hover {
  background: var(--alerta-fondo);
}
.boton-chico {
  min-height: 44px;
  padding: 0 var(--e4);
  font-size: 0.9375rem;
}
.boton[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.icono {
  width: 20px;
  height: 20px;
  flex: none;
}

.etiqueta {
  display: inline-block;
  padding: 2px var(--e3);
  border-radius: 999px;
  background: var(--niebla);
  color: var(--azul);
  font: 700 0.8125rem/1.5 var(--fuente-titulo);
  letter-spacing: 0.02em;
}
.etiqueta-alerta {
  background: var(--alerta-fondo);
  color: var(--alerta-texto);
}

.tarjeta {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: var(--e5);
  box-shadow: var(--sombra);
}
.tarjeta-niebla {
  background: var(--niebla);
  border-color: transparent;
  box-shadow: none;
}

.numeros {
  font-variant-numeric: tabular-nums;
}

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