/* blog.css — styles for /blog and /blog/:slug pages */

/* ---- Shared overrides for blog pages ---- */
.blog-post-page body,
.blog-index-page body {
  background: #fff;
}

/* Nav: two-item layout (logo + links group) */
.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
}

.nav-link:hover {
  color: #1d4ed8;
}

.nav-link-active {
  color: #1d4ed8;
  font-weight: 700;
}

/* ---- Blog Hero CTA (above-fold strip on post pages) ---- */
.blog-hero-cta {
  background: #1e3a5f;
  padding: 14px 0;
}

.blog-hero-cta-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.blog-hero-cta-text {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}

/* ---- Article layout ---- */
.blog-main {
  padding: 48px 0 80px;
}

.blog-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.article-header {
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.article-meta {
  font-size: 13px;
  color: #6b7280;
}

.article-divider {
  margin: 0 8px;
}

/* ---- Article content typography ---- */
.article-content {
  font-size: 17px;
  line-height: 1.8;
  color: #111827;
}

.article-content h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 28px;
  color: #0f172a;
}

.article-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 48px 0 16px;
  color: #0f172a;
  padding-top: 8px;
  border-top: 2px solid #e5e7eb;
}

.article-content h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 28px 0 10px;
  color: #1f2937;
}

.article-content p {
  margin: 0 0 20px;
}

.article-content ul,
.article-content ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 40px 0;
}

.article-content strong {
  font-weight: 700;
  color: #111827;
}

.article-content a {
  color: #1d4ed8;
  text-decoration: underline;
}

.article-content a:hover {
  color: #1e40af;
}

/* Table of Contents list (appears early in article) */
.article-content ul:first-of-type {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px 20px 20px 36px;
  font-size: 15px;
}

/* Table styles */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 0 0 24px;
}

.article-content th {
  background: #f1f5f9;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #e2e8f0;
}

.article-content td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.article-content tr:last-child td {
  border-bottom: none;
}

/* ---- Mid-article CTA ---- */
.mid-article-cta {
  display: none; /* shown via JS after render */
  background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%);
  border-radius: 12px;
  padding: 32px;
  margin: 40px 0;
  color: #fff;
}

.mid-cta-inner {
  text-align: center;
}

.mid-cta-inner h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 10px;
  color: #fff;
}

.mid-cta-inner p {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  margin: 0 0 20px;
}

.mid-cta-alt {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.mid-cta-alt a {
  color: rgba(255,255,255,0.9);
}

/* ---- Article footer ---- */
.article-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.back-to-blog {
  font-size: 14px;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
}

.back-to-blog:hover {
  text-decoration: underline;
}

/* ---- Sticky bottom CTA bar ---- */
.sticky-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0f172a;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 14px 20px;
  z-index: 1000;
}

.sticky-cta-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.sticky-cta-text {
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

.sticky-cta-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.sticky-cta-close:hover {
  color: #fff;
}

/* ---- Blog index ---- */
.blog-index-header {
  background: #f8fafc;
  padding: 56px 0 40px;
  border-bottom: 1px solid #e5e7eb;
}

.blog-index-title {
  font-size: 36px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 12px;
}

.blog-index-subtitle {
  font-size: 17px;
  color: #4b5563;
  margin: 0;
  max-width: 560px;
}

.blog-index-posts {
  padding: 48px 0 64px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.post-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.post-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.post-card-link {
  display: block;
  padding: 28px;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.post-card-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.post-date,
.post-read-time {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.post-title {
  font-size: 19px;
  font-weight: 700;
  color: #111827;
  line-height: 1.4;
  margin: 0 0 10px;
}

.post-excerpt {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.65;
  margin: 0 0 16px;
}

.post-read-more {
  font-size: 14px;
  font-weight: 600;
  color: #1d4ed8;
}

.blog-empty {
  color: #6b7280;
  font-size: 15px;
}

/* Blog index footer CTA */
.blog-footer-cta {
  background: #1e3a5f;
  padding: 56px 0;
  text-align: center;
}

.blog-footer-cta-inner h2 {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 10px;
}

.blog-footer-cta-inner p {
  color: rgba(255,255,255,0.8);
  font-size: 16px;
  margin: 0 0 24px;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .article-content h1 {
    font-size: 24px;
  }
  .article-content h2 {
    font-size: 19px;
  }
  .blog-hero-cta-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .sticky-cta-text {
    display: none;
  }
  .sticky-cta-inner {
    justify-content: center;
  }
  .blog-index-title {
    font-size: 26px;
  }
  .post-grid {
    grid-template-columns: 1fr;
  }
}
