/**
 * Blog – professional editorial styling
 * Uses brand tokens from brand.css
 */

/* Container */
.blog-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

/* List: Hero — left-aligned, matches landing/research/pricing */
.blog-hero {
  text-align: left;
  margin-bottom: 2.75rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #eaeaea;
}

.blog-hero .blog-hero-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1e3a8a;
  margin-bottom: 0.5rem;
}

.blog-hero h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 700;
  color: #0B1F33;
  margin: 0 0 0.85rem;
  letter-spacing: -0.032em;
  line-height: 1.08;
}

.blog-hero p {
  font-size: 1.0625rem;
  color: rgba(30, 41, 59, 0.88);
  max-width: 38rem;
  margin: 0;
  line-height: 1.55;
}

/* List: Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.blog-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.blog-card:hover {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
}

.blog-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f8fafc;
}

.blog-card-image-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.blog-card-image-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.6;
}

.blog-card-content {
  padding: 1.5rem 1.25rem;
}

.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted, #475569);
}

.blog-card-meta .blog-card-date {
  font-weight: 500;
  color: var(--ink, #0f172a);
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink, #0f172a);
  margin: 0 0 0.5rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.blog-card-excerpt {
  font-size: 0.9375rem;
  color: var(--muted, #475569);
  line-height: 1.55;
  margin: 0 0 1rem;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog-tag {
  padding: 0.25rem 0.75rem;
  background: var(--primary-50, #EFF6FF);
  color: var(--primary, #1E40AF);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Empty state */
.blog-empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
}

.blog-empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1.25rem;
  color: var(--line, #e5e7eb);
}

.blog-empty-state h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--muted, #475569);
  margin: 0 0 0.5rem;
}

.blog-empty-state p {
  font-size: 0.9375rem;
  color: #94a3b8;
}

/* ========== Single post ========== */
.post-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.post-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--primary, #1E40AF);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: gap 0.2s ease;
}

.post-back-link:hover {
  color: var(--primary-hover, #1E3A8A);
  gap: 0.625rem;
}

.post-header {
  margin-bottom: 2.5rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted, #475569);
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.post-meta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--muted, #475569);
}

.post-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--ink, #0f172a);
  line-height: 1.2;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.post-excerpt {
  font-size: 1.125rem;
  color: var(--muted, #475569);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.post-featured-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid #E5E7EB;
}

/* Article body */
.post-content {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink, #0f172a);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--ink, #0f172a);
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.post-content h1 { font-size: 1.75rem; }
.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.125rem; }

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content blockquote {
  border-left: 4px solid var(--primary, #1E40AF);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--muted, #475569);
  background: var(--primary-50, #EFF6FF);
  padding: 1rem 1.25rem 1rem 1.5rem;
  border-radius: 0 8px 8px 0;
}

.post-content pre {
  background: var(--secondary, #0B1F3B);
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.post-content code {
  background: #f1f5f9;
  color: var(--ink, #0f172a);
  padding: 0.2em 0.45em;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  border: 1px solid var(--line, #e5e7eb);
}

.post-content a {
  color: var(--primary, #1E40AF);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.post-content a:hover {
  border-bottom-color: var(--primary, #1E40AF);
}

/* Post tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2.5rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line, #e5e7eb);
}

.post-tags .tag {
  padding: 0.375rem 0.875rem;
  background: var(--primary-50, #EFF6FF);
  color: var(--primary, #1E40AF);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}

.post-tags .tag:hover {
  background: #dbeafe;
}

/* Author footer */
.post-footer {
  margin-top: 2.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line, #e5e7eb);
}

.post-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary, #1E40AF) 0%, var(--secondary, #0B1F3B) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  flex-shrink: 0;
}

.author-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink, #0f172a);
  margin: 0 0 0.25rem;
}

.author-info p {
  font-size: 0.875rem;
  color: var(--muted, #475569);
  margin: 0;
  line-height: 1.4;
}

/* Sidebar: More posts */
.post-sidebar {
  margin-top: 3rem;
  padding: 1.5rem;
  background: #f8fafb;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
}

.post-sidebar h3 {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #475569);
  margin: 0 0 1rem;
}

.post-sidebar .recent-posts {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.post-sidebar .recent-post {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line, #e5e7eb);
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

.post-sidebar .recent-post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.post-sidebar .recent-post:hover {
  color: var(--primary, #1E40AF);
}

.post-sidebar .recent-post-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink, #0f172a);
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.post-sidebar .recent-post:hover .recent-post-title {
  color: var(--primary, #1E40AF);
}

.post-sidebar .recent-post-date {
  font-size: 0.8125rem;
  color: var(--muted, #475569);
}

/* Responsive */
@media (max-width: 768px) {
  .blog-container,
  .post-container {
    padding: 2rem 1rem 3rem;
  }

  .blog-hero {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .blog-card-content {
    padding: 1.25rem 1rem;
  }

  .post-featured-image {
    max-height: 280px;
  }
}
