/* Blog pages — page-scoped overrides only (listing, detail, search) */

body.blog-page .gr-breadcrumb::before,
body.blog-page .blog-hero {
  background: var(--color-primary-50);
}

#main-content > .gr-breadcrumb + .blog-hero {
  padding-top: 1.25rem;
}

body.blog-page .blog-hero {
  padding: 2rem var(--page-gutter-x) 3.5rem;
}

body.blog-page .blog-hero-title {
  font-size: clamp(1.75rem, 4.5vw, 2.25rem);
  letter-spacing: -0.02em;
}

body.blog-page .blog-hero-subtitle {
  font-size: var(--text-body);
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

body.blog-page .section-header-simple h2,
body.blog-search-page .section-header-simple h2,
body.blog-detail-page .section-header-simple h2 {
  font-size: var(--heading-title);
}

body.blog-page .section-header-simple p,
body.blog-search-page .section-header-simple p,
body.blog-detail-page .section-header-simple p {
  font-size: var(--text-body);
}

body.blog-page .newsletter-subtitle,
body.blog-search-page .newsletter-subtitle,
body.blog-detail-page .newsletter-subtitle {
  font-size: var(--text-xl);
}

body.blog-page .featured-badge {
  margin-top: 0.5rem;
}

body.blog-page .categories-filter {
  margin-bottom: 2rem;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

body.blog-page .blog-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.875rem;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: 9999px;
  font-weight: 500;
  color: var(--neutral-600);
  transition: all 0.3s;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  line-height: 1.25;
  text-decoration: none;
}

body.blog-page .blog-filter-btn svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  color: inherit;
  stroke: currentColor;
}

body.blog-page .blog-filter-btn.active svg {
  color: var(--white);
}

body.blog-page .blog-filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

body.blog-page .blog-filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--white);
  box-shadow: 0 4px 12px var(--color-primary-shadow);
}

body.blog-page .blog-featured:not([hidden]) {
  margin-bottom: 1rem;
}

body.blog-page .blog-featured:not([hidden]) .featured-post {
  margin-bottom: 4rem;
}

body.blog-page .blog-featured[hidden] {
  display: none;
}

body.blog-page .featured-footer {
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
}

body.blog-page .featured-footer .blog-meta {
  margin-bottom: 0;
}

body.blog-page .featured-footer .btn-read-more {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: var(--text-sm);
  gap: 0.375rem;
}

body.blog-page .featured-footer .btn-read-more svg {
  width: 0.875rem;
  height: 0.875rem;
}

body.blog-page .blog-card-footer {
  justify-content: flex-end;
}

body.blog-page .blog-card.show {
  display: block;
  height: 100%;
}

body.blog-page .blog-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

body.blog-page .blog-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

body.blog-page .blog-card-excerpt {
  margin-bottom: 0;
}

body.blog-page .blog-card-footer {
  margin-top: auto;
}

body.blog-page .featured-post {
  border-radius: 1.25rem;
  overflow: hidden;
  gap: 1.5rem;
}

body.blog-page .featured-content {
  padding-top: 0;
}

@media (min-width: 1140px) {
  body.blog-page .featured-content {
    padding: 2rem 2.5rem 2rem 0;
  }
}

body.blog-page .featured-image {
  position: relative;
  min-height: 280px;
  box-shadow: none;
}

body.blog-page .blog-card-link:hover .blog-card-title {
  color: var(--color-primary);
}

body.blog-page .featured-title,
body.blog-search-page .featured-title,
body.blog-detail-page .featured-title {
  font-size: var(--heading-title);
}

body.blog-page .featured-excerpt,
body.blog-search-page .featured-excerpt,
body.blog-detail-page .featured-excerpt {
  font-size: var(--text-body);
}

body.blog-page .featured-excerpt {
  margin-bottom: 0.75rem;
}

body.blog-page .featured-title a {
  color: inherit;
  text-decoration: none;
}

body.blog-page .featured-title a:hover {
  color: var(--color-primary);
}

@media (max-width: 767px) {
  body.blog-page .blog-hero {
    padding-bottom: 2.5rem;
  }

  body.blog-page .blog-hero-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  body.blog-page .featured-image {
    min-height: 220px;
  }

  body.blog-page .categories-filter {
    gap: 0.5rem;
    padding: 0.5rem 0;
    justify-content: flex-start;
  }

  body.blog-page .blog-filter-btn:hover {
    transform: none;
  }
}

/* ===== Blog detail page ===== */

body.blog-detail-page .gr-breadcrumb::before,
body.blog-detail-page .article-hero {
  background: var(--color-primary-50);
}

