/* ── Blog shared styles ── */
/* Extends the BirthBuild landing page design system. */
/* CSS variables (--sage, --sand, --cream, etc.) declared in head partial. */

/* ── Blog header ── */
.blog-header {
  text-align: center;
  padding: 8rem 2rem 3rem;
}
.blog-header .section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1rem;
}
.blog-header .section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}
.blog-header .section-title em {
  font-style: italic;
  color: var(--sage);
  font-weight: 400;
}
.blog-header .section-desc {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.65;
  max-width: 560px;
  margin: 1rem auto 0;
  font-weight: 300;
}

/* ── Category filter pills ── */
.category-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 2rem 3rem;
  max-width: 900px;
  margin: 0 auto;
}
.category-pill {
  padding: 0.5rem 1.25rem;
  border: 1.5px solid var(--sage-pale);
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--sage);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.category-pill:hover {
  background: var(--sage-pale);
  border-color: var(--sage);
}
.category-pill.active {
  background: var(--sage);
  color: white;
  border-color: var(--sage);
}

/* ── Featured post card ── */
.featured-post {
  background: var(--sage-pale);
  border-radius: 16px;
  padding: 2.5rem;
  margin: 0 2rem 3rem;
  max-width: 1200px;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  text-decoration: none;
  display: block;
  color: inherit;
}
.featured-post:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
}
.featured-post .post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.featured-post .post-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.featured-post .post-excerpt {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.65;
  font-weight: 300;
  margin-bottom: 1.25rem;
  max-width: 640px;
}
.featured-post .post-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--sage);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.featured-post .post-link svg {
  transition: transform 0.3s;
}
.featured-post:hover .post-link svg {
  transform: translateX(3px);
}
.featured-post .post-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Post card (grid) ── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 0 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}
.post-card {
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(95, 113, 97, 0.06);
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  color: inherit;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.06);
  border-color: rgba(95, 113, 97, 0.12);
}
.post-card .post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.post-card .post-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.post-card .post-excerpt {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  font-weight: 300;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.post-card .post-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Shared meta elements */
.pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--sage-pale);
  color: var(--sage);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.meta-separator {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.read-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Article page ── */
.article-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 7rem 2rem 2rem;
}
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--sage);
  text-decoration: none;
  margin-bottom: 2rem;
  font-weight: 400;
  transition: color 0.2s;
}
.article-back:hover {
  color: var(--sage-light);
}
.article-back svg {
  transition: transform 0.3s;
}
.article-back:hover svg {
  transform: translateX(-3px);
}
.article-header .post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.article-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1rem;
}
.article-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.article-divider {
  border: none;
  border-top: 1px solid var(--sand-dark);
  margin: 2rem 0 0;
}

/* ── Article body layout (TOC + prose) ── */
.article-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 720px) 1fr;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

/* ── TOC sidebar ── */
.toc-sidebar {
  position: sticky;
  top: 6rem;
  align-self: start;
}
.toc-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toc-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.2rem 0 0.2rem 0.75rem;
  border-left: 2px solid transparent;
  transition: all 0.2s;
  display: block;
  line-height: 1.4;
}
.toc-link:hover {
  color: var(--sage);
}
.toc-link.active {
  color: var(--sage);
  font-weight: 500;
  border-left-color: var(--sage);
}

/* ── TOC mobile ── */
.toc-mobile {
  display: none;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 2rem;
}
.toc-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--sage);
  background: var(--sage-pale);
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}
.toc-toggle:hover {
  background: var(--sand-dark);
}
.toc-toggle svg {
  transition: transform 0.2s;
  margin-left: auto;
}
.toc-toggle.open svg {
  transform: rotate(180deg);
}
.toc-mobile-list {
  list-style: none;
  padding: 0.75rem 1rem;
  margin: 0;
  background: var(--sage-pale);
  border-radius: 0 0 10px 10px;
  display: none;
}
.toc-mobile-list.open {
  display: block;
}
.toc-mobile-list a {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--text-light);
  text-decoration: none;
}
.toc-mobile-list a:hover {
  color: var(--sage);
}

