/* ══════════════════════════════════════════════════════════════════
   BLOG DE BROGAINZ — hoja de estilo compartida por el índice y los
   artículos. Hereda el sistema visual de index.html (Bebas Neue +
   Barlow, esmeralda #10b981, fondo casi negro, ruido + viñeta).

   Regla de color: nunca texto gris. La jerarquía se construye con
   tamaño, peso y esmeralda; el cuerpo baja como mucho a #eaeaea.

   Generado desde blog/templates/blog.css — no editar en public/.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --emerald: #10b981;
  --emerald-dark: #059669;
  --emerald-glow: rgba(16, 185, 129, 0.3);
  --amber: #f59e0b;
  --bg: #020202;
  --bg2: #060606;
  --bg3: #0c0c0c;
  --surface: #111111;
  --surface2: #181818;
  --text: #ffffff;
  --text-soft: #eaeaea;
  --border: rgba(255, 255, 255, 0.06);
  --border-hot: rgba(16, 185, 129, 0.25);
  --nav-h: 74px;
  --measure: 68ch;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

::selection { background: var(--emerald); color: #000; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ruido + viñeta: la misma textura de la landing. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

a { color: var(--emerald); text-decoration: none; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 3px;
}

img { max-width: 100%; display: block; }

/* ─────────────────────────── NAV ─────────────────────────── */

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 4rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(2, 2, 2, 0.92);
  border-bottom: 1px solid rgba(16, 185, 129, 0.08);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.15em;
  color: var(--text);
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-logo img { height: 34px; width: 34px; object-fit: contain; }
.nav-logo span { color: var(--emerald); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-links a {
  color: var(--text);
  position: relative;
  padding-bottom: 3px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--emerald);
  transition: width 0.25s ease;
}

.nav-links a:hover::after,
.nav-links a[aria-current='page']::after { width: 100%; }
.nav-links a[aria-current='page'] { color: var(--emerald); }

.nav-cta {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #000;
  background: var(--emerald);
  padding: 0.62rem 1.5rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--emerald-glow);
}

/* Barra de progreso de lectura */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--emerald-dark), var(--emerald));
  z-index: 101;
  transition: width 0.1s linear;
}

/* ────────────────────── CABECERA DEL ÍNDICE ────────────────────── */

.blog-hero {
  position: relative;
  padding: calc(var(--nav-h) + 5rem) 2rem 3.5rem;
  text-align: center;
  overflow: hidden;
}

.blog-hero::before {
  content: '';
  position: absolute;
  top: -40%; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 900px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.14) 0%, transparent 62%);
  pointer-events: none;
}

.kicker {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--emerald);
  margin-bottom: 0.9rem;
}

.blog-hero h1 {
  position: relative;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.blog-hero h1 span { color: var(--emerald); }

.blog-hero .lede {
  position: relative;
  max-width: 60ch;
  margin: 1.4rem auto 0;
  font-size: 1.15rem;
  color: var(--text-soft);
}

/* ───────────────────────── FILTROS ───────────────────────── */

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  padding: 0 2rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}

.filter {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter:hover { border-color: var(--border-hot); transform: translateY(-2px); }
.filter.active { background: var(--emerald); border-color: var(--emerald); color: #000; }

/* ───────────────────── DESTACADO + TARJETAS ───────────────────── */

.blog-main { max-width: 1160px; margin: 0 auto; padding: 0 2rem 5rem; }

.featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 3.5rem;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.featured:hover { border-color: var(--border-hot); transform: translateY(-4px); }

/* La portada es una tarjeta 1200x630 con titular propio: se muestra
   completa, nunca recortada, o se pierde el texto de la composición. */
.featured-media {
  display: block;
  position: relative;
  align-self: center;
  aspect-ratio: 1200 / 630;
}

.featured-media img { width: 100%; height: 100%; object-fit: contain; }

.featured-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 70%, var(--surface) 100%);
}

.featured-body {
  padding: 2.6rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
}

.featured-body h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.02;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.featured-body h2 a { color: var(--text); }
.featured-body h2 a:hover { color: var(--emerald); }
.featured-body p { color: var(--text-soft); font-size: 1.05rem; }

.featured-cta {
  align-self: flex-start;
  margin-top: 0.5rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--emerald);
  border-bottom: 2px solid var(--emerald);
  padding-bottom: 2px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.8rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hot);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.card-media { display: block; aspect-ratio: 1200 / 630; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card-media img { transform: scale(1.04); }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.5rem 1.5rem 1.6rem;
  flex: 1;
}

.card-body h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.55rem;
  line-height: 1.08;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.card-body h3 a { color: var(--text); }
.card-body h3 a:hover { color: var(--emerald); }
.card-body p { color: var(--text-soft); font-size: 0.98rem; flex: 1; }

.card-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.chip {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
}