body.blog-detail-page #main-content > .gr-breadcrumb + .article-hero {
  padding-top: 1.25rem;
}

body.blog-detail-page .article-hero {
  padding-bottom: 0;
}

body.blog-detail-page .article-hero:not(:has(.article-hero__media)) {
  padding-bottom: 2rem;
}

body.blog-detail-page .article-header {
  padding: 0 0 1.25rem;
  background: transparent;
}

body.blog-detail-page .article-hero:has(.article-hero__media) .article-header {
  padding-bottom: 1rem;
}

body.blog-detail-page .article-header .container,
body.blog-detail-page .article-header .container-article {
  padding-inline: var(--page-gutter-x);
}

body.blog-detail-page .article-meta-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  border-top: none;
  border-bottom: none;
  margin-bottom: 0;
  padding: 0.75rem 0 0;
}

body.blog-detail-page .article-title {
  font-size: var(--heading-md);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

body.blog-detail-page .article-subtitle {
  font-size: var(--text-body);
  max-width: 48rem;
  line-height: 1.65;
  margin-bottom: 0;
  color: var(--neutral-600);
}

body.blog-detail-page .article-category-badge {
  margin-bottom: 1rem;
}

body.blog-detail-page .article-hero__media {
  padding: 0 0 2.5rem;
}

body.blog-detail-page .article-hero__media .container-article {
  max-width: 1280px;
  padding-inline: var(--page-gutter-x);
}

body.blog-detail-page .article-hero__figure {
  margin: 0;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--white);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.04),
    0 20px 48px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

body.blog-detail-page .article-hero__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 21 / 9;
  max-height: min(42vw, 440px);
  min-height: 200px;
  object-fit: cover;
  object-position: center;
}

body.blog-detail-page .article-content-section {
  padding: 2.5rem 0 3rem;
}

body.blog-detail-page .article-hero + .article-content-section {
  padding-top: 2rem;
}

body.blog-detail-page .article-content-section > .container-article {
  padding-inline: var(--page-gutter-x);
}

body.blog-detail-page .container-article {
  max-width: 1280px;
}

body.blog-detail-page .article-layout {
  align-items: stretch;
}

body.blog-detail-page .toc-sidebar {
  align-self: stretch;
}

body.blog-detail-page .toc-sticky,
body.blog-detail-page .terms-sidebar-sticky {
  position: sticky;
  top: calc(var(--site-header-height) + 1.75rem);
  z-index: 5;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}

body.blog-detail-page .sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-600) 100%);
  color: var(--white);
  border-radius: 0.75rem 0.75rem 0 0;
}

body.blog-detail-page .sidebar-header h3 {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

body.blog-detail-page .sidebar-header svg {
  width: 1.125rem;
  height: 1.125rem;
  color: var(--white);
  stroke: currentColor;
  flex-shrink: 0;
}

body.blog-detail-page .toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0;
  padding: 0.55rem 0.5rem;
  background: var(--white);
  border: 2px solid var(--neutral-200);
  border-top: none;
  border-radius: 0;
}

body.blog-detail-page .toc-link,
body.blog-detail-page .toc-nav .terms-nav-link {
  display: block;
  padding: 0.4rem 0.65rem;
  font-size: var(--text-sm);
  line-height: 1.35;
}

body.blog-detail-page .reading-progress {
  margin-top: 0;
  padding: 0.75rem 1rem 0.85rem;
  background: var(--white);
  border: 2px solid var(--neutral-200);
  border-top: 1px solid var(--neutral-200);
  border-radius: 0 0 0.75rem 0.75rem;
}

body.blog-detail-page .progress-label {
  font-size: var(--text-sm);
  margin-bottom: 0.5rem;
}

body.blog-detail-page .progress-bar-container {
  height: 0.375rem;
  margin-bottom: 0.375rem;
}

body.blog-detail-page .progress-percentage {
  font-size: var(--text-sm);
}

@media (min-width: 1024px) {
  body.blog-detail-page .article-main {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  body.blog-detail-page .article-layout {
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 1.5rem;
  }

  body.blog-detail-page .toc-sidebar {
    display: block;
    align-self: stretch;
    min-height: 100%;
  }
}

body.blog-detail-page .social-share {
  gap: 0.5rem;
}

body.blog-detail-page .share-label {
  font-size: var(--text-sm);
  color: var(--neutral-500);
  margin-right: 0.25rem;
}

body.blog-detail-page .share-btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  margin: 0;
  border: 1px solid var(--neutral-200);
  background: var(--white);
  color: var(--neutral-600);
  border-radius: 0.5rem;
  flex-shrink: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.blog-detail-page .share-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
}

