/* ═══════════════════════════════════════════════════════════════
   CRHQ Blog — Article & index layout
   Reuses .docs-article, .docs-callout, .docs-table, .docs-toc
   from docs.css for content rendering consistency.
   ═══════════════════════════════════════════════════════════════ */

/* ── Post Layout ───────────────────────────────────────────── */

.blog-post-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  gap: 0;
  min-height: calc(100vh - 180px);
}

.blog-post-wrap {
  flex: 1;
  min-width: 0;
  max-width: 800px;
  padding: 80px 0 80px;
}

/* ── Post Header ───────────────────────────────────────────── */

.blog-post-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.blog-post-meta time {
  color: var(--text-secondary);
}

.blog-post-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
  margin-right: auto;
}

.blog-post-back:hover {
  color: var(--accent);
}

.blog-post-back svg {
  width: 14px;
  height: 14px;
}

.blog-post-title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.blog-post-description {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 16px;
}

.blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

/* ── Post Body ─────────────────────────────────────────────── */

.blog-post-body {
  /* Base typography inherits from .docs-article in docs.css.
     Blog-specific overrides below for richer spacing and images. */
}

/* Blog images — larger, more prominent than docs images */
.blog-post-body img {
  max-width: 100%;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border-subtle);
  margin: 24px 0 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(124, 58, 237, 0.06);
}

/* Pull images wider than content column on large screens */
@media (min-width: 900px) {
  .blog-post-body img {
    margin-left: -32px;
    margin-right: -32px;
    max-width: calc(100% + 64px);
    width: calc(100% + 64px);
  }
}

/* ── Blog table overrides (mobile scroll + custom scrollbar) ── */

.blog-post-body .docs-table-wrap {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-visible) transparent;
}

.blog-post-body .docs-table-wrap::-webkit-scrollbar {
  height: 6px;
}

.blog-post-body .docs-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.blog-post-body .docs-table-wrap::-webkit-scrollbar-thumb {
  background: var(--border-visible);
  border-radius: 3px;
}

.blog-post-body .docs-table {
  min-width: 480px;
}

/* ── Blog spacing refinements ──────────────────────────────── */

/* More breathing room between h2 sections */
.blog-post-body h2 {
  margin-top: 56px;
}

/* Ensure h3 has visible gap from previous content */
.blog-post-body h3 {
  margin-top: 40px;
}

/* ── TOC (right sidebar on post page) ──────────────────────── */

.blog-toc {
  /* Extends .docs-toc from docs.css */
  padding-top: 80px;
  margin-left: 48px;
}

/* ── Pagination ────────────────────────────────────────────── */

.blog-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}

.blog-pagination-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s;
}

.blog-pagination-link:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.blog-pagination-link.next {
  text-align: right;
  grid-column: 2;
}

.blog-pagination-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.blog-pagination-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
}

/* ── Blog Index Page ───────────────────────────────────────── */

.blog-index-layout {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 32px 80px;
  min-height: calc(100vh - 500px);
}

.blog-post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.blog-post-card {
  display: block;
  text-decoration: none;
  padding: 28px 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.2s;
}

.blog-post-card:first-child {
  border-top: 1px solid var(--border-subtle);
}

.blog-post-card:hover .blog-post-card-title {
  color: var(--accent);
}

.blog-post-card-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.blog-post-card-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  transition: color 0.2s;
  line-height: 1.3;
}

.blog-post-card-description {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

.blog-post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .blog-toc {
    display: none;
  }
}

@media (max-width: 768px) {
  .blog-post-layout {
    padding: 0 20px;
  }

  .blog-post-wrap {
    padding: 48px 0 60px;
  }

  .blog-index-layout {
    padding: 0 20px 60px;
  }

  .blog-pagination {
    grid-template-columns: 1fr;
  }

  .blog-pagination-link.next {
    grid-column: 1;
    text-align: left;
  }
}
