/* blog.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700&display=swap');

/* Core Layout & Page */
.blog-page {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: #18231e;
  background-color: #fff;
  line-height: 1.6;
}

.blog-wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* Blog Hero */
.blog-hero {
  background: #f3faf6;
  border-bottom: 1px solid #e3efe8;
  padding: 80px 0 64px;
  text-align: center;
}

.blog-hero .blog-kicker {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #007a4d;
  margin: 0 0 16px;
}

.blog-hero h1 {
  font-family: Poppins, Inter, sans-serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #18231e;
  margin: 0 0 20px;
}

.blog-hero .blog-dek {
  font-size: 1.25rem;
  color: #44564a;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Blog Index */
.blog-listing {
  padding: 80px 24px 120px;
}

.blog-section-heading {
  margin-bottom: 64px;
  text-align: center;
}

.blog-section-heading h2 {
  font-family: Poppins, Inter, sans-serif;
  font-size: 2rem;
  margin: 0 0 12px;
  color: #18231e;
}

.blog-section-heading p {
  font-size: 1.125rem;
  color: #44564a;
  margin: 0;
}

/* Featured Post */
.blog-feature {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  align-items: center;
  margin-bottom: 96px;
}

.blog-feature .blog-card-art {
  aspect-ratio: 16/10;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #dce9e2;
  background: #f8fbf9;
  margin-bottom: 0;
  width: 100%;
}

.blog-feature .blog-card-art img,
.blog-feature .blog-card-art svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-feature .blog-card-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.blog-feature .blog-card-content h3 {
  font-family: Poppins, Inter, sans-serif;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  line-height: 1.2;
  margin: 16px 0 20px;
  letter-spacing: -0.02em;
}

.blog-feature .blog-card-content p {
  font-size: 1.125rem;
  -webkit-line-clamp: 4;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 56px 40px;
}

/* Blog Card */
.blog-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  color: inherit;
  text-decoration: none;
}

