/* Estilo común de las guías de LeYajad.
   Los tokens son los del sistema de diseño de la aplicación (docs/diseno.md §1):
   azul de marca para acción y navegación, carbón para el texto y cobre para lo
   que celebra horas. Se sirve como fichero aparte para que las seis páginas
   compartan una sola definición. */

:root {
  --primary-50: #eef4fb;
  --primary-100: #d7e5f7;
  --primary-200: #afcbee;
  --primary-600: #245ba6;
  --primary-700: #1c4a88;
  --primary-900: #0f2a4e;

  --neutral-0: #ffffff;
  --neutral-50: #f6f7f9;
  --neutral-100: #eef0f3;
  --neutral-200: #e1e5ea;
  --neutral-300: #c9cfd6;
  --neutral-500: #6b7480;
  --neutral-600: #545d68;
  --neutral-700: #3d454f;
  --neutral-800: #2b313a;
  --neutral-900: #1e242c;

  --accent-50: #fbf1ec;
  --accent-100: #f6dfd3;
  --accent-600: #b8552e;
  --accent-700: #964322;

  --success-50: #e6f4ec;
  --success-700: #186541;
  --warning-50: #fdf4df;
  --warning-700: #78500c;
  --danger-50: #fcebe9;
  --danger-700: #8f1c12;

  --ground: var(--neutral-50);
  --surface: var(--neutral-0);
  --ink: var(--neutral-900);
  --ink-body: var(--neutral-800);
  --ink-soft: var(--neutral-600);
  --ink-faint: var(--neutral-500);
  --edge: var(--neutral-200);
  --edge-soft: var(--neutral-100);
  --link: var(--primary-600);
  --sombra: 0 1px 2px rgba(20, 24, 31, 0.06), 0 10px 28px -18px rgba(20, 24, 31, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-tema='claro']) {
    --ground: #12161c;
    --surface: #1a1f27;
    --ink: #eef1f5;
    --ink-body: #dbe0e7;
    --ink-soft: #a8b1bc;
    --ink-faint: #8b95a1;
    --edge: #2c333d;
    --edge-soft: #242a33;
    --link: #8fb6e6;
    --primary-50: #17283d;
    --primary-100: #1d3a57;
    --accent-50: #2e1d15;
    --accent-100: #3d2619;
    --accent-600: #e0956f;
    --accent-700: #e8ab8b;
    --success-50: #12291d;
    --success-700: #7cc79b;
    --warning-50: #2c2413;
    --warning-700: #ddb55f;
    --danger-50: #2e1917;
    --danger-700: #e79d93;
    --sombra: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 28px -18px rgba(0, 0, 0, 0.8);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink-body);
  font-family: 'Source Sans 3', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  color: var(--ink);
  line-height: 1.2;
  font-weight: 600;
  margin: 0;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-700);
}

:focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
  border-radius: 4px;
}

code,
kbd {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--edge-soft);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 0.1em 0.38em;
}

/* --------------------------------------------------------------- cabecera */
.barra {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  /* Casi opaca: con menos, el texto que pasa por debajo al hacer scroll se sigue leyendo
     a través de la barra en los navegadores que no aplican el desenfoque. */
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
}

.barra .marca {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.barra .marca .y {
  color: var(--primary-600);
}

.barra .marca svg {
  width: 26px;
  height: 26px;
}

.barra .volver {
  margin-left: auto;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.envoltura {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 24px 96px;
}

header.portadilla {
  padding: 56px 0 32px;
  max-width: 44rem;
}

header.portadilla .quien {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-700);
  background: var(--accent-50);
  border: 1px solid var(--accent-100);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 18px;
}

header.portadilla h1 {
  font-size: clamp(2.1rem, 5vw, 3rem);
  letter-spacing: -0.015em;
}

header.portadilla p.entradilla {
  font-size: 1.18rem;
  color: var(--ink-soft);
  margin: 18px 0 0;
}

/* ------------------------------------------------------------------ índice */
.indice {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 48px;
  box-shadow: var(--sombra);
}

.indice h2 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
}

.indice ol {
  margin: 0;
  padding-left: 22px;
  columns: 2;
  column-gap: 32px;
}

.indice li {
  margin: 5px 0;
  break-inside: avoid;
}

.indice a {
  text-decoration: none;
  font-weight: 600;
}

.indice a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .indice ol {
    columns: 1;
  }
}

