/* Blog (tools/landing/blog.mjs) y página 404. Va después de site.css y legal.css:
   el artículo reutiliza la rejilla de los documentos legales (.legal, .legal-toc,
   .legal-body) y aquí sólo se añade lo propio: tarjetas, migas, portada, cita,
   código, llamada a jugar, etiquetas y compartir. Mismos tokens dorados de site.css. */

.crumbs { padding-top: 20px; font-size: 14px; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "/"; margin: 0 10px; color: var(--line-strong); }
.crumbs a { color: var(--soft); text-decoration: none; }
.crumbs a:hover { color: var(--gold-hover); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }

.blog-head { padding-top: 32px; }
.blog-wrap { padding-bottom: 104px; }
.blog-note { margin: 0 0 24px; padding: 14px 18px; border: 1px solid var(--line); background: var(--surface); color: var(--soft); }
.blog-feed { margin: 32px 0 0; font-size: 15px; }
.blog-feed a { color: var(--gold-text); text-underline-offset: 3px; }

/* Tarjetas */
.post-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.post-card { display: flex; }
.post-card-link {
  display: flex; flex-direction: column; width: 100%; color: inherit; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface); transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.post-card-link:hover { border-color: var(--gold-deep); transform: translateY(-2px); }
.post-card-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.post-card-art { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.post-card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 22px; flex: 1; }
.post-card-title { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 26px; line-height: 1.15; color: var(--text-strong); }
.post-card-desc { margin: 0; color: var(--soft); font-size: 15.5px; line-height: 1.55; flex: 1; }
.post-card-more { color: var(--gold-text); font-weight: 600; font-size: 15px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; font-family: var(--f-mono); font-size: 12.5px; letter-spacing: .04em; color: var(--muted); }
/* Guía sin fecha (undated: true): etiqueta dorada en lugar de la fecha */
.post-kind { color: var(--gold-text); text-transform: uppercase; letter-spacing: .12em; }

/* Índice con guías y artículos fechados: dos bloques con su título */
.blog-section + .blog-section { margin-top: 56px; }
.blog-section-title { display: flex; align-items: center; gap: 16px; margin: 0 0 20px; font-family: var(--f-display); font-weight: 400; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.1; color: var(--text-strong); }
.blog-section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.blog-pager { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 36px 0 0; color: var(--muted); }
.blog-pager a { color: var(--gold-text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.blog-pager a:hover { color: var(--gold-hover); text-decoration: underline; }

.blog-tags { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.blog-tags h2, .related-title { margin: 0 0 16px; font-family: var(--f-display); font-weight: 400; font-size: clamp(26px, 2.6vw, 32px); color: var(--text-strong); }
.blog-tags p, .post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; align-items: center; }
.blog-tags .tag, .post-tags .tag { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; text-decoration: none; }
.blog-tags .tag span { color: var(--muted); }
.blog-tags .tag:hover, .post-tags .tag:hover { border-color: var(--gold); color: var(--gold-hover); }

/* Artículo */
.post-head { padding-top: 28px; padding-bottom: 8px; }
.post-head h1 { font-size: clamp(36px, 4.4vw, 58px); line-height: 1.05; text-wrap: balance; }
.post-head .eyebrow a { color: inherit; }
.post-head .post-lead { max-width: 66ch; font-size: 18px; }
.post-head .post-meta { margin-top: 18px; }
.post-langs { font-size: 15px; }
.post-langs a { color: var(--gold-text); text-underline-offset: 3px; }
.post-cover { max-width: var(--wrap); margin: 16px auto 0; padding: 0 var(--gutter); }
.post-cover-art { display: block; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.post-cover-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-toc-k { margin: 0 0 6px 14px; font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.post-body { font-size: 17px; }
.post-body h4 { margin: 20px 0 8px; font-size: 16px; font-weight: 600; color: var(--text-strong); }
.post-body em { color: var(--text); }
.post-body hr { margin: 32px 0; border: 0; border-top: 1px solid var(--line); }
.post-body blockquote { margin: 20px 0; padding: 14px 20px; border-left: 3px solid var(--gold-deep); background: var(--surface); color: var(--text); }
.post-body blockquote > :last-child { margin-bottom: 0; }
.post-body pre { margin: 0 0 16px; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--line); background: var(--bg-2); font-size: 14px; line-height: 1.5; }
.post-body ul ul { margin: 6px 0 0; }
.post-figure { margin: 24px 0; }
.post-figure picture, .post-figure img { display: block; width: 100%; height: auto; }
.post-figure img { border: 1px solid var(--line); }
.post-figure figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }

.post-cta { margin: 40px 0 28px; padding: 24px; border: 1px solid var(--gold-deep); background: linear-gradient(135deg, rgba(217, 164, 65, .12), rgba(23, 18, 14, .6)); }
.post-cta-title { margin: 0 0 6px !important; font-family: var(--f-display); font-size: 28px; line-height: 1.1; color: var(--text-strong); }
.post-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.post-cta-actions .btn { text-decoration: none; }
.post-tags { margin: 0 0 20px; }
.post-tags-k { font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.post-share { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; }
.post-share-k { margin: 0 !important; font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.legal-body .post-share a { min-height: 40px; display: inline-flex; align-items: center; }

.related { padding-bottom: 96px; }

/* 404 */
.nf { padding-bottom: 104px; }
.nf h1 { font-size: clamp(40px, 5vw, 64px); }
.nf-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 28px; }
.nf-links a { color: var(--gold-text); min-height: 40px; display: inline-flex; align-items: center; text-underline-offset: 3px; }

@media (max-width: 720px) {
  .post-body { font-size: 16px; }
  .post-card-title { font-size: 23px; }
  .post-cta { padding: 18px; }
  .post-cta-actions .btn { flex: 1 1 100%; justify-content: center; }
  .crumbs [aria-current] { max-width: 70vw; }
}

[dir="rtl"] .crumbs li + li::before { content: "\\"; }
[dir="rtl"] .post-body blockquote { border-left: 0; border-right: 3px solid var(--gold-deep); }
[dir="rtl"] .post-toc-k { margin: 0 14px 6px 0; }

@media (prefers-reduced-motion: reduce) {
  .post-card-link { transition: none; }
  .post-card-link:hover { transform: none; }
}
