/* Blog de Kibo Academy. Misma línea que la web v3 (DESIGN.md y src/estilos/): papel claro con el
   fondo de líneas de desnivel, Geist ligera, pizarra y un único acento rojo. Sin JavaScript. */

@font-face {
  font-family: 'Geist Variable';
  src: url('/fonts/geist-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --papel: #F4F4F1;
  --papel-2: #EAEAE5;
  --pizarra: #273039;
  --pizarra-2: #5E676F;
  --linea: rgb(39 48 57 / 0.14);
  --linea-oscura: rgb(244 244 241 / 0.16);
  --rojo: #DB4334;
  --sendero-sl: #1E8449;
  --sendero-pr: #E8B800;
  --sendero-gr: #D0212A;

  --fuente: 'Geist Variable', system-ui, sans-serif;
  --t-h1: clamp(36px, 5vw, 68px);
  --t-h2: clamp(26px, 3vw, 38px);
  --margen: clamp(20px, 4.5vw, 64px);
  --ancho: 1240px;
  --contenido: 960px; /* todo el artículo, portada incluida, ocupa este ancho */
  --radio: 24px;
  --pildora: 999px;
  --cabecera-alto: 72px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-padding-top: calc(var(--cabecera-alto) + 16px);
  scroll-behavior: smooth;
  background: var(--papel);
}
body {
  margin: 0; min-height: 100svh;
  font-family: var(--fuente); font-weight: 300; font-size: 17px; line-height: 1.55;
  color: var(--pizarra); background: transparent;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
/* fondo de líneas de desnivel: uno solo, fijo, detrás de toda la página */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--papel) url('/img/fondo/marmol.webp') center / cover no-repeat;
}
@media (max-width: 900px) { body::before { background-image: url('/img/fondo/marmol-1400.webp'); } }

::selection { background: var(--pizarra); color: var(--papel); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 4px; }
h1, h2, h3, h4 { font-weight: 300; text-wrap: balance; }
strong, b { font-weight: 400; }

.saltar {
  position: fixed; left: var(--margen); top: 12px; z-index: 200; padding: 8px 16px; border-radius: var(--pildora);
  background: var(--pizarra); color: var(--papel); font-size: 14px; font-weight: 400; text-decoration: none;
  translate: 0 -200%;
}
.saltar:focus-visible { translate: 0 0; }

.aviso-previa {
  margin: 0; padding: 8px var(--margen); position: relative; z-index: 60;
  background: var(--pizarra); color: var(--papel); font-size: 14px; font-weight: 400; text-align: center;
}

/* ───────── enlace con subrayado que crece ───────── */
.enlace {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0% 1px no-repeat; padding-bottom: 2px;
  transition: background-size 0.5s var(--ease);
}
.enlace:is(:hover, :focus-visible) { background-size: 100% 1px; }

/* ───────── botón con flecha redonda ───────── */
.boton {
  display: inline-flex; align-items: center; gap: 18px; height: 56px; padding: 0 8px 0 26px;
  border-radius: var(--pildora); background: var(--papel); color: var(--pizarra);
  font-size: 15px; font-weight: 400; white-space: nowrap; text-decoration: none;
}
.boton--oscuro { background: var(--pizarra); color: var(--papel); }
.boton__circulo {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--pizarra); color: var(--papel);
  transition: background-color 0.35s, transform 0.6s var(--ease);
}
.boton--oscuro .boton__circulo { background: var(--papel); color: var(--pizarra); }
.boton:is(:hover, :focus-visible) .boton__circulo { background: var(--rojo); color: var(--papel); transform: translateX(8px); }
.boton:active { transform: scale(0.98); }