.chip-hot { color: #000; background: var(--emerald); border-color: var(--emerald); }

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--emerald); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-soft);
}

/* ────────────────────── ARTÍCULO: CABECERA ────────────────────── */

.post-hero {
  position: relative;
  min-height: 56vh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--nav-h) + 3rem) 2rem 3rem;
  overflow: hidden;
}

/* La portada se reusa como fondo, pero desenfocada: trae su propio
   titular impreso y sin blur competiría con el H1 de la página. Así
   solo aporta el lavado de color de cada artículo. */
.post-hero-img {
  position: absolute;
  inset: -10%;
  z-index: -2;
  overflow: hidden;
  background: radial-gradient(ellipse at 22% 72%, rgba(16, 185, 129, 0.20) 0%, transparent 58%);
}

.post-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: blur(60px) saturate(1.35);
  transform: scale(1.2);
}

/* Rejilla técnica: la misma del hero de la landing. */
.post-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 25% 60%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 25% 60%, #000 10%, transparent 75%);
}

.post-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(2, 2, 2, 0.72) 0%, rgba(2, 2, 2, 0.3) 40%, var(--bg) 100%);
}

.post-hero-inner { width: 100%; max-width: 900px; margin: 0 auto; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.breadcrumb a { color: var(--text-soft); }
.breadcrumb a:hover { color: var(--emerald); }
.breadcrumb span { color: var(--emerald); }

.post-hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.4rem, 6.5vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.post-dek {
  font-size: 1.2rem;
  color: var(--text-soft);
  max-width: 62ch;
  margin-bottom: 1.4rem;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.post-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.1rem; }

/* ──────────────── ARTÍCULO: LAYOUT + ÍNDICE ──────────────── */

.post-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 3.5rem;
  max-width: 1160px;
  margin: 0 auto;
  padding: 3.5rem 2rem 4rem;
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.3rem 1.2rem;
}

.toc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: 0;
  padding: 0;
  cursor: default;
  color: var(--emerald);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.toc-toggle svg { width: 16px; height: 16px; display: none; }

.toc-list { list-style: none; margin-top: 1rem; display: grid; gap: 0.55rem; }

.toc-list a {
  display: block;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.35;
  border-left: 2px solid var(--border);
  padding-left: 0.75rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.toc-list .toc-h3 a { padding-left: 1.5rem; font-size: 0.9rem; }
.toc-list a:hover { color: var(--emerald); border-color: var(--emerald); }
.toc-list a.active { color: var(--emerald); border-color: var(--emerald); font-weight: 600; }

/* ──────────────────── ARTÍCULO: CUERPO ──────────────────── */

.prose { max-width: var(--measure); font-size: 1.09rem; color: var(--text-soft); }

.prose > * + * { margin-top: 1.3rem; }

.prose h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: var(--text);
  margin-top: 3.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.prose h3 {
  font-family: 'Barlow', sans-serif;
  font-weight: 900;
  font-size: 1.35rem;
  line-height: 1.25;
  color: var(--text);
  margin-top: 2.2rem;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.prose h4 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--emerald);
  margin-top: 1.9rem;
}

.prose p strong { color: var(--text); font-weight: 700; }
.prose a { border-bottom: 1px solid var(--emerald-glow); }
.prose a:hover { border-bottom-color: var(--emerald); }

.prose ul, .prose ol { padding-left: 1.3rem; display: grid; gap: 0.6rem; }
.prose li { padding-left: 0.3rem; }
.prose li::marker { color: var(--emerald); font-weight: 700; }

.prose blockquote {
  border-left: 3px solid var(--emerald);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.07), transparent);
  padding: 1.1rem 1.4rem;
  border-radius: 0 12px 12px 0;
}

.prose blockquote p {
  font-family: 'Barlow', sans-serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text);
}

.prose hr { border: 0; height: 1px; background: var(--border); margin: 2.5rem 0; }

.prose img { border-radius: 16px; border: 1px solid var(--border); margin: 2rem 0; }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.09);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}

.prose pre {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
  overflow-x: auto;
}

.prose pre code { color: var(--text-soft); background: none; padding: 0; }

.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }

.prose table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }

.prose th {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--emerald);
  background: var(--surface2);
  text-align: left;
  padding: 0.85rem 1rem;
  white-space: nowrap;
}

.prose td { padding: 0.8rem 1rem; border-top: 1px solid var(--border); color: var(--text-soft); }
.prose tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* ───────────────────────── COMPARTIR ───────────────────────── */

.share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border);
  max-width: var(--measure);
}

.share-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
}

.share-btns { display: flex; gap: 0.6rem; }

