/* ════════════════════════════════════════════════
   blog.css — Blog listing & article styles
   Extends cap-* and l-* classes; introduces blog-* layout
   ════════════════════════════════════════════════ */

/* ── Blog Index Hero ──────────────────────────── */
.blog-hero {
  position: relative;
  padding: 72px 0 48px;
  background: var(--bg);
  overflow: hidden;
  text-align: center;
}
.blog-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
}
.blog-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.blog-hero-glow {
  position: absolute; border-radius: 50%;
  filter: blur(100px);
  width: 520px; height: 520px;
  background: var(--accent);
  top: -240px; left: 50%;
  transform: translateX(-50%);
  opacity: .12;
}
.blog-hero-inner {
  position: relative; z-index: 1;
  max-width: 720px; margin: 0 auto;
  padding: 0 24px;
}
.blog-hero-eyebrow {
  display: inline-block;
  padding: 4px 14px;
  background: var(--accent-light);
  color: var(--accent-hover);
  border-radius: 100px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 16px;
}
.blog-hero h1 {
  font-size: 44px; font-weight: 800;
  letter-spacing: -1.5px; line-height: 1.15;
  margin-bottom: 16px; color: var(--text);
}
.blog-hero p {
  font-size: 17px; line-height: 1.7;
  color: var(--text2);
  max-width: 640px; margin: 0 auto 24px;
}
.blog-hero-metrics {
  display: flex; justify-content: center; gap: 32px;
  margin-top: 24px; flex-wrap: wrap;
}
.blog-hero-metric {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 13px; color: var(--text2);
}
.blog-hero-metric strong {
  font-size: 22px; font-weight: 800;
  color: var(--text); letter-spacing: -.5px;
}

/* ── Post Card Grid ────────────────────────────── */
.blog-listing { padding: 64px 0; }
.blog-listing-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 32px; gap: 16px; flex-wrap: wrap;
}
.blog-listing-header h2 {
  font-size: 28px; font-weight: 800;
  letter-spacing: -.5px; color: var(--text);
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.blog-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  position: relative;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.blog-card-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
}
.blog-tag-chip {
  display: inline-block;
  padding: 2px 10px;
  background: var(--accent-light);
  color: var(--accent-hover);
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
}
.blog-card h3 {
  font-size: 19px; font-weight: 700;
  line-height: 1.35;
  margin: 0 0 10px;
  color: var(--text);
  letter-spacing: -.3px;
}
.blog-card-excerpt {
  font-size: 13px; line-height: 1.6;
  color: var(--text2);
  flex: 1;
  margin: 0 0 16px;
}
.blog-card-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text3);
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.blog-card-meta .dot { color: var(--border2); }
/* CMS article-cards render as <article> (not <a>); reading time follows the
   author with a middot, matching the static meta separator rhythm. */
.blog-card-reading::before { content: '·'; margin-right: 8px; color: var(--border2); }
.blog-card-link {
  font-size: 13px; font-weight: 600;
  color: var(--accent); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.blog-card-link:hover { color: var(--accent-hover); }

/* ── Article Hero (post page) ──────────────────── */
.article-hero {
  background: var(--bg);
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--border);
}
.article-hero-inner {
  max-width: 720px; margin: 0 auto;
  padding: 0 24px;
}
.article-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text2);
  margin-bottom: 16px;
}
.article-breadcrumb a {
  color: var(--text2); text-decoration: none;
  transition: var(--transition);
}
.article-breadcrumb a:hover { color: var(--accent); }
.article-breadcrumb .sep { color: var(--border2); }
.article-hero h1 {
  font-size: 36px; font-weight: 800;
  letter-spacing: -1.2px; line-height: 1.2;
  margin: 0 0 16px; color: var(--text);
}
.article-lead {
  font-size: 17px; line-height: 1.7;
  color: var(--text2);
  margin: 0 0 24px;
}
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 16px;
  font-size: 13px; color: var(--text2);
}
.article-meta-item {
  display: inline-flex; align-items: center; gap: 6px;
}
.article-meta-item strong { color: var(--text); font-weight: 600; }
.article-meta-divider { color: var(--border2); }
.article-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 14px;
}

