/* Blog de 25ocho.agency con el estilo de Estructura (sitio nuevo, 3-oct-2026).
   Va encima de la hoja compartida de Estructura (/assets/style-*.css): de ahí salen las variables
   (--lime, --f-title, --pad...), el encabezado, el pie, .red-hero, .red-crumb, .red-bar, .red-close y .btn-xl.
   Aquí solo vive lo propio del blog: lista de artículos, buscador, lectura del artículo e índice lateral. */

.page-blog { background: var(--black); }

/* ---------- portada (índice y artículo) ---------- */
.blog-hero .red-title { max-width: 14em; }
.blog-hero .red-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.blog-hero .red-counts dd { white-space: nowrap; }

.blog-post-hero { padding-bottom: clamp(36px, 6vh, 64px); }
.blog-title {
  margin-top: 26px;
  max-width: 19em;
  font-family: var(--f-title);
  font-weight: 300;
  font-size: clamp(34px, 4.4vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 28px;
  color: var(--gray-2);
  font-size: 10.5px;
}
.blog-meta span { color: var(--white); }
.blog-meta i { font-style: normal; color: var(--line); }
.blog-lead { max-width: 40em; margin-top: 22px; font-size: 18px; color: rgba(255, 255, 255, 0.72); }

/* entrada suave, sin JS (la portada de Estructura lo hace con GSAP) */
@media (prefers-reduced-motion: no-preference) {
  .blog-in { animation: blog-in 1.1s var(--ease) both; }
  .blog-in-2 { animation-delay: 0.08s; }
  .blog-in-3 { animation-delay: 0.16s; }
  .blog-in-4 { animation-delay: 0.24s; }
}
@keyframes blog-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- buscador en la barra fija ---------- */
.blog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  max-width: 560px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.25s;
}
.blog-search:focus-within { border-color: var(--lime); }
.blog-search svg { width: 14px; height: 14px; flex: none; stroke: var(--gray); fill: none; stroke-width: 1.4; }
.blog-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--white);
  font: 400 14.5px/1 var(--f-body);
}
.blog-search input::placeholder { color: var(--gray-2); }
.blog-search input::-webkit-search-cancel-button { filter: invert(1) grayscale(1); opacity: 0.5; }

/* ---------- lista de artículos ---------- */
.page-blog { --bcols: 52px minmax(0, 1fr) 150px 16px; }
.blog-cols { grid-template-columns: var(--bcols); }
.blog-row {
  display: grid;
  grid-template-columns: var(--bcols);
  gap: 24px;
  align-items: baseline;
  padding: 26px 0 24px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.3s;
}
.b-num { color: var(--gray-2); font-size: 10px; }
.b-title {
  display: block;
  font-family: var(--f-title);
  font-weight: 400;
  font-size: clamp(19px, 1.7vw, 26px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  transition: color 0.3s;
}
.b-ex {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-width: 52em;
  margin-top: 8px;
  color: var(--gray);
  font-size: 14.5px;
  line-height: 1.55;
}
.b-date { color: var(--gray); font-size: 10px; white-space: nowrap; }
.blog-row .i-arrow { align-self: center; width: 12px; height: 12px; color: var(--gray-2); transition: transform 0.4s var(--ease), color 0.3s; }
.blog-row:hover .b-title { color: var(--lime); }
.blog-row:hover .i-arrow { color: var(--lime); transform: translate(2px, -2px); }
.blog-item[hidden] { display: none; }
.blog-empty { padding: 48px 0; color: var(--gray); font-size: 16px; }

/* ---------- artículo ---------- */
.blog-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 40px clamp(40px, 7vw, 120px);
  padding-top: clamp(40px, 7vh, 72px);
  padding-bottom: clamp(64px, 10vh, 120px);
  border-top: 1px solid var(--line-soft);
}

