/* =========================================================
   Paso Ligero — hoja de estilos principal
   Paleta: tinta índigo, bruma mineral fría, agua (teal), ocre
   Tipografía de titulares: Lora (variable, alojada localmente)
   ========================================================= */

@font-face {
  font-family: "Lora";
  src: url("../fonts/lora-var.woff") format("woff-variations"),
       url("../fonts/lora-var.woff") format("woff");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color */
  --tinta:       #16293a;
  --tinta-2:     #4c6076;
  --tinta-3:     #74879a;
  --bruma:       #eff1ee;
  --bruma-2:     #e4e8e4;
  --papel:       #ffffff;
  --linea:       #d9ded9;
  --agua:        #21776f;
  --agua-osc:    #185b55;
  --agua-claro:  #d6e7e3;
  --ocre:        #c4842f;
  --ocre-claro:  #f5e7d0;

  /* Tipografía */
  --display: "Lora", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --texto: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Escala */
  --paso-1: 0.833rem;
  --paso0:  1rem;
  --paso1:  1.2rem;
  --paso2:  clamp(1.35rem, 1.15rem + 0.8vw, 1.7rem);
  --paso3:  clamp(1.6rem, 1.25rem + 1.6vw, 2.3rem);
  --paso4:  clamp(2rem, 1.4rem + 2.9vw, 3.4rem);

  /* Ritmo */
  --ancho-texto: 40rem;
  --ancho-ancho: 72rem;
  --radio: 10px;
  --radio-lg: 18px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bruma);
  color: var(--tinta);
  font-family: var(--texto);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--agua-osc); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--tinta); }

:focus-visible {
  outline: 2.5px solid var(--ocre);
  outline-offset: 3px;
  border-radius: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--tinta);
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--paso4); letter-spacing: -0.025em; }
h2 { font-size: var(--paso3); }
h3 { font-size: var(--paso2); }

p { margin: 0 0 1.15em; }

/* Compensa la cabecera fija al saltar a un ancla */
h2[id], h3[id], [id]:target { scroll-margin-top: 5.75rem; }

/* Evita desbordes con palabras o URL largas */
p, li, h1, h2, h3, td { overflow-wrap: break-word; }

/* ---------- Utilidades de disposición ---------- */
.envoltura { width: min(100% - 2.5rem, var(--ancho-ancho)); margin-inline: auto; }
.columna   { width: min(100% - 2.5rem, var(--ancho-texto)); margin-inline: auto; }

@media (max-width: 30rem) {
  .envoltura, .columna { width: min(100% - 1.75rem, var(--ancho-ancho)); }
}

.salto-enlace {
  position: fixed; left: -9999px;
  background: var(--tinta); color: #fff;
  padding: 0.7rem 1.1rem; border-radius: 0 0 var(--radio) 0; z-index: 200;
}
.salto-enlace:focus { left: 0; top: 0; }

.rubro {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--agua);
  margin: 0 0 0.9rem;
}

/* ---------- Encabezado ---------- */
.cabecera {
  position: sticky; top: 0; z-index: 100;
  background: rgba(239, 241, 238, 0.88);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--linea);
}

.cabecera__interior {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.25rem;
}

.marca {
  display: inline-flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--tinta);
}
.marca svg { width: 30px; height: 30px; flex: none; }
.marca__texto {
  font-family: var(--display);
  font-size: 1.24rem; font-weight: 600; letter-spacing: -0.02em;
}

.nav__lista {
  display: flex; align-items: center; gap: 1.75rem;
  list-style: none; margin: 0; padding: 0;
}
.nav__lista a {
  text-decoration: none; color: var(--tinta-2);
  font-size: 0.955rem; font-weight: 500;
  padding: 0.35rem 0; display: inline-block;
  border-bottom: 2px solid transparent;
}
.nav__lista a:hover { color: var(--tinta); }
.nav__lista a[aria-current="page"] { color: var(--tinta); border-bottom-color: var(--agua); }

.menu-boton {
  display: none; background: none; border: 1px solid var(--linea);
  border-radius: var(--radio); padding: 0.5rem 0.7rem; cursor: pointer;
  color: var(--tinta); align-items: center; gap: 0.5rem;
  font: inherit; font-size: 0.9rem;
}
.menu-boton svg { width: 18px; height: 18px; }