/* ───────── sendero ───────── */
.sendero { display: grid; gap: 3px; width: 22px; flex: none; }
.sendero::before, .sendero::after { content: ''; height: 5px; }
.sendero::before { background: #fff; box-shadow: inset 0 0 0 1px var(--linea); }
.sendero--sl::after { background: var(--sendero-sl); }
.sendero--pr::after { background: var(--sendero-pr); }
.sendero--gr::after { background: var(--sendero-gr); }

/* ───────── cabecera fija, en tres columnas ───────── */
.cabecera {
  position: sticky; top: 0; z-index: 50; height: var(--cabecera-alto);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 var(--margen);
  font-size: 14px; font-weight: 400;
  background: linear-gradient(rgb(244 244 241 / 0.92) 55%, rgb(244 244 241 / 0));
}
.cabecera__lado { justify-self: start; }
.cabecera__lado--fin { justify-self: end; }
.cabecera__logo { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; text-decoration: none; }
.cabecera__logo img { height: 24px; width: auto; }

/* ───────── pie oscuro ───────── */
.pie { margin-top: clamp(96px, 12vw, 160px); background: var(--pizarra); color: var(--papel); padding: clamp(80px, 10vw, 140px) var(--margen) 32px; }
.pie p, .pie h2, .pie ul { margin: 0; }
.pie__lema { font-size: clamp(40px, 7.4vw, 124px); font-weight: 300; line-height: 1; letter-spacing: -0.04em; text-transform: uppercase; }
.pie__columnas { margin-top: clamp(56px, 7vw, 96px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; font-size: 15px; }
.pie__columnas h2 { font-size: 14px; font-weight: 400; opacity: 0.6; margin-bottom: 14px; }
.pie__columnas ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.pie__camino { display: inline-flex; align-items: center; gap: 12px; }
.pie__franja { margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--linea-oscura); display: flex; justify-content: space-between; gap: 16px; font-size: 14px; opacity: 0.75; }
.pie__franja ul { list-style: none; padding: 0; display: flex; gap: 24px; }
@media (max-width: 700px) { .pie__columnas { grid-template-columns: 1fr; } .pie__franja { flex-direction: column; } }

/* ───────── estructura y titulares ───────── */
main { padding-top: clamp(32px, 6vw, 72px); }
.envoltura { width: min(var(--ancho), 100% - 2 * var(--margen)); margin-inline: auto; }
.envoltura--estrecha { width: min(var(--contenido), 100% - 2 * var(--margen)); }

.antetitulo {
  margin: 0 0 20px; font-size: 14px; font-weight: 400; color: var(--pizarra-2);
  display: flex; align-items: center; gap: 12px;
}
.antetitulo::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--rojo); }

h1 { margin: 0 0 24px; font-size: var(--t-h1); line-height: 1.02; letter-spacing: -0.045em; }
h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; }
.subtitulo { margin: 72px 0 24px; font-size: var(--t-h2); letter-spacing: -0.03em; }

.entradilla {
  margin: 0 0 40px; max-width: 60ch; font-size: clamp(18px, 2vw, 21px); line-height: 1.5;
  color: var(--pizarra-2); text-wrap: pretty;
}
.etiqueta { margin: 0; font-size: 14px; font-weight: 400; color: var(--pizarra-2); }

/* ───────── filtro, tarjetas y paginación ───────── */
.filtro { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 40px; }
.filtro a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 8px 18px; border-radius: var(--pildora); border: 1px solid var(--linea);
  font-size: 14px; font-weight: 400; text-decoration: none; color: var(--pizarra-2);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.filtro a:hover { border-color: var(--pizarra); color: var(--pizarra); }
.filtro a[aria-current='page'] { background: var(--pizarra); border-color: var(--pizarra); color: var(--papel); }

.rejilla { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.tarjeta {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: rgb(244 244 241 / 0.7); border: 1px solid var(--linea); border-radius: var(--radio);
  transition: border-color 0.4s var(--ease);
}
.tarjeta:hover { border-color: rgb(39 48 57 / 0.4); }
.tarjeta__imagen { overflow: hidden; }
.tarjeta__imagen img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 1.2s var(--ease); }
.tarjeta:hover .tarjeta__imagen img { transform: scale(1.03); }
.tarjeta__texto { display: grid; gap: 10px; padding: 24px; font-size: 15px; line-height: 1.5; color: var(--pizarra-2); }
.tarjeta h2 { margin: 0; font-size: 24px; line-height: 1.15; color: var(--pizarra); letter-spacing: -0.03em; }
.tarjeta h2 a { text-decoration: none; }
.tarjeta h2 a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radio); }
.tarjeta h2 a:focus-visible { outline: none; }
.tarjeta h2 a:focus-visible::after { outline: 2px solid var(--pizarra); outline-offset: -2px; }
.tarjeta p { margin: 0; }
.tarjeta time { font-size: 13px; }
.tarjeta--destacada { margin-bottom: 24px; }
.tarjeta--destacada h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.05; letter-spacing: -0.04em; }
.tarjeta--destacada .tarjeta__texto { font-size: 17px; align-content: center; padding: clamp(24px, 4vw, 48px); }
@media (min-width: 800px) {
  .tarjeta--destacada { display: grid; grid-template-columns: 3fr 2fr; }
  .tarjeta--destacada .tarjeta__imagen img { height: 100%; aspect-ratio: auto; min-height: 340px; }
}