.blog-prose {
  max-width: 42em;
  counter-reset: bh2;
  color: rgba(255, 255, 255, 0.8);
  font-size: 17.5px;
  line-height: 1.75;
}
.blog-prose > * + *,
.blog-prose :is(article, section, div) > * + * { margin-top: 1.1em; }
.blog-prose :is(article, section, div) + * { margin-top: 1.1em; }
.blog-prose h2 {
  counter-increment: bh2;
  margin-top: 2.6em;
  scroll-margin-top: calc(var(--header-h) + 24px);
  color: var(--white);
  font-family: var(--f-title);
  font-weight: 300;
  font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.blog-prose h2::before {
  content: counter(bh2, decimal-leading-zero) ' /';
  display: block;
  margin-bottom: 14px;
  color: var(--gray-2);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
}
.blog-prose > h2:first-child,
.blog-prose > :is(article, section, div):first-child > h2:first-child { margin-top: 0; }
.blog-prose h3 {
  margin-top: 2em;
  color: var(--white);
  font-family: var(--f-title);
  font-weight: 500;
  font-size: clamp(19px, 1.6vw, 23px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.blog-prose h4, .blog-prose h5, .blog-prose h6 { margin-top: 1.8em; color: var(--white); font-size: 17.5px; font-weight: 600; }
.blog-prose h2 + *, .blog-prose h3 + *, .blog-prose h4 + * { margin-top: 0.7em; }
.blog-prose strong, .blog-prose b { color: var(--white); font-weight: 600; }
.blog-prose em, .blog-prose i { color: var(--white); }
.blog-prose a {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--lime);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.25s;
}
.blog-prose a:hover { color: var(--lime); }
.blog-prose ul, .blog-prose ol { display: grid; gap: 0.55em; }
.blog-prose li { position: relative; padding-left: 26px; }
.blog-prose ul > li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border: 1px solid var(--lime);
}
.blog-prose ol { counter-reset: bol; }
.blog-prose ol > li { counter-increment: bol; padding-left: 34px; }
.blog-prose ol > li::before {
  content: counter(bol, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.42em;
  color: var(--lime);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.blog-prose li > ul, .blog-prose li > ol { margin-top: 0.55em; }
.blog-prose blockquote {
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--lime);
  color: var(--white);
  font-family: var(--f-title);
  font-weight: 300;
  font-size: 1.25em;
  line-height: 1.4;
  letter-spacing: -0.015em;
}
.blog-prose code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--f-mono);
  font-size: 0.82em;
}
.blog-prose pre { overflow-x: auto; padding: 18px; border: 1px solid var(--line); background: var(--surface); }
.blog-prose pre code { padding: 0; border: 0; background: none; }
.blog-prose hr { height: 1px; border: 0; background: var(--line); margin-block: 2.4em; }
.blog-prose img { width: 100%; height: auto; border: 1px solid var(--line-soft); }
.blog-prose figcaption { margin-top: 10px; color: var(--gray-2); font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; }
.blog-prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.blog-prose th, .blog-prose td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.blog-prose th { color: var(--gray-2); font-family: var(--f-mono); font-size: 10px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; }

/* índice lateral */
.blog-aside { position: relative; }
.blog-toc { position: sticky; top: calc(var(--header-h) + 28px); }
.blog-toc .label { margin-bottom: 18px; font-size: 10px; }
.blog-toc ol { display: grid; gap: 2px; border-left: 1px solid var(--line); }
.blog-toc a {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--gray);
  font-size: 13.5px;
  line-height: 1.4;
  transition: color 0.25s, border-color 0.25s;
}
.blog-toc a:hover, .blog-toc a.is-current { color: var(--white); border-left-color: var(--lime); }
.blog-toc .btn { margin-top: 28px; }

/* cierre: alternativa por WhatsApp debajo del botón grande */
.blog-close-alt { margin-top: 18px; font-size: 10.5px; }
.blog-close-alt a { display: inline-flex; align-items: center; gap: 8px; color: var(--gray); transition: color 0.3s; }
.blog-close-alt a:hover { color: var(--lime); }
.blog-close-alt .i-arrow { width: 10px; height: 10px; }

/* sigue leyendo */
.blog-more { padding-top: clamp(56px, 9vh, 100px); padding-bottom: clamp(56px, 9vh, 100px); border-top: 1px solid var(--line-soft); }
.blog-more-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.blog-more-head .h2 { font-size: clamp(30px, 3.6vw, 52px); }
.blog-more .blog-row:first-child { border-top: 1px solid var(--line); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .blog-body { grid-template-columns: 1fr; }
  .blog-aside { display: none; }
}
@media (max-width: 820px) {
  .blog-hero .red-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-hero .red-counts > div:last-child { grid-column: 1 / -1; }
  .page-blog { --bcols: minmax(0, 1fr) 14px; }
  .blog-cols { display: none; }
  .blog-row { gap: 6px 14px; padding: 22px 0 20px; }
  .b-num { display: none; }
  .b-main { grid-column: 1; }
  .b-date { grid-row: 2; grid-column: 1; margin-top: 4px; }
  .blog-row .i-arrow { grid-column: 2; grid-row: 1; align-self: start; margin-top: 6px; }
  .blog-search { max-width: none; }
  .blog-index .red-bar-in { flex-wrap: wrap; }
  .blog-prose { font-size: 16.5px; }
  .blog-lead { font-size: 16px; }
  .blog-more-head { flex-direction: column; align-items: start; }
}