@media (max-width: 52rem) {
  .menu-boton { display: inline-flex; }
  .nav {
    position: absolute; inset-inline: 0; top: 100%;
    background: var(--papel); border-bottom: 1px solid var(--linea);
    box-shadow: 0 14px 30px rgba(22, 41, 58, 0.09);
    display: none;
  }
  .nav[data-abierto="true"] { display: block; }
  .nav__lista {
    flex-direction: column; align-items: stretch; gap: 0;
    width: min(100% - 2.5rem, var(--ancho-ancho)); margin-inline: auto;
    padding: 0.5rem 0 1rem;
  }
  .nav__lista a {
    padding: 0.8rem 0; border-bottom: 1px solid var(--linea);
    font-size: 1.02rem;
  }
  .nav__lista li:last-child a { border-bottom: none; }
  .nav__lista a[aria-current="page"] { border-bottom-color: var(--linea); color: var(--agua-osc); }
}

/* ---------- Portada del artículo ---------- */
.portada { padding: clamp(2.5rem, 6vw, 4.5rem) 0 0; }
.portada__lede {
  font-size: var(--paso1);
  line-height: 1.6; color: var(--tinta-2);
  margin: 1.4rem 0 0; max-width: 34rem;
  text-wrap: pretty;
}
.portada__meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem;
  align-items: center;
  font-size: 0.875rem; color: var(--tinta-3);
  margin: 1.6rem 0 0;
}
.portada__meta time { white-space: nowrap; }

.ilustracion {
  margin: clamp(2rem, 5vw, 3.2rem) 0 0;
  border-radius: var(--radio-lg);
  overflow: hidden;
  background: var(--bruma-2);
  box-shadow: 0 1px 0 var(--linea);
}
.ilustracion img { width: 100%; }

/* ---------- Cuerpo del artículo ---------- */
.articulo { padding: clamp(2.25rem, 5vw, 3.5rem) 0 1rem; }

.articulo h2 {
  margin: 2.75rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--agua-claro);
}
.articulo h2:first-child { margin-top: 0; }
.articulo h3 { margin: 2rem 0 0.7rem; font-weight: 600; }

.articulo ul, .articulo ol { margin: 0 0 1.3em; padding-left: 1.2rem; }
.articulo li { margin-bottom: 0.55em; padding-left: 0.2rem; }
.articulo li::marker { color: var(--agua); }

.articulo strong { font-weight: 650; color: var(--tinta); }

/* Índice */
.indice {
  background: var(--papel); border: 1px solid var(--linea);
  border-radius: var(--radio); padding: 1.3rem 1.5rem; margin: 0 0 2.5rem;
}
.indice__titulo {
  font-family: var(--texto); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--tinta-3);
  margin: 0 0 0.75rem;
}
.indice ol { counter-reset: idx; list-style: none; margin: 0; padding: 0; }
.indice li { counter-increment: idx; margin: 0 0 0.45rem; padding: 0; display: flex; gap: 0.7rem; }
.indice li::before {
  content: counter(idx, decimal-leading-zero);
  color: var(--agua); font-variant-numeric: tabular-nums;
  font-size: 0.82rem; font-weight: 600; padding-top: 0.18em; flex: none;
}
.indice li:last-child { margin-bottom: 0; }
.indice a { color: var(--tinta); text-decoration: none; border-bottom: 1px solid var(--agua-claro); }
.indice a:hover { border-bottom-color: var(--agua); }

/* Bloques destacados */
.nota {
  background: var(--papel);
  border-left: 3px solid var(--agua);
  border-radius: 0 var(--radio) var(--radio) 0;
  padding: 1.35rem 1.5rem; margin: 2rem 0;
}
.nota > :last-child { margin-bottom: 0; }
.nota__titulo {
  font-family: var(--texto); font-weight: 650; font-size: 0.97rem;
  margin: 0 0 0.55rem; color: var(--tinta);
  display: flex; align-items: center; gap: 0.55rem;
}
.nota__titulo svg { width: 19px; height: 19px; flex: none; color: var(--agua); }

.nota--atencion { border-left-color: var(--ocre); background: var(--ocre-claro); }
.nota--atencion .nota__titulo svg { color: var(--ocre); }

.aviso {
  font-size: 0.9rem; line-height: 1.65; color: var(--tinta-2);
  border-top: 1px solid var(--linea);
  padding: 1.4rem 0 0; margin: 3rem 0 0;
}
.aviso strong { color: var(--tinta); }

/* Tarjetas de práctica (listas paso a paso) */
.pasos { list-style: none; counter-reset: paso; margin: 1.5rem 0 2rem; padding: 0; }
.pasos li {
  counter-increment: paso; position: relative;
  padding: 0 0 1.25rem 3.1rem; margin: 0;
}
.pasos li::before {
  content: counter(paso);
  position: absolute; left: 0; top: 0.05em;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--agua-claro); color: var(--agua-osc);
  display: grid; place-items: center;
  font-size: 0.9rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pasos li:last-child { padding-bottom: 0; }
.pasos b { display: block; font-weight: 650; margin-bottom: 0.15rem; }