.paginacion {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 24px;
  margin: 48px 0 0; font-size: 15px; color: var(--pizarra-2);
}
.paginacion a { display: inline-flex; align-items: center; min-height: 44px; color: var(--pizarra); }

/* ───────── llamada a la acción: bloque pizarra, como la llamada final de la web ───────── */
.cta-bloque {
  margin-top: 72px; padding: clamp(32px, 6vw, 72px);
  background: var(--pizarra); color: var(--papel); border-radius: var(--radio);
}
.cta-bloque .antetitulo { margin-bottom: 20px; color: rgb(244 244 241 / 0.7); }
.cta-bloque h2 { margin: 0 0 16px; font-size: clamp(30px, 4.2vw, 56px); line-height: 1.05; letter-spacing: -0.03em; }
.cta-bloque p:not(.antetitulo) { margin: 0 0 32px; max-width: 55ch; color: rgb(244 244 241 / 0.75); text-wrap: pretty; }

/* ───────── artículo: todo al mismo ancho que la portada ───────── */
.articulo { width: min(var(--contenido), 100% - 2 * var(--margen)); margin-inline: auto; }

.migas { margin-bottom: 32px; font-size: 14px; color: var(--pizarra-2); }
.migas ol { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; padding: 0; list-style: none; }
.migas li:not(:last-child)::after { content: '/'; margin-left: 10px; opacity: 0.5; }
.migas a { text-decoration: none; color: var(--pizarra); }
.migas a:hover { text-decoration: underline; text-underline-offset: 3px; }

.articulo__cabecera h1 { margin-bottom: 28px; }
.firma {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-bottom: 40px;
  font-size: 14px; color: var(--pizarra-2);
}
.firma a { text-decoration: none; color: var(--pizarra); }
.firma__autor { display: inline-flex; align-items: center; gap: 10px; font-weight: 400; }

.avatar img { border-radius: 50%; object-fit: cover; aspect-ratio: 1; width: 72px; }
.avatar--mini img { width: 32px; }
.avatar--grande img { width: 120px; }

.respuesta {
  margin: 0 0 40px; padding: 24px 28px;
  background: var(--papel-2); border-left: 2px solid var(--rojo); border-radius: 0 var(--radio) var(--radio) 0;
  font-size: 19px; line-height: 1.5; font-weight: 400; letter-spacing: -0.01em;
}
.respuesta p { margin: 0; }

.portada { margin-bottom: 40px; }
.portada img { width: 100%; border-radius: var(--radio); }

.indice {
  margin-bottom: 48px; padding: 20px 24px; border: 1px solid var(--linea); border-radius: var(--radio);
  font-size: 15px; line-height: 1.5;
}
.indice summary { min-height: 24px; font-weight: 400; cursor: pointer; }
.indice ol { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 8px; color: var(--pizarra-2); }
.indice a { color: var(--pizarra-2); text-underline-offset: 3px; }
.indice a:hover { color: var(--pizarra); }
@media (min-width: 800px) {
  .indice summary { list-style: none; pointer-events: none; }
  .indice summary::-webkit-details-marker { display: none; }
  .indice::details-content { content-visibility: visible; height: auto; }
}