/* ── Article prose ── */
.article-prose {
  max-width: 720px;
  min-width: 0;
}
.article-prose h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--sage);
  margin: 3rem 0 1rem;
  line-height: 1.25;
  scroll-margin-top: 6rem;
}
.article-prose h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}
.article-prose p {
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 1.25rem;
}
.article-prose strong {
  font-weight: 500;
}
.article-prose a {
  color: var(--sage);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.article-prose a:hover {
  border-bottom-color: var(--sage);
}
.article-prose blockquote {
  border-left: 4px solid var(--sage);
  background: var(--sage-pale);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}
.article-prose blockquote p {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text-light);
  margin: 0;
}
.article-prose code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  background: var(--sage-pale);
  padding: 2px 6px;
  border-radius: 4px;
}
.article-prose pre {
  background: var(--text);
  color: var(--cream);
  padding: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  margin: 2rem 0;
}
.article-prose pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  color: inherit;
}
.article-prose ul,
.article-prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.article-prose li {
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.article-prose li::marker {
  color: var(--sage);
}
.article-prose img {
  max-width: min(900px, calc(100% + 180px));
  margin-left: 50%;
  transform: translateX(-50%);
  border-radius: 12px;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}
.article-prose .img-caption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 2rem;
}
.article-prose hr {
  border: none;
  border-top: 1px solid var(--sand-dark);
  margin: 3rem 0;
}
.article-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
}
.article-prose th {
  text-align: left;
  font-weight: 500;
  padding: 0.75rem;
  border-bottom: 2px solid var(--sand-dark);
  color: var(--text);
}
.article-prose td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--sand-dark);
  color: var(--text-light);
  font-weight: 300;
}
.article-prose thead th:first-child,
.article-prose tbody td:first-child {
  font-weight: 500;
  color: var(--text);
}

/* ── CTA banner ── */
.cta-banner {
  background: var(--sage);
  color: white;
  border-radius: 16px;
  padding: 3rem;
  max-width: 720px;
  margin: 3rem auto;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at 20% 50%,
    rgba(255, 255, 255, 0.05) 0%,
    transparent 60%
  );
}
.cta-banner-inner {
  position: relative;
}
.cta-banner h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 300;
  margin-bottom: 0.75rem;
}
.cta-banner p {
  font-size: 0.95rem;
  opacity: 0.8;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 1.5rem;
  font-weight: 300;
}
.cta-banner .btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: white;
  color: var(--sage);
  border: none;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}
.cta-banner .btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
.cta-banner .btn-cta svg {
  transition: transform 0.3s;
}
.cta-banner .btn-cta:hover svg {
  transform: translateX(3px);
}

/* ── Related posts ── */
.related-posts {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}
.related-posts .section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1.5rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* ── FAQ section ── */
.faq-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}
.faq-section h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.faq-item {
  border-bottom: 1px solid var(--sand-dark);
}
.faq-item:first-child {
  border-top: 1px solid var(--sand-dark);
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  list-style: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: '';
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--sage);
  border-bottom: 2px solid var(--sage);
  transform: rotate(-45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 1rem;
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
}
.faq-item .faq-answer {
  padding: 0 0 1.25rem;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-light);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .article-layout {
    display: block;
    max-width: 720px;
    padding: 2rem 2rem 4rem;
  }
  .toc-sidebar {
    display: none;
  }
  .toc-mobile {
    display: block;
    margin-bottom: 2rem;
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .blog-header {
    padding: 7rem 1.25rem 2rem;
  }
  .category-filter {
    padding: 0 1.25rem 2rem;
  }
  .post-grid {
    grid-template-columns: 1fr;
    padding: 0 1.25rem 3rem;
  }
  .featured-post {
    padding: 1.5rem;
    margin: 0 1.25rem 2rem;
  }
  .article-header {
    padding: 6rem 1.25rem 1.5rem;
  }
  .article-layout {
    padding: 1.5rem 1.25rem 3rem;
  }
  .toc-mobile {
    padding: 0 1.25rem;
  }
  .cta-banner {
    margin-left: 1.25rem;
    margin-right: 1.25rem;
    padding: 2rem;
  }
  .related-posts {
    padding: 0 1.25rem 3rem;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
  .faq-section {
    padding: 0 1.25rem 3rem;
  }
  .article-prose img {
    max-width: 100%;
    margin-left: 0;
    transform: none;
  }
}
