/* css/globals.css — tipografía base, container, focus.
   ------------------------------------------------------------------
   La escala es editorial: pocos tamaños, saltos claros y mucho aire.
   Los titulares van en CAJA NORMAL y en peso medio (600), no en
   mayúsculas ni en 900. Un titular grande en caja normal se lee como
   una afirmación; el mismo texto en caja alta y peso máximo se lee
   como un grito, y era buena parte de lo que hacía que la web
   pareciera un cartel.

   El cuerpo va a 17px con interlineado generoso: en esta web hay
   bastante que leer (fichas de preparación, servicios) y la lectura
   cómoda es parte de parecer serio.
   ------------------------------------------------------------------ */

body {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  color: var(--fg-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Red de seguridad contra scroll horizontal por elementos decorativos.
     overflow-x:clip lo evita sin romper position:sticky en hijos, como
     sí haría overflow:hidden. */
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.017em;
  color: inherit;
  text-wrap: balance;
}

p { line-height: 1.7; }

strong, b { font-weight: 600; }

a { color: inherit; }

/* === Escala tipográfica ===
   Tres tamaños de titular y tres de texto. Si hace falta un cuarto,
   probablemente el problema es la jerarquía, no la escala. */

.h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.06;
  letter-spacing: -0.028em;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(29px, 3.4vw, 43px);
  line-height: 1.12;
  letter-spacing: -0.022em;
}

.h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(21px, 2vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.014em;
}

.body-lg {
  font-size: clamp(18px, 1.3vw, 20px);
  line-height: 1.65;
  color: var(--fg-muted);
}

.body { font-size: 17px; line-height: 1.7; }

.body-sm {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-muted);
}

/* Medida de lectura. Un párrafo de 120 caracteres por línea no se lee:
   se salta. */
.measure { max-width: var(--container-text); }

/* === Etiquetas técnicas ===
   Monoespaciada, pequeña, en gris. Se usa para datos —referencias,
   códigos de nivel, cabeceras de ficha—, no como adorno. */
.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
}

/* === Eyebrow ===
   La línea corta encima de un titular. En versalitas discretas y gris,
   no en el color de marca: su trabajo es situar, no llamar. Antes
   llevaba una barra delante y era del color de acento; las dos cosas
   sobraban. */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  display: block;
  margin-bottom: var(--space-4);
}

.eyebrow-amber,
.eyebrow-navy,
.eyebrow-dark { color: var(--fg-subtle); }
.eyebrow-light { color: var(--fg-on-dark-muted); }

/* === Enlaces de texto ===
   Subrayado fino y separado, que es como se subraya bien. El color de
   marca aparece aquí y en poco más. */
.prose a,
a.link {
  color: var(--brand-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--brand-blue) 40%, transparent);
  transition: text-decoration-color var(--transition-fast);
}
.prose a:hover,
a.link:hover { text-decoration-color: currentColor; }

/* === Container === */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

@media (min-width: 769px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

/* === Bloques oscuros ===
   El oscuro es la excepción (el pie, y poco más). La clase reasigna
   las variables de tinta y borde para que todo lo de dentro herede el
   modo oscuro sin excepciones puntuales. */
.on-dark {
  background: var(--bg-dark);
  color: var(--fg-on-dark);
  --fg-primary: #F2F4F6;
  --fg-muted:   #A5ADB6;
  --fg-subtle:  #7C848D;
  --border:        rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.26);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --bg-primary:  #14171A;
  --bg-soft:     #1B1F23;
  --bg-elevated: #1B1F23;
  --bg-raised:   #22272C;
}

/* === Selección === */

::selection {
  background: var(--brand-blue);
  color: #FFFFFF;
}

/* === Focus visible === */

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* === Margen de scroll bajo el topbar fijo ===
   El topbar es `position: fixed`: sin esto, cualquier salto de ancla o
   enfoque de campo al validar deja el destino tapado detrás de él. */
:target,
h1, h2, h3,
section[id],
[id]:is(section, article, aside),
input, select, textarea, button {
  scroll-margin-top: calc(var(--topbar-height) + var(--space-5));
}

/* === Modos de fondo heredados ===
   Se conservan los nombres porque están en el marcado de varias
   páginas, pero reducidos al mínimo: aquí una sección o es blanca, o
   es hueso, o es oscura. No hay secciones de color. */
body.bg-mode-blocks .section-blue,
body.bg-mode-blocks .section-blue-dark,
body.bg-mode-blocks .section-navy,
body.bg-mode-blocks .section-dark {
  background: var(--bg-dark);
  color: var(--fg-on-dark);
}
body.bg-mode-blocks .section-amber,
body.bg-mode-blocks .section-blue-light,
body.bg-mode-blocks .section-soft {
  background: var(--bg-soft);
  color: var(--fg-primary);
}

body.bg-mode-tint::before { content: none; }

/* === Reduced motion === */

@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;
  }
  html { scroll-behavior: auto; }
}

/* === Scroll lock con el drawer abierto === */

body.drawer-open { overflow: hidden; }