.cuerpo { font-size: 18px; line-height: 1.7; color: var(--pizarra); }
.cuerpo > :first-child { margin-top: 0; }
.cuerpo h2 { margin: 64px 0 20px; font-size: var(--t-h2); letter-spacing: -0.03em; }
.cuerpo h3 { margin: 40px 0 12px; font-size: 23px; }
.cuerpo h4 { margin: 28px 0 8px; font-size: 19px; font-weight: 400; }
.cuerpo p, .cuerpo ul, .cuerpo ol { margin: 0 0 22px; text-wrap: pretty; }
.cuerpo li { margin-bottom: 8px; }
.cuerpo li::marker { color: var(--pizarra-2); }
.cuerpo a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.cuerpo a:hover { text-decoration-color: var(--rojo); }
.cuerpo blockquote {
  margin: 0 0 22px; padding: 4px 0 4px 24px; border-left: 2px solid var(--rojo);
  font-size: 20px; line-height: 1.5; font-weight: 400; letter-spacing: -0.01em;
}
.cuerpo hr { margin: 48px 0; border: 0; border-top: 1px solid var(--linea); }
.cuerpo code {
  padding: 2px 6px; border-radius: 6px; background: var(--papel-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em;
}
.cuerpo pre { margin: 0 0 22px; padding: 20px; overflow-x: auto; background: var(--pizarra); color: var(--papel); border-radius: 16px; line-height: 1.5; }
.cuerpo pre code { padding: 0; background: none; font-size: 14px; }
.cuerpo figure { margin: 40px 0; }
.cuerpo figure img { width: 100%; border-radius: var(--radio); }
.cuerpo figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--pizarra-2); }

.tabla { margin: 0 0 28px; overflow-x: auto; border: 1px solid var(--linea); border-radius: 16px; }
.tabla table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.tabla th, .tabla td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--linea); }
.tabla th { background: var(--papel-2); font-weight: 400; white-space: nowrap; }
.tabla tr:last-child td { border-bottom: 0; }

.faq, .fuentes, .relacionados { margin-top: 64px; }
.faq h2, .fuentes h2, .relacionados h2 { margin: 0 0 20px; font-size: var(--t-h2); letter-spacing: -0.03em; }
.faq details { border-top: 1px solid var(--linea); }
.faq details:last-child { border-bottom: 1px solid var(--linea); }
.faq summary {
  display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 14px 0;
  font-size: 18px; font-weight: 400; cursor: pointer; list-style: none;
}
.faq summary::after {
  content: '+'; margin-left: auto; flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--linea); font-size: 18px;
  transition: transform 0.4s var(--ease), background-color 0.3s;
}
.faq details[open] summary::after { transform: rotate(45deg); background: var(--pizarra); color: var(--papel); border-color: var(--pizarra); }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 0 0 20px; max-width: 70ch; color: var(--pizarra-2); }

.fuentes ol { margin: 0; padding-left: 24px; font-size: 15px; line-height: 1.5; color: var(--pizarra-2); display: grid; gap: 8px; }
.fuentes a { text-underline-offset: 3px; }
.relacionados ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--linea); }
.relacionados li { border-bottom: 1px solid var(--linea); }
.relacionados a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 12px 0;
  font-size: 18px; font-weight: 400; text-decoration: none; transition: padding 0.5s var(--ease);
}
.relacionados a::after { content: '→'; color: var(--pizarra-2); transition: color 0.3s; }
.relacionados a:hover { padding-left: 8px; }
.relacionados a:hover::after { color: var(--rojo); }

.caja-autor {
  display: flex; gap: 20px; align-items: flex-start; margin-top: 64px; padding: 28px;
  background: var(--papel-2); border-radius: var(--radio);
  font-size: 15px; line-height: 1.55; color: var(--pizarra-2);
}
.caja-autor p { margin: 0 0 4px; }
.caja-autor__nombre { font-size: 20px; font-weight: 400; color: var(--pizarra); letter-spacing: -0.01em; }
.caja-autor__nombre a { text-decoration: none; }
.caja-autor .etiqueta { margin-bottom: 10px; }

.autor-cabecera { display: flex; align-items: center; gap: 24px; margin-bottom: 28px; }
.autor-cabecera h1 { margin-bottom: 8px; }
.enlaces-autor { display: flex; flex-wrap: wrap; gap: 20px; margin: 0 0 24px; padding: 0; list-style: none; font-weight: 400; }
.enlaces-autor a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 3px; }

@media (max-width: 767px) {
  .cabecera__logo span { display: none; }
  .caja-autor { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .boton:is(:hover, :focus-visible) .boton__circulo { transform: none; }
}