.blog-card-art {
  aspect-ratio: 16/9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #dce9e2;
  background: #f8fbf9;
  margin-bottom: 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.blog-card:hover .blog-card-art {
  border-color: #a6efd1;
  transform: translateY(-2px);
}

.blog-card-art img,
.blog-card-art svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-card-content h3 {
  font-family: Poppins, Inter, sans-serif;
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 0 0 12px;
  color: #18231e;
  transition: color 0.2s ease;
}

.blog-card:hover h3 {
  color: #007a4d;
}

.blog-card-content p {
  font-size: 1rem;
  color: #44564a;
  line-height: 1.6;
  margin: 0 0 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-meta {
  font-size: 0.875rem;
  font-weight: 500;
  color: #5c7062;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.blog-read, .recent-read {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #007a4d;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Article Page */
.blog-article {
  padding: 80px 0 120px;
}

.blog-breadcrumb {
  margin-bottom: 40px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #5c7062;
  display: flex;
  gap: 8px;
  align-items: center;
}

.blog-breadcrumb a {
  color: #18231e;
  text-decoration: none;
}

.blog-breadcrumb a:hover {
  text-decoration: underline;
  color: #007a4d;
}

.blog-article-header {
  margin-bottom: 56px;
  max-width: 800px;
}

.blog-article-header .blog-kicker {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #007a4d;
  margin: 0 0 16px;
}

.blog-article-header .blog-meta {
  margin-bottom: 24px;
}

.blog-article-header h1 {
  font-family: Poppins, Inter, sans-serif;
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #18231e;
  margin: 0 0 24px;
}

.blog-article-header .blog-dek {
  font-size: 1.25rem;
  color: #44564a;
  -webkit-line-clamp: unset;
  margin-bottom: 40px;
  line-height: 1.6;
}

.blog-hero-art {
  margin: 0 0 48px;
  max-width: 960px;
}

.blog-hero-art img,
.blog-hero-art svg {
  width: 100%;
  height: auto;
  border-radius: 20px;
  border: 1px solid #dce9e2;
  background: #f8fbf9;
  display: block;
}

.blog-hero-art figcaption {
  margin-top: 16px;
  font-size: 0.875rem;
  color: #5c7062;
  text-align: center;
  line-height: 1.5;
}

.blog-reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

@media (min-width: 1000px) {
  .blog-reading-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

/* Article Body */
.blog-body {
  min-width: 0;
  max-width: 70ch;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #253c30;
  overflow-wrap: break-word;
}

.blog-body p {
  margin: 0 0 1.25em;
}

.blog-body h2 {
  font-family: Poppins, Inter, sans-serif;
  font-size: clamp(1.55rem, 2.1vw, 1.875rem);
  line-height: 1.28;
  margin: 2.3em 0 0.65em;
  color: #18231e;
  letter-spacing: -0.02em;
  scroll-margin-top: 120px;
}

.blog-body h2:first-child {
  margin-top: 0;
}

.blog-body h3 {
  font-family: Poppins, Inter, sans-serif;
  font-size: clamp(1.2rem, 1.5vw, 1.35rem);
  line-height: 1.35;
  margin: 1.7em 0 0.6em;
  color: #18231e;
}

.blog-body ul, 
.blog-body ol {
  margin: 0 0 1.4em;
  padding-left: 1.5em;
}

.blog-body li {
  padding-left: 0.2em;
  margin-bottom: 0.55em;
}

.blog-body li::marker {
  color: #007a4d;
}

.blog-body a {
  color: #007a4d;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.blog-body a:hover {
  color: #005536;
}

.blog-body a:focus-visible {
  outline: 2px solid #00c878;
  outline-offset: 3px;
}

.blog-body strong {
  font-weight: 700;
  color: #18231e;
}

.blog-body blockquote {
  font-size: 1.35rem;
  line-height: 1.5;
  font-family: Poppins, Inter, sans-serif;
  color: #007a4d;
  margin: 2.5em 0;
  padding-left: 28px;
  border-left: 4px solid #00c878;
  font-style: italic;
}

/* Blog Figure / Diagrams */
.blog-figure {
  margin: 3em 0;
}

.blog-figure img,
.blog-figure svg {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #dce9e2;
  background: #f8fbf9;
  display: block;
}

.blog-figure figcaption {
  margin-top: 16px;
  font-size: 0.875rem;
  color: #5c7062;
  text-align: center;
  line-height: 1.5;
}

/* Blog Callout */
.blog-callout {
  background: #f3faf6;
  border-left: 4px solid #00c878;
  padding: 24px 28px;
  margin: 2em 0;
  border-radius: 0 16px 16px 0;
}

.blog-callout p:last-child {
  margin-bottom: 0;
}

.blog-callout h4 {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-family: Poppins, Inter, sans-serif;
  color: #18231e;
}

.blog-template {
  border: 1px solid #dce9e2;
  border-left: 4px solid #00b974;
}

.blog-template-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid #dce9e2;
}

.blog-template .blog-template-label {
  margin: 0;
  line-height: 1.4;
}

.blog-template-label strong {
  color: #007a4d;
}

.blog-template-stage {
  color: #52685a;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.blog-template .blog-template-subject {
  margin: 0 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #dce9e2;
  line-height: 1.5;
}

.blog-template-subject strong {
  color: #18231e;
}

.blog-template-copy p {
  margin: 0 0 0.9em;
  line-height: 1.65;
}

.blog-template-copy p:last-child {
  margin-bottom: 0;
}

/* Blog Rail (Sidebar if needed) */
.blog-rail {
  position: sticky;
  top: 120px;
  background: #f8fbf9;
  border: 1px solid #dce9e2;
  border-radius: 16px;
  padding: 32px;
}

.blog-rail strong {
  display: block;
  font-family: Poppins, Inter, sans-serif;
  font-size: 1.125rem;
  margin-bottom: 12px;
  color: #18231e;
}

.blog-rail p {
  font-size: 0.9375rem;
  color: #44564a;
  line-height: 1.6;
  margin-bottom: 24px;
}

.blog-rail a {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9375rem;
  color: #007a4d;
  text-decoration: none;
}

.blog-rail a:hover {
  text-decoration: underline;
}

/* Repository-published articles use the same reading layout and type scale. */
.blog-published {
  margin-top: 96px;
}
.content-builder-card:not(:has(.blog-card-art)),
.content-builder-related {
  padding: 28px;
  border: 1px solid #dce9e2;
  border-radius: 14px;
}
.content-builder-taxonomy {
  margin: 8px 0;
}
.content-builder-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.content-builder-toc li + li {
  margin-top: 12px;
}
.content-builder-toc a {
  line-height: 1.45;
}
.content-builder-toc a:focus-visible,
.content-builder-cta__link:focus-visible {
  outline: 3px solid #00c878;
  outline-offset: 4px;
}
.blog-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}
.blog-body .content-builder-cta {
  margin: 3em 0 0;
  padding: 32px;
  border: 1px solid #b8e7cf;
  border-radius: 18px;
  background: #f3faf6;
}
.content-builder-cta__title {
  font: 700 1.35rem/1.35 Poppins, Inter, sans-serif;
  color: #18231e;
  margin-bottom: 12px;
}
.blog-body .content-builder-cta__link {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 11px 20px;
  background: #007a4d;
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}
.blog-body .content-builder-cta__link:hover {
  background: #005536;
  color: #fff;
}
@media (max-width: 999px) {
  .content-builder-toc { position: static; }
}

/* Post Nav (Keep Reading) */
.blog-post-nav {
  margin-top: 80px;
  padding-top: 64px;
  border-top: 1px solid #dce9e2;
}

.blog-post-nav h2 {
  font-family: Poppins, Inter, sans-serif;
  font-size: 2rem;
  margin: 0 0 40px;
  color: #18231e;
}

.blog-all-link {
  display: inline-flex;
  margin-top: 48px;
  font-weight: 600;
  font-size: 1.125rem;
  color: #007a4d;
  text-decoration: none;
}

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

/* Recent Posts Carousel */
.recent-posts {
  padding: 80px 0;
  background: #f9fbf9;
  border-top: 1px solid #e1eae4;
  overflow: hidden;
}
.recent-posts .ba-container {
  box-sizing: border-box;
}

.recent-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 24px;
}

.recent-heading .blog-kicker {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #007a4d;
  margin: 0 0 12px;
}

.recent-heading h2 {
  font-family: Poppins, Inter, sans-serif;
  font-size: 1.75rem;
  margin: 0;
  color: #18231e;
}

.recent-heading-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.recent-heading-actions a {
  font-weight: 600;
  color: #007a4d;
  text-decoration: none;
  white-space: nowrap;
}

.recent-heading-actions a:hover {
  text-decoration: underline;
}

.recent-controls {
  display: none;
  gap: 12px;
}

.recent-can-scroll .recent-controls {
  display: flex;
}

.recent-controls button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #dce9e2;
  background: #fff;
  color: #18231e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recent-controls button:hover {
  border-color: #007a4d;
  color: #007a4d;
  background: #f3faf6;
}

