/* ─── Blog Layout ───────────────────────────────────────────────────────── */
.blog-hero {
  padding: var(--space-16) 0 var(--space-12);
  text-align: center;
  /* Removed radial gradient to match the clean white look */
}

.blog-title {
  font-size: var(--text-5xl);
  /* Bigger, bolder */
  font-weight: 800;
  /* Extra bold */
  margin-bottom: var(--space-4);
  color: #0f172a;
  /* Dark navy/black */
  letter-spacing: -0.02em;
}

.blog-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-12);
  line-height: 1.6;
}

/* ─── Search & Filter Bar ───────────────────────────────────────────────── */
.blog-controls {
  max-width: 800px;
  margin: 0 auto var(--space-16);
  display: flex;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.blog-controls:focus-within {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.blog-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  border-right: 1px solid var(--color-border);
}

.blog-search-icon {
  color: var(--color-text-tertiary);
  font-size: 1.25rem;
  margin-right: var(--space-3);
}

.blog-search-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: var(--space-4) 0;
  font-size: var(--text-base);
  color: var(--color-text-primary);
  outline: none;
}

.blog-filter-wrap {
  position: relative;
  min-width: 200px;
  background-color: var(--color-surface);
  /* Slight contrast or white */
}

.blog-filter-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  padding: var(--space-4);
  padding-right: var(--space-10);
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  cursor: pointer;
  outline: none;
  height: 100%;
}

.blog-filter-arrow {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-text-tertiary);
  font-size: 0.8em;
}

/* ─── Blog Grid ─────────────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: var(--space-20);
}

@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── Blog Card ────────────────────────────────────────────────────────── */
.blog-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e8ecf0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Image block — full-width, no border-radius (card clips it) */
.blog-card__image-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  flex-shrink: 0;
}

.blog-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card__image {
  transform: scale(1.04);
}

/* Content area below image */
.blog-card__content {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

/* Category tag — outlined pill, sits right below image */
.post-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d0d5dd;
  background: #f9fafb;
  color: #374151;
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  width: fit-content;
}

.blog-card__meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.blog-card__read-time {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 500;
}

.blog-card__read-time::before {
  content: '⏱';
  font-size: 0.85rem;
  opacity: 0.7;
}

.blog-card__title {
  font-size: 1.0rem;
  font-weight: 700;
  line-height: 1.4;
  color: #111827;
  margin: 0;
}

.blog-card__title a {
  color: inherit;
  text-decoration: none;
}

.blog-card__title a:hover {
  color: var(--color-primary);
}

.blog-card__excerpt {
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
  flex: 1;
}

/* Card Footer row at bottom */
.blog-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.blog-card__author-date {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111827;
  font-size: 0.82rem;
  font-weight: 600;
}

.blog-card__author-date .dot {
  color: #cbd5e1;
  font-weight: 400;
}

.blog-card__author-date .date {
  color: #64748b;
  font-weight: 500;
}

.blog-card__read-link {
  color: #4f46e5;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.blog-card__read-link:hover {
  text-decoration: underline;
}

/* Hide old post-meta wrapper & read-more */
.post-meta {
  display: contents;
  /* let children flow naturally */
}

.read-more {
  display: none;
}

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .blog-controls {
    flex-direction: column;
    border-radius: var(--radius-lg);
  }

  .blog-search-wrap {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .blog-filter-wrap {
    width: 100%;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ─── Single Post Layout ────────────────────────────────────────────────── */
.post-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ─── Header Section (Split Layout) ─── */
.post-header-wrap {
  padding: var(--space-20) 0 var(--space-12);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-12);
}

.post-header-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-12);
  align-items: center;
}

.post-breadcrumbs {
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.post-breadcrumbs a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.post-breadcrumbs a:hover {
  text-decoration: underline;
}

.post-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--space-8);
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.post-author-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--color-border);
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 700;
  color: var(--color-text-primary);
  font-size: var(--text-sm);
}

.post-date-meta {
  color: var(--color-text-tertiary);
  font-size: var(--text-xs);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.post-meta-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.post-hero-image {
  width: 100%;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  /* Soft shadow like image */
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* ─── Main Body (Sidebar + Content) ─── */
.post-body-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-16);
  padding-bottom: var(--space-24);
  position: relative;
}

/* ─── Sticky Sidebar ─── */
.post-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 100px;
  align-self: start;
  height: auto;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  /* Hide scrollbar for cleaner look */
  scrollbar-width: none;
}

.post-sidebar::-webkit-scrollbar {
  display: none;
}

.share-widget {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.share-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-tertiary);
  font-weight: 800;
  margin-bottom: var(--space-2);
}

.share-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all 0.2s;
}

.share-btn:hover {
  color: var(--color-primary);
  transform: translateX(4px);
}

.share-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  /* Circle icons */
  background: white;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.share-btn:hover .share-icon {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.cta-box {
  background: white;
  border: 1px solid var(--color-border);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.cta-box h4 {
  font-size: var(--text-sm);
  font-weight: 800;
  margin-bottom: var(--space-2);
  color: var(--color-text-primary);
}

.cta-box p {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-5);
  line-height: 1.5;
}

.cta-btn {
  display: block;
  width: 100%;
  padding: var(--space-3);
  background: #f97316;
  /* Specific Orange from image */
  color: white;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 700;
  text-decoration: none;
  transition: filter 0.2s;
}

.cta-btn:hover {
  filter: brightness(1.1);
}

/* ─── Typography & Content ─── */
.post-content {
  font-size: 1.125rem;
  /* 18px for readability */
  line-height: 1.8;
  color: #334155;
  /* Slate-700 */
}

.post-content h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
  /* Slate-900 */
  margin: var(--space-10) 0 var(--space-5);
  letter-spacing: -0.02em;
}