.share-btn {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn svg { width: 18px; height: 18px; }

.share-btn:hover {
  color: #000;
  background: var(--emerald);
  border-color: var(--emerald);
  transform: translateY(-3px);
}

.share-btn.copied { color: #000; background: var(--emerald); border-color: var(--emerald); }

/* ──────────────────── CTA DE DESCARGA ──────────────────── */

.download-cta,
.newsletter {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-hot);
  border-radius: 24px;
  padding: 2.6rem;
  margin-top: 3.5rem;
  text-align: center;
}

.download-cta::before,
.newsletter::before {
  content: '';
  position: absolute;
  top: -60%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 65%);
  pointer-events: none;
}

.download-cta h2,
.newsletter h2 {
  position: relative;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.03;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.download-cta h2 span,
.newsletter h2 span { color: var(--emerald); }

.download-cta .sub,
.newsletter .sub {
  position: relative;
  max-width: 52ch;
  margin: 0.8rem auto 0;
  color: var(--text-soft);
}

.store-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.8rem;
}

.store-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--text);
  color: #000;
  border-radius: 14px;
  padding: 0.75rem 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.store-btn svg { width: 26px; height: 26px; flex-shrink: 0; }
.store-btn span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; text-align: left; }
.store-btn small { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.store-btn strong { font-family: 'Barlow Condensed', sans-serif; font-size: 1.25rem; font-weight: 900; letter-spacing: 0.04em; }
.store-btn:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(255, 255, 255, 0.18); }

.founders-note {
  position: relative;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.founders-note strong { color: var(--emerald); }
.founders-note a { border-bottom: 1px solid var(--emerald-glow); }

/* ───────────────────────── NEWSLETTER ───────────────────────── */

.nl-form {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.8rem;
}

.nl-form input[type='email'] {
  flex: 1 1 280px;
  max-width: 380px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.nl-form input[type='email']::placeholder { color: #8f8f8f; }
.nl-form input[type='email']:focus { border-color: var(--emerald); }

/* Honeypot: invisible para humanos, irresistible para bots. */
.nl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.nl-form button {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #000;
  background: var(--emerald);
  border: 0;
  border-radius: 12px;
  padding: 0.85rem 2rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nl-form button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 30px var(--emerald-glow); }
.nl-form button:disabled { opacity: 0.6; cursor: wait; }

.nl-msg {
  position: relative;
  min-height: 1.5rem;
  margin-top: 0.9rem;
  font-weight: 600;
  font-size: 0.98rem;
}

.nl-msg.ok { color: var(--emerald); }
.nl-msg.err { color: var(--amber); }

/* ─────────────────────── RELACIONADOS ─────────────────────── */

.related { margin-top: 4.5rem; }

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 1.8rem;
}

.section-title span { color: var(--emerald); }

.related .card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ───────────────────────── FOOTER ───────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  padding: 3rem 2rem 2.5rem;
  text-align: center;
  display: grid;
  gap: 1.2rem;
  justify-items: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.footer-logo img { height: 32px; width: 32px; object-fit: contain; }
.footer-logo span { color: var(--emerald); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.6rem;
  list-style: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-links a { color: var(--text); }
.footer-links a:hover { color: var(--emerald); }

.footer-copy { font-size: 0.88rem; color: var(--text-soft); max-width: 60ch; }

/* ───────────────────────── RESPONSIVE ───────────────────────── */

@media (max-width: 1080px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); gap: 2rem; }

  .toc {
    position: static;
    order: -1;
    max-width: var(--measure);
  }

  .toc-toggle { cursor: pointer; }
  .toc-toggle svg { display: block; transition: transform 0.25s ease; }
  .toc-toggle[aria-expanded='true'] svg { transform: rotate(180deg); }
  .toc-list { display: none; }
  .toc-toggle[aria-expanded='true'] + .toc-list { display: grid; }
}

@media (max-width: 900px) {
  .site-nav { padding: 0.9rem 1.5rem; }
  .nav-links { display: none; }
  .featured { grid-template-columns: 1fr; }
  .featured-media { min-height: 240px; }
  .featured-media::after { background: linear-gradient(180deg, transparent 45%, var(--surface) 100%); }
  .featured-body { padding: 1.8rem; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  :root { --nav-h: 66px; }
  .nav-logo { font-size: 1.45rem; }
  .nav-logo img { height: 30px; width: 30px; }
  .blog-hero { padding: calc(var(--nav-h) + 3rem) 1.25rem 2.5rem; }
  .blog-main { padding: 0 1.25rem 3.5rem; }
  .post-hero { min-height: 52vh; padding: calc(var(--nav-h) + 2rem) 1.25rem 2rem; }
  .post-layout { padding: 2.5rem 1.25rem 3rem; }
  .download-cta, .newsletter { padding: 2rem 1.4rem; border-radius: 20px; }
  .store-btn { flex: 1 1 100%; justify-content: center; }
  .share { flex-direction: column; align-items: flex-start; }
  .prose h2 { margin-top: 2.6rem; }
}

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