/* Tipografía y elementos de documento. */

body {
  font-family: var(--nl-font);
  font-size: var(--nl-text-base);
  line-height: 1.65;
  color: var(--nl-text);
  background: var(--nl-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Los titulares mandan por tamaño y por aire, no por grosor: la referencia
   titula con peso 500. Un 800 aquí se ve pesado sobre fondo negro, porque el
   texto claro sobre oscuro ya aparenta más grueso de lo que es. */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--nl-font);
  color: var(--nl-text);
  font-weight: var(--nl-weight-title);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: var(--nl-space-12);
  margin-bottom: var(--nl-space-4);
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5vw, var(--nl-text-3xl)); margin-top: 0; letter-spacing: -0.03em; }
h2 { font-size: var(--nl-text-2xl); }
h3 { font-size: var(--nl-text-xl); font-weight: 600; }
h4 { font-size: var(--nl-text-lg); font-weight: 600; }

p { margin: 0 0 var(--nl-space-6); color: var(--nl-text-muted); }

.entry-content > p,
.entry-content > ul,
.entry-content > ol,
.entry-content > blockquote {
  max-width: var(--nl-measure);
}

a {
  color: var(--nl-text);
  text-decoration-color: color-mix(in srgb, var(--nl-red) 60%, transparent);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color var(--nl-transition), text-decoration-color var(--nl-transition);
}
a:hover { color: var(--nl-red-soft); text-decoration-color: currentColor; }

p a, li a { color: var(--nl-red-soft); }
p a:hover, li a:hover { color: var(--nl-red); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--nl-red);
  outline-offset: 2px;
  border-radius: 4px;
}

strong { font-weight: var(--nl-weight-strong); color: var(--nl-text); }

ul, ol { padding-left: 1.35em; margin: 0 0 var(--nl-space-6); color: var(--nl-text-muted); }
li { margin-bottom: var(--nl-space-2); }
li::marker { color: var(--nl-red); }

blockquote {
  margin: var(--nl-space-8) 0;
  padding: var(--nl-space-4) var(--nl-space-6);
  border-left: 2px solid var(--nl-red);
  background: var(--nl-bg-subtle);
  border-radius: 0 var(--nl-radius) var(--nl-radius) 0;
  color: var(--nl-text-muted);
}
blockquote p:last-child { margin-bottom: 0; }

hr {
  border: 0;
  height: 1px;
  background: var(--nl-border);
  margin: var(--nl-space-16) 0;
}

img, video { max-width: 100%; height: auto; border-radius: var(--nl-radius); }

/* Código ------------------------------------------------------------------ */

code, kbd, samp {
  font-family: var(--nl-font-mono);
  font-size: 0.875em;
  font-variant-ligatures: none;
}

:not(pre) > code {
  background: var(--nl-code-inline-bg);
  color: var(--nl-code-inline-text);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  border: 1px solid var(--nl-border-soft);
  white-space: nowrap;
}

pre {
  background: var(--nl-code-bg);
  color: var(--nl-code-text);
  padding: var(--nl-space-6);
  border: 1px solid var(--nl-code-border);
  border-radius: var(--nl-radius);
  overflow-x: auto;          /* el bloque hace scroll, la página nunca */
  font-family: var(--nl-font-mono);
  font-size: var(--nl-text-sm);
  line-height: 1.7;
  margin: var(--nl-space-8) 0;
  -webkit-overflow-scrolling: touch;
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  white-space: pre;
}

/* Tablas ------------------------------------------------------------------ */

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--nl-space-8) 0;
  font-size: var(--nl-text-sm);
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
@media (min-width: 768px) {
  .entry-content table { display: table; white-space: normal; }
}

.entry-content th {
  text-align: left;
  font-weight: 600;
  padding: var(--nl-space-3) var(--nl-space-4);
  border-bottom: 1px solid var(--nl-border);
  color: var(--nl-text);
}
.entry-content td {
  padding: var(--nl-space-3) var(--nl-space-4);
  border-bottom: 1px solid var(--nl-border-soft);
  vertical-align: top;
  color: var(--nl-text-muted);
}
.entry-content tbody tr:hover { background: var(--nl-bg-subtle); }

@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;
  }
}
