/* ==========================================================================
   LENTE — blog (índice y artículos). Se carga después de lente.css.
   ========================================================================== */

.progress {
  position: fixed; top: 0; left: 0; z-index: 200; width: 100%; height: 2px;
  background: var(--blue-soft); transform-origin: 0 50%; transform: scaleX(0);
}

.topbar .btn { height: 38px; padding: 0 16px; font-size: 0.86rem; }

/* ---------- Artículo ---------- */
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 30px 0 26px; font-size: 0.8rem; font-weight: 300; color: var(--ink-40); }
.crumbs a { transition: color 0.25s var(--ease-out); }
.crumbs a:hover { color: var(--white); }

.post-head { display: flex; flex-direction: column; gap: 18px; margin-bottom: 28px; }
.post-head h1 { font-size: clamp(2.1rem, 5.2vw, 3.2rem); font-weight: 400; line-height: 1.06; letter-spacing: -0.038em; }
.post-lead { font-size: 1.14rem; font-weight: 300; line-height: 1.6; color: var(--ink-72); }
.post-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.84rem; font-weight: 300; color: var(--ink-40); }
.post-meta a { color: var(--ink-72); transition: color 0.25s var(--ease-out); }
.post-meta a:hover { color: var(--white); }

.answer { padding: 22px 24px; margin: 6px 0 12px; }
.answer-label { font-size: 0.78rem; font-weight: 400; color: var(--blue-soft); margin-bottom: 8px; }
.answer p { font-size: 1.05rem; line-height: 1.65; font-weight: 350; color: var(--white); }

.toc { padding: 20px 24px; margin-bottom: 44px; }
.toc-label { font-size: 0.78rem; font-weight: 300; color: var(--ink-40); margin-bottom: 12px; }
.toc ol { list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 9px; }
.toc li { counter-increment: toc; display: flex; gap: 12px; font-size: 0.93rem; font-weight: 300; line-height: 1.4; }
.toc li::before { content: counter(toc, decimal-leading-zero); color: var(--blue-soft); font-size: 0.76rem; padding-top: 2px; min-width: 18px; }
.toc a { color: var(--ink-72); transition: color 0.25s var(--ease-out); }
.toc a:hover { color: var(--white); }