.post-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  margin: var(--space-8) 0 var(--space-4);
}

.post-content p {
  margin-bottom: var(--space-6);
}

.post-content ul,
.post-content ol {
  margin-bottom: var(--space-6);
  padding-left: var(--space-6);
}

.post-content li {
  margin-bottom: var(--space-2);
  position: relative;
}

/* ─── Components: Info Box ─── */
.info-box {
  background: #fffbeb;
  /* Amber-50 */
  border-left: 4px solid #f59e0b;
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-md);
  margin: var(--space-8) 0;
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.info-icon {
  color: #f59e0b;
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.info-content strong {
  display: block;
  color: #92400e;
  /* Amber-800 */
  margin-bottom: var(--space-1);
  font-weight: 700;
}

.info-content p {
  color: #b45309;
  /* Amber-700 */
  font-size: 0.95em;
  margin: 0;
}

/* ─── Components: Code Block (VS Code Style) ─── */
.code-block-wrap {
  background: #1e1e1e;
  /* Dark */
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-8) 0;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  /* Strong shadow */
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.code-header {
  background: #252526;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-lang {
  color: #ccc;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.copy-btn {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: color 0.2s;
}

.copy-btn:hover {
  color: #fff;
}

.post-content pre {
  margin: 0;
  padding: var(--space-5);
  overflow-x: auto;
  color: #d4d4d4;
  font-size: 14px;
  line-height: 1.6;
}

/* ─── Components: Table ─── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: var(--space-8) 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: white;
}

.custom-table th {
  background: #f8fafc;
  /* Slate-50 */
  text-align: left;
  padding: var(--space-4);
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid var(--color-border);
}

.custom-table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  color: #334155;
}

.custom-table tr:last-child td {
  border-bottom: none;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .post-header-content {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .post-hero-image {
    order: -1;
  }

  .post-body-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .post-sidebar {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-8);
    width: 100%;
  }

  .share-widget {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .cta-box {
    display: none;
  }
}

/* ─── Table of Contents ─── */
.toc-widget {
  margin-bottom: var(--space-8);
}

.toc-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-tertiary);
  font-weight: 800;
  margin-bottom: var(--space-3);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--color-border);
}

.toc-item {
  margin: 0;
}

.toc-link {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-size: 13px;
  /* Slightly smaller for density */
  color: var(--color-text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  /* Overlap parent border */
  transition: all 0.2s;
  line-height: 1.4;
}

.toc-link:hover {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  background: linear-gradient(90deg, #f8fafc 0%, transparent 100%);
}

.toc-link.active {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  font-weight: 600;
  background: linear-gradient(90deg, #eff6ff 0%, transparent 100%);
}

/* Indent nested items (H3) */
.toc-item.nested .toc-link {
  padding-left: var(--space-8);
  font-size: 12px;
}

/* ─── FAQ Section ─── */
.faq-section {
  margin-top: var(--space-16);
  margin-bottom: var(--space-12);
}

.faq-title {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: var(--space-8);
  letter-spacing: -0.02em;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  overflow: hidden;
  transition: all 0.2s;
  background: white;
}

.faq-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-6);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  transition: background 0.2s;
}

.faq-trigger:hover {
  background: #f8fafc;
}

.faq-icon {
  transition: transform 0.3s ease;
  color: #94a3b8;
}

.faq-trigger[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
  color: var(--color-primary);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 var(--space-6);
}

.faq-inner {
  padding-bottom: var(--space-6);
  color: 475569;
  line-height: 1.6;
}

/* ─── Social Share Bar ─── */
.share-bar {
  background: #f1f5f9;
  /* Slate 100 */
  padding: var(--space-5) var(--space-8);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-16);
}

.share-text {
  font-weight: 600;
  color: #334155;
  font-size: var(--text-lg);
}

.share-actions {
  display: flex;
  gap: var(--space-3);
}

.share-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 1.2rem;
}

.share-action-btn:hover {
  background: white;
  box-shadow: var(--shadow-sm);
  color: var(--color-primary);
}

/* ─── Author Bio Section ─── */
.author-bio-section {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-12);
  display: flex;
  gap: var(--space-8);
  align-items: flex-start;
  margin-bottom: var(--space-12);
}

.bio-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 4px solid white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bio-content h3 {
  font-size: 1.5rem;
  /* 24px */
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 var(--space-2) 0;
}

.bio-text {
  color: #475569;
  /* Slate 600 */
  line-height: 1.6;
  margin-bottom: var(--space-4);
  font-size: 1rem;
}

.bio-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.bio-link:hover {
  text-decoration: underline;
}

.bio-read-more {
  display: inline-block;
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
  font-size: var(--text-base);
}

.bio-read-more:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .author-bio-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .share-bar {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
}

/* ─── Bio Social Icons ─── */
.bio-socials {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.bio-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--color-border);
}

.bio-social-link:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.bio-social-link svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .bio-socials {
    justify-content: center;
  }
}