.recent-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #dce9e2;
  color: #5c7062;
  background: #fff;
}

.recent-track {
  display: flex;
  gap: 32px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 24px;
}

.recent-track::-webkit-scrollbar {
  display: none;
}

.recent-card {
  scroll-snap-align: start;
  flex: 0 0 calc(33.333% - 21.33px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.recent-card:hover {
  text-decoration: none;
  color: inherit;
}

.recent-card img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #dce9e2;
  margin-bottom: 20px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.recent-card:hover img {
  border-color: #a6efd1;
  transform: translateY(-2px);
}

.recent-card .blog-meta {
  margin-bottom: 12px;
  margin-top: 0;
}

.recent-card h3 {
  font-family: Poppins, Inter, sans-serif;
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0;
  color: #18231e;
  transition: color 0.2s ease;
}

.recent-card:hover h3 {
  color: #007a4d;
}

.recent-card .recent-read {
  margin-top: auto;
  padding-top: 16px;
}

/* Media Queries */
@media (max-width: 1000px) {
  .recent-card {
    flex: 0 0 calc(50% - 16px);
  }
}

@media (max-width: 900px) {
  .blog-feature {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 800px) {
  .blog-hero {
    padding: 64px 0 48px;
  }
  
  .blog-article {
    padding: 56px 0 80px;
  }
  
  .recent-posts {
    padding: 64px 0;
  }
}

@media (max-width: 600px) {
  .blog-body {
    font-size: 1rem;
  }

  .blog-callout {
    padding: 20px 22px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }
  
  .blog-post-nav {
    flex-direction: column;
  }
  
  .blog-post-nav a.next {
    text-align: left;
  }

  .recent-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  
  .recent-card {
    flex: 0 0 85%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .recent-track {
    scroll-behavior: auto;
  }
  
  .blog-card-art,
  .blog-post-nav a,
  .recent-controls button {
    transition: none;
  }
  
  .blog-card:hover .blog-card-art {
    transform: none;
  }
}