/* --------------------------------------------------------------- secciones */
section.paso {
  margin: 0 0 64px;
  scroll-margin-top: 84px;
}

section.paso > h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 6px;
}

section.paso > h2 .num {
  flex: none;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-700);
  background: var(--accent-50);
  border: 1px solid var(--accent-100);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

section.paso h3 {
  font-size: 1.2rem;
  margin: 34px 0 8px;
}

section.paso p {
  margin: 14px 0;
  max-width: 44rem;
}

section.paso ul,
section.paso ol {
  max-width: 44rem;
  padding-left: 24px;
}

section.paso li {
  margin: 7px 0;
}

/* ----------------------------------------------------------------- figuras */
figure {
  margin: 26px 0;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--edge);
  border-radius: 12px;
  box-shadow: var(--sombra);
  background: var(--surface);
}

figure.movil img {
  max-width: 340px;
  margin: 0 auto;
}

figcaption {
  margin-top: 10px;
  font-size: 15px;
  color: var(--ink-faint);
  max-width: 44rem;
}

/* ------------------------------------------------------------------ avisos */
.aviso {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  margin: 22px 0;
  padding: 14px 18px;
  border: 1px solid var(--edge);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 16px;
  max-width: 44rem;
}

.aviso p {
  margin: 0;
}

.aviso p + p {
  margin-top: 8px;
}

.aviso svg {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.aviso.dato {
  background: var(--primary-50);
  border-color: var(--primary-200);
  border-left-color: var(--primary-600);
  color: var(--ink-body);
}

.aviso.dato svg {
  color: var(--primary-600);
}

.aviso.ojo {
  background: var(--warning-50);
  border-left-color: var(--warning-700);
}

.aviso.ojo svg {
  color: var(--warning-700);
}

.aviso.bien {
  background: var(--success-50);
  border-left-color: var(--success-700);
}

.aviso.bien svg {
  color: var(--success-700);
}

.aviso.cuidado {
  background: var(--danger-50);
  border-left-color: var(--danger-700);
}

.aviso.cuidado svg {
  color: var(--danger-700);
}

/* ------------------------------------------------------------------ tablas */
.tabla {
  width: 100%;
  max-width: 44rem;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 16px;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 10px;
  overflow: hidden;
}

.tabla th,
.tabla td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--edge-soft);
  vertical-align: top;
}

.tabla th {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--edge-soft);
}

.tabla tr:last-child td {
  border-bottom: 0;
}

/* --------------------------------------------------- botón dentro del texto */
.boton-app {
  display: inline-block;
  font-size: 0.92em;
  font-weight: 600;
  color: var(--primary-700);
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: 6px;
  padding: 1px 8px;
  white-space: nowrap;
}

/* ------------------------------------------------------------- tarjetas del índice */
/* Dos columnas en escritorio: con cuatro guías, tres por fila dejaban una suelta abajo. */
.tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 20px;
  margin: 40px 0 24px;
}

.tarjeta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 14px;
  box-shadow: var(--sombra);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.tarjeta:hover {
  border-color: var(--primary-600);
  transform: translateY(-2px);
}

.tarjeta .icono {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-50);
  color: var(--primary-600);
  margin-bottom: 6px;
}

.tarjeta h2 {
  font-size: 1.35rem;
}

.tarjeta p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.tarjeta .flecha {
  margin-top: auto;
  padding-top: 12px;
  font-weight: 600;
  color: var(--link);
  font-size: 15px;
}

/* --------------------------------------------------------------------- pie */
footer.pie {
  border-top: 1px solid var(--edge);
  margin-top: 72px;
  padding-top: 28px;
  color: var(--ink-faint);
  font-size: 15px;
}

footer.pie p {
  margin: 6px 0;
}

/* ------------------------------------------------------- índice pegajoso lateral */
@media (min-width: 1180px) {
  .con-lateral {
    display: grid;
    grid-template-columns: 1fr 15rem;
    gap: 56px;
    align-items: start;
  }

  .lateral {
    position: sticky;
    top: 84px;
    font-size: 15px;
    border-left: 2px solid var(--edge);
    padding-left: 18px;
  }

  .lateral p {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 0 0 10px;
  }

  .lateral a {
    display: block;
    padding: 4px 0;
    text-decoration: none;
    color: var(--ink-soft);
  }

  .lateral a:hover {
    color: var(--link);
  }

  .indice {
    display: none;
  }
}

@media (max-width: 1179px) {
  .lateral {
    display: none;
  }
}