/* ---------- Cuadrícula de artículos ---------- */
.seccion { padding: clamp(3rem, 7vw, 5rem) 0; }
.seccion--claro { background: var(--papel); border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); }
.seccion__cabeza { margin: 0 0 2.25rem; }
.seccion__cabeza p { color: var(--tinta-2); margin: 0.7rem 0 0; max-width: 38rem; }

.rejilla {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  list-style: none; margin: 0; padding: 0;
}

.tarjeta {
  position: relative;
  background: var(--papel); border: 1px solid var(--linea);
  border-radius: var(--radio-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.seccion--claro .tarjeta { background: var(--bruma); }
.tarjeta:hover {
  transform: translateY(-3px);
  border-color: var(--agua-claro);
  box-shadow: 0 12px 28px rgba(22, 41, 58, 0.08);
}
.tarjeta__img { background: var(--bruma-2); aspect-ratio: 16 / 10; }
.tarjeta__img img { width: 100%; height: 100%; object-fit: cover; }
.tarjeta__cuerpo { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.tarjeta__titulo { font-size: 1.28rem; margin: 0 0 0.6rem; letter-spacing: -0.01em; }
.tarjeta__titulo a { color: inherit; text-decoration: none; }
.tarjeta__titulo a::after { content: ""; position: absolute; inset: 0; }
.tarjeta p { color: var(--tinta-2); font-size: 0.965rem; margin: 0 0 1.1rem; }
.tarjeta__pie {
  margin-top: auto; font-size: 0.83rem; color: var(--agua);
  font-weight: 600; letter-spacing: 0.02em;
}

/* ---------- Página de contacto ---------- */
.formulario { display: grid; gap: 1.1rem; margin: 2rem 0 0; }
.campo { display: grid; gap: 0.4rem; }
.campo label { font-size: 0.9rem; font-weight: 600; color: var(--tinta); }
.campo input, .campo textarea {
  font: inherit; font-size: 1rem; color: var(--tinta);
  background: var(--papel); border: 1px solid var(--linea);
  border-radius: var(--radio); padding: 0.75rem 0.9rem; width: 100%;
}
.campo textarea { min-height: 9rem; resize: vertical; }
.campo input:focus, .campo textarea:focus { border-color: var(--agua); }

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--agua); color: #fff; border: none;
  border-radius: 999px; padding: 0.8rem 1.6rem;
  font: inherit; font-size: 0.98rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  justify-self: start; transition: background 0.2s ease;
}
.boton:hover { background: var(--agua-osc); color: #fff; }

.datos-contacto {
  list-style: none; margin: 1.75rem 0 0; padding: 1.5rem 0 0;
  border-top: 1px solid var(--linea);
  display: grid; gap: 0.6rem; font-size: 0.97rem;
}
.datos-contacto strong { display: block; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tinta-3); font-weight: 600; }

/* ---------- Páginas legales ---------- */
.legal { padding: clamp(2.5rem, 6vw, 4rem) 0 1rem; }
.legal h2 { font-size: var(--paso2); margin: 2.5rem 0 0.9rem; padding-top: 1.4rem; border-top: 1px solid var(--linea); }
.legal h2:first-of-type { margin-top: 2rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: 0.5em; }
.legal__fecha { font-size: 0.875rem; color: var(--tinta-3); margin-top: 0.9rem; }

/* ---------- Pie ---------- */
.pie {
  background: var(--tinta); color: #c3cfda;
  padding: clamp(2.75rem, 6vw, 4rem) 0 2rem; margin-top: clamp(3rem, 7vw, 5rem);
  font-size: 0.95rem;
}
.pie a { color: #e6edf2; text-decoration: none; }
.pie a:hover { color: #fff; text-decoration: underline; }
.pie__rejilla {
  display: grid; gap: 2.25rem;
  grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(9rem, 1fr));
}
.pie .marca { color: #fff; }
.pie .marca svg { color: var(--agua-claro); }
.pie__sobre { margin: 1rem 0 0; max-width: 26rem; color: #a8b8c6; }
.pie__titulo {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: #8fa2b2; margin: 0 0 0.9rem;
}
.pie__lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.pie__base {
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem;
  justify-content: space-between;
  font-size: 0.87rem; color: #8fa2b2;
}
.pie__base p { margin: 0; }

/* ---------- Aviso de cookies ---------- */
.cookies {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 150;
  background: var(--papel); border-top: 1px solid var(--linea);
  box-shadow: 0 -8px 30px rgba(22, 41, 58, 0.1);
  padding: 1.1rem 0;
}
.cookies[hidden] { display: none; }
.cookies__interior {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  justify-content: space-between;
}
.cookies p { margin: 0; font-size: 0.92rem; color: var(--tinta-2); max-width: 46rem; }
.cookies .boton { padding: 0.6rem 1.4rem; font-size: 0.93rem; }
