/* Brújula Huilense — base compartida (index + legales) */

:root {
  /* Paleta terrosa: arena/hueso, terracota de la tierra y teal del río Magdalena */
  --arena:    #f1e8d8;   /* fondo arena/hueso */
  --hueso:    #fdfaf3;   /* superficie de fichas */
  --tinta:    #2a2114;   /* texto */
  --tierra:   #a8441a;   /* terracota principal: 5,6:1 sobre --hueso */
  --tierra-dk:#7e3011;   /* terracota oscura: hover y franja */
  --tierra-bg:#f5e3d4;   /* tinte terracota, recuadros */
  --rio:      #0c6b61;   /* teal del río: 6,0:1 sobre --hueso */
  --rio-dk:   #084e47;   /* teal oscuro, hover */
  --rio-bg:   #d9ece8;   /* tinte teal, recuadros */
  --linea:    #d9c8ac;   /* líneas y bordes */
  --mute:     #5f5238;   /* texto secundario: 6,3:1 sobre --arena */

  /* Tipografía */
  --display: 'Schibsted Grotesk', system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  --text:    'Schibsted Grotesk', system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono:    'Fragment Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Escala */
  --fs-0: 0.8125rem;                                   /* 13 — etiquetas */
  --fs-1: 0.9375rem;                                   /* 15 — notas, tablas */
  --fs-2: 1.0625rem;                                   /* 17 — cuerpo desktop */
  --fs-3: 1.1875rem;                                   /* 19 — entradillas, H4 */
  --fs-4: clamp(1.3125rem, 1.15rem + 0.7vw, 1.625rem); /* 21–26 — H3 */
  --fs-5: clamp(1.625rem, 1.3rem + 1.5vw, 2.375rem);   /* 26–38 — H2 */
  --fs-6: clamp(1.9375rem, 1.3rem + 2.9vw, 3.25rem);   /* 31–52 — H1 */

  /* Ritmo (múltiplos de 4) */
  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 40px; --s6: 48px; --s8: 64px; --s10: 80px;

  /* Modal de cookies: fondo borroso configurable */
  --cookie-blur: 14px;                       /* intensidad del desenfoque del fondo (0 = sin blur) */
  --cookie-overlay: rgba(42, 33, 20, 0.48);  /* color y opacidad del velo sobre la página */
  --cookie-width: 460px;                     /* ancho máximo de la tarjeta */

  --r: 12px;            /* radio de fichas */
  --r-sm: 7px;
  --measure: 66ch;
  --container: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--arena);
  color: var(--tinta);
  font-family: var(--text);
  font-size: var(--fs-2);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (max-width: 640px) { body { font-size: 1rem; } }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s2);
  text-wrap: balance;
}
h1 { font-size: var(--fs-6); }
h2 { font-size: var(--fs-5); }
h3 { font-size: var(--fs-4); }
h4 { font-size: var(--fs-3); font-weight: 600; letter-spacing: 0; }

p, ul, ol, dl { margin: 0 0 var(--s2); max-width: var(--measure); }
ul, ol { padding-left: 1.2em; }
li + li { margin-top: 6px; }
strong { font-weight: 700; }
small { font-size: var(--fs-0); }

a { color: var(--tierra); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--tierra-dk); text-decoration-thickness: 2px; }
a, code { overflow-wrap: anywhere; }

:focus-visible { outline: 3px solid var(--rio); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--tierra); color: #fff; }

table, .tnum { font-variant-numeric: tabular-nums; }

/* Dato/etiqueta en monoespaciada */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s2); }
@media (min-width: 768px) { .container { padding-inline: var(--s4); } }

/* Etiqueta de sección: "RUMBO 02" */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-0);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tierra);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 var(--s3);
  font-family: var(--display); font-weight: 700; font-size: var(--fs-1);
  text-decoration: none; cursor: pointer;
  border: 2px solid var(--tierra); border-radius: var(--r-sm);
  background: var(--tierra); color: #fff;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--tierra-dk); border-color: var(--tierra-dk); color: #fff; }
.btn.ghost { background: transparent; color: var(--tierra); }
.btn.ghost:hover { background: var(--tierra-bg); color: var(--tierra-dk); }

.skip {
  position: absolute; left: var(--s2); top: -100px;
  display: inline-flex; align-items: center; min-height: 44px;
  padding: var(--s1) var(--s2); background: var(--tinta); color: #fff;
  z-index: 100; text-decoration: none; font-weight: 700; border-radius: var(--r-sm);
}
.skip:focus { top: var(--s2); color: #fff; }

/* ---------- Modal de cookies ----------
   Nace oculto; solo script.js lo abre añadiendo .is-open.
   Los IDs cookieModal / cookieAcceptButton no se deben renombrar. */
#cookieModal {
  display: none; position: fixed; inset: 0; z-index: 90;
  align-items: center; justify-content: center; padding: 20px;
  background: var(--cookie-overlay);
  -webkit-backdrop-filter: blur(var(--cookie-blur));
  backdrop-filter: blur(var(--cookie-blur));
}
#cookieModal.is-open { display: flex; }
#cookieAcceptButton { min-height: 48px; cursor: pointer; }
.cookie {
  background: var(--hueso); width: 100%; max-width: var(--cookie-width);
  padding: var(--s3); border-radius: var(--r);
  border: 1px solid var(--linea);
  box-shadow: 0 20px 60px rgba(42, 33, 20, 0.35);
}
.cookie h2 { font-size: var(--fs-4); margin-bottom: var(--s1); }
.cookie p { font-size: var(--fs-1); margin-bottom: var(--s1); }
.cookie .fila { margin-top: var(--s2); }
.cookie .fila .btn { width: 100%; }

a.src { color: var(--mute); font-size: var(--fs-0); font-family: var(--mono); }
a.src:hover { color: var(--rio-dk); }

.muted { color: var(--mute); }

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