/* ── Article Body ──────────────────────────────── */
.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}
.article-body h2 {
  font-size: 26px; font-weight: 800;
  letter-spacing: -.5px; line-height: 1.3;
  margin: 48px 0 16px;
  padding-top: 16px;
  color: var(--text);
  scroll-margin-top: 80px;
}
.article-body h2:first-child { margin-top: 0; padding-top: 0; }
.article-body h3 {
  font-size: 19px; font-weight: 700;
  line-height: 1.4;
  margin: 32px 0 12px;
  color: var(--text);
}
.article-body p {
  margin: 0 0 18px;
  color: var(--text);
}
.article-body ul, .article-body ol {
  margin: 0 0 20px;
  padding-left: 24px;
}
.article-body li {
  margin-bottom: 8px;
  line-height: 1.7;
}
.article-body li::marker { color: var(--accent); }
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.article-body a:hover { color: var(--accent-hover); }
.article-body strong { color: var(--text); font-weight: 700; }

/* Inline data table — extends cap-table */
.article-body .cap-table {
  margin: 24px 0;
  font-size: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.article-body .cap-table th,
.article-body .cap-table td {
  padding: 12px 14px;
}

/* Code block — uses cap-mono */
.article-body .cap-mono {
  display: block;
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0;
  overflow-x: auto;
}

/* Pull quote */
.article-body blockquote {
  margin: 32px 0;
  padding: 16px 24px;
  border-left: 4px solid var(--accent);
  background: var(--accent-light);
  border-radius: 0 8px 8px 0;
  font-size: 17px;
  font-style: italic;
  line-height: 1.6;
  color: var(--text);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body blockquote cite {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-style: normal;
  color: var(--text2);
  font-weight: 600;
}

/* Inline callout */
.article-callout {
  margin: 24px 0;
  padding: 16px 20px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
}
.article-callout-title {
  font-size: 14px; font-weight: 700;
  color: var(--accent-hover);
  margin: 0 0 6px;
  text-transform: uppercase; letter-spacing: .3px;
}
.article-callout p { margin-bottom: 0; font-size: 15px; }

/* ── Related Posts ─────────────────────────────── */
.article-related {
  background: var(--bg);
  padding: 56px 0;
  border-top: 1px solid var(--border);
}
.article-related-inner { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.article-related h2 {
  font-size: 24px; font-weight: 800;
  letter-spacing: -.5px;
  margin: 0 0 24px;
  color: var(--text);
}
.article-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .article-related-grid { grid-template-columns: repeat(2, 1fr); }
  .article-hero h1 { font-size: 30px; }
  .article-body h2 { font-size: 22px; }
  .blog-hero h1 { font-size: 34px; }
}
@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; }
  .article-related-grid { grid-template-columns: 1fr; }
  .article-hero { padding: 40px 0 24px; }
  .article-hero h1 { font-size: 26px; }
  .article-body { padding: 32px 20px 48px; font-size: 15px; }
  .article-body h2 { font-size: 20px; }
  .article-body h3 { font-size: 17px; }
  .blog-hero { padding: 48px 0 32px; }
  .blog-hero h1 { font-size: 28px; }
  .blog-hero p { font-size: 15px; }
  .article-meta { font-size: 12px; gap: 10px; }
  .article-related h2 { font-size: 20px; }
}

/* ── Dark mode ─────────────────────────────────── */
[data-theme="dark"] .blog-card,
[data-theme="dark"] .article-related {
  background: var(--card);
}
[data-theme="dark"] .article-body blockquote {
  background: rgba(234,179,8,.08);
}
[data-theme="dark"] .article-callout {
  background: rgba(255,255,255,.04);
}
[data-theme="dark"] .article-body .cap-mono {
  background: rgba(255,255,255,.04);
  color: var(--text);
}
[data-theme="dark"] .article-body .cap-table {
  background: var(--card);
}