.prose { font-size: 1.07rem; line-height: 1.76; font-weight: 350; color: var(--ink-85); letter-spacing: -0.006em; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { font-size: clamp(1.5rem, 3.2vw, 1.85rem); font-weight: 400; line-height: 1.18; letter-spacing: -0.032em; color: var(--white); margin-top: 2.3em; }
.prose h3 { font-size: 1.2rem; font-weight: 400; line-height: 1.3; letter-spacing: -0.02em; color: var(--white); margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose strong { font-weight: 400; color: var(--white); }
.prose a { color: var(--blue-soft); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 0.2s var(--ease-out); }
.prose a:hover { color: var(--white); }
.prose ul, .prose ol { list-style: none; display: flex; flex-direction: column; gap: 0.55em; }
.prose ul li { position: relative; padding-left: 22px; }
.prose ul li::before { content: ''; position: absolute; left: 2px; top: 0.82em; width: 8px; height: 1.5px; background: var(--blue-soft); }
.prose ol { counter-reset: ol; }
.prose ol li { counter-increment: ol; position: relative; padding-left: 32px; }
.prose ol li::before {
  content: counter(ol); position: absolute; left: 0; top: 0.22em; width: 21px; height: 21px; border-radius: 50%;
  background: rgba(150,183,225,0.16); color: var(--blue-soft); font-size: 0.72rem; font-weight: 400;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.84em; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,0.08); color: var(--white); letter-spacing: 0; }
.callout { padding: 18px 22px; border-radius: 16px; background: var(--surface-blue); color: var(--white); font-size: 1rem; line-height: 1.65; }
.table-wrap { overflow-x: auto; border-radius: 16px; background: var(--surface); -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 0.92rem; line-height: 1.45; letter-spacing: -0.005em; }
.prose th { text-align: left; font-weight: 400; font-size: 0.8rem; color: var(--blue-soft); padding: 14px 16px; background: rgba(255,255,255,0.04); }
.prose td { padding: 13px 16px; vertical-align: top; color: var(--ink-85); }
.prose tbody tr:nth-child(even) td { background: rgba(255,255,255,0.025); }
.prose td:first-child { color: var(--white); font-weight: 400; }

.faq { margin-top: 60px; }
.faq h2 { font-size: clamp(1.5rem, 3.2vw, 1.85rem); font-weight: 400; letter-spacing: -0.032em; margin-bottom: 16px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq details { border-radius: 16px; background: var(--surface); transition: background 0.3s var(--ease-out); }
.faq details[open] { background: var(--surface-2); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; font-size: 1rem; font-weight: 400; line-height: 1.4; letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex-shrink: 0; color: var(--blue-soft); font-size: 1.35rem; font-weight: 300; line-height: 1; transition: transform 0.35s var(--ease-in-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 20px 20px; font-size: 0.97rem; font-weight: 300; line-height: 1.68; color: var(--ink-72); }

.author { display: flex; gap: 16px; align-items: flex-start; padding: 22px 24px; margin-top: 52px; }
.author-mark { width: 42px; height: 42px; border-radius: 50%; background: var(--white); color: var(--navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.author-mark svg { width: 17px; height: auto; }
.author-name { font-size: 1rem; font-weight: 400; }
.author-name a { transition: color 0.25s var(--ease-out); }
.author-name a:hover { color: var(--blue-soft); }
.author-bio { font-size: 0.9rem; font-weight: 300; line-height: 1.55; color: var(--ink-60); margin-top: 4px; }

.cta-box { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 28px; margin-top: 12px; }
.cta-box-title { font-size: 1.3rem; font-weight: 400; letter-spacing: -0.03em; }
.cta-box-text { font-size: 0.9rem; font-weight: 300; color: var(--ink-60); margin-top: 5px; line-height: 1.5; max-width: 430px; }
.cta-box-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.related { margin-top: 60px; }
.related h2 { font-size: 1.35rem; font-weight: 400; margin-bottom: 14px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rel { display: flex; flex-direction: column; gap: 10px; min-height: 150px; padding: 20px; border-radius: 18px; background: var(--surface); transition: background 0.3s var(--ease-out); }
.rel:hover { background: var(--surface-2); }
.rel-cat { font-size: 0.74rem; font-weight: 300; color: var(--blue-soft); }
.rel-title { font-size: 1rem; font-weight: 400; line-height: 1.3; letter-spacing: -0.02em; }
.rel-date { margin-top: auto; font-size: 0.76rem; font-weight: 300; color: var(--ink-40); }

/* ---------- Índice del blog ---------- */
.blog-head { display: flex; flex-direction: column; gap: 18px; padding: 52px 0 34px; }
.blog-head h1 { font-size: clamp(2.4rem, 6.4vw, 4.4rem); font-weight: 400; line-height: 1.02; letter-spacing: -0.042em; max-width: 820px; }
.blog-head p { font-size: 1.07rem; font-weight: 300; line-height: 1.6; color: var(--ink-60); max-width: 580px; }
.cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.cat {
  height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--ink-60);
  font-size: 0.82rem; font-weight: 300; transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.cat:hover { color: var(--white); }
.cat--active, .cat--active:hover { background: var(--white); color: var(--navy); font-weight: 400; }
.posts { display: flex; flex-direction: column; gap: 8px; }
.post-item[hidden] { display: none; }
.post-item a {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 160px 1fr auto; gap: 24px; align-items: start;
  padding: 26px 26px 28px; border-radius: 20px; background: var(--surface); transition: background 0.3s var(--ease-out);
}
.post-item a::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--blue-soft); transform: scaleY(0); transform-origin: bottom; transition: transform 0.45s var(--ease-in-out); }
.post-item a:hover { background: var(--surface-2); }
.post-item a:hover::before { transform: scaleY(1); }
.pi-date { font-size: 0.82rem; font-weight: 300; color: var(--ink-40); padding-top: 3px; }
.pi-cat { display: block; font-size: 0.76rem; font-weight: 300; color: var(--blue-soft); margin-bottom: 8px; }
.pi-title { font-size: 1.32rem; font-weight: 400; line-height: 1.22; letter-spacing: -0.03em; }
.pi-desc { font-size: 0.93rem; font-weight: 300; line-height: 1.55; color: var(--ink-60); margin-top: 8px; max-width: 640px; }
.pi-arrow { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.07); display: flex; align-items: center; justify-content: center; transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out); }
.post-item a:hover .pi-arrow { background: var(--white); color: var(--navy); }

/* ---------- Pie del blog ---------- */
.blog-foot { padding-top: 70px; padding-bottom: 40px; }
.blog-foot-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 26px; }
.blog-foot-brand { display: flex; flex-direction: column; gap: 12px; max-width: 320px; }
.blog-foot-brand p { font-size: 0.86rem; font-weight: 300; line-height: 1.5; color: var(--ink-40); }
.blog-foot-links { display: flex; gap: 22px; flex-wrap: wrap; font-size: 0.9rem; font-weight: 300; color: var(--ink-60); }
.blog-foot-links a:hover, .blog-foot-bottom a:hover { color: var(--white); }
.blog-foot-bottom { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 0.78rem; font-weight: 300; color: var(--ink-40); }
.blog-foot-bottom div { display: flex; gap: 16px; flex-wrap: wrap; }
.blog-foot a { transition: color 0.25s var(--ease-out); }

@media (max-width: 760px) {
  .topbar .hide-sm { display: none; }
  .post-lead { font-size: 1.05rem; }
  .prose { font-size: 1.02rem; line-height: 1.72; }
  .answer, .toc { padding: 18px; }
  .related-grid { grid-template-columns: 1fr; }
  .rel { min-height: 0; }
  .cta-box { padding: 22px 20px; }
  .cta-box-actions, .cta-box-actions .btn { width: 100%; }
  .post-item a { grid-template-columns: 1fr; gap: 6px; padding: 22px 20px 24px; }
  .pi-arrow { display: none; }
  .pi-title { font-size: 1.18rem; }
  .blog-head { padding: 30px 0 24px; }
}