body.blog-detail-page .share-btn__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

body.blog-detail-page .share-btn--brand svg {
  fill: currentColor;
}

body.blog-detail-page .share-btn--link svg {
  stroke: currentColor;
  fill: none;
}

body.blog-detail-page .share-btn:hover {
  background: var(--color-primary-50);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

body.blog-detail-page .article-content {
  font-size: var(--text-body);
}

body.blog-detail-page .article-content .content-section {
  margin-bottom: 1.5rem;
}

body.blog-detail-page .article-content .content-section:last-child {
  margin-bottom: 0;
}

body.blog-detail-page .article-content h2 {
  font-size: var(--text-xl);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

body.blog-detail-page .article-content h3 {
  font-size: var(--text-lg);
}

body.blog-detail-page .quote-block blockquote {
  font-size: var(--text-lg);
  max-width: 70ch;
}

body.blog-detail-page .article-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

body.blog-detail-page .article-content a:hover {
  color: var(--color-primary-hover);
}

body.blog-detail-page .related-articles-grid .blog-card {
  display: block;
  height: 100%;
}

body.blog-detail-page .related-articles-grid .blog-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

body.blog-detail-page .related-articles-grid .blog-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

body.blog-detail-page .related-articles-grid .blog-card-excerpt {
  margin-bottom: 0;
}

body.blog-detail-page .related-articles-grid .blog-card-footer {
  margin-top: auto;
  justify-content: flex-end;
}

body.blog-detail-page .related-articles-grid .blog-card-link:hover .blog-card-title {
  color: var(--color-primary);
}

/* ===== Blog search page ===== */

body.blog-search-page .gr-breadcrumb::before,
body.blog-search-page .blog-hero {
  background: var(--color-primary-50);
}

body.blog-search-page #main-content > .gr-breadcrumb + .blog-hero {
  padding-top: 1.25rem;
}

body.blog-search-page .blog-hero {
  padding: 2rem var(--page-gutter-x) 3rem;
}

body.blog-search-page .blog-hero-title {
  font-size: clamp(1.75rem, 4.5vw, 2.25rem);
  letter-spacing: -0.02em;
}

body.blog-search-page .blog-hero-subtitle {
  font-size: var(--text-body);
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
}

body.blog-search-page .search-results-meta {
  text-align: center;
  color: var(--neutral-500);
  font-size: var(--text-body);
  margin-bottom: 2rem;
}

body.blog-search-page .search-results-meta strong {
  color: var(--neutral-800);
}

body.blog-search-page .categories-filter {
  margin-bottom: 2rem;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

body.blog-search-page .no-results a {
  color: var(--color-primary);
  text-decoration: underline;
}

body.blog-search-page .blog-card.show {
  display: block;
  height: 100%;
}

body.blog-search-page .blog-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

body.blog-search-page .blog-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

body.blog-search-page .blog-card-excerpt {
  margin-bottom: 0;
}

body.blog-search-page .blog-card-footer {
  margin-top: auto;
  justify-content: flex-end;
}

body.blog-search-page .blog-card-link:hover .blog-card-title {
  color: var(--color-primary);
}

body.blog-search-page .blog-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.875rem;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: 9999px;
  font-weight: 500;
  color: var(--neutral-600);
  transition: all 0.3s;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  line-height: 1.25;
  text-decoration: none;
}

body.blog-search-page .blog-filter-btn svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

body.blog-search-page .blog-filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

body.blog-search-page .blog-filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--white);
  box-shadow: 0 4px 12px var(--color-primary-shadow);
}

@media (max-width: 767px) {
  body.blog-detail-page .article-header {
    padding-bottom: 0.75rem;
  }

  body.blog-detail-page .article-meta-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  body.blog-detail-page .article-hero__media {
    padding-bottom: 1.75rem;
  }

  body.blog-detail-page .article-hero__figure {
    border-radius: 0.75rem;
  }

  body.blog-detail-page .article-hero__image {
    aspect-ratio: 16 / 10;
    max-height: min(56vw, 280px);
    min-height: 180px;
  }

  body.blog-search-page .blog-hero {
    padding-bottom: 2.5rem;
  }

  body.blog-search-page .blog-hero-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  body.blog-search-page .categories-filter {
    gap: 0.5rem;
    padding: 0.5rem 0;
    justify-content: flex-start;
  }

  body.blog-search-page .blog-filter-btn:hover {
    transform: none;
  }
}
