/* ============================================
   Blog Page Hero Padding
   ============================================ */
.section-home-hero-v1 {
  padding-top: 1.5rem;
}

  .section-home-hero-v1 > .padding-global {
    padding-top: 4rem;
  }

@media screen and (max-width: 991px) {
  .section-home-hero-v1 {
    padding-top: 0;
  }

    .section-home-hero-v1 > .padding-global {
      padding-top: 4rem;
    }
}

/* ============================================
   Blog TOC Styles
   ============================================ */
.blog-post-sidebar .toc-scroll-content > ul > li > a,
.blog-post-sidebar .toc-scroll-content > ol > li > a {
  font-size: 1.125rem;
}

.blog-post-sidebar .toc-scroll-content ul ul a,
.blog-post-sidebar .toc-scroll-content ol ol a,
.blog-post-sidebar .toc-scroll-content ul ol a,
.blog-post-sidebar .toc-scroll-content ol ul a {
  font-size: 0.95rem;
}

/* Webflow-styled Blog page helpers (scoped where possible). */

/* --- Blog search (match KB search styling) --- */
#blogSearchForm .blog-search-input-wrap {
  position: relative;
  width: 100%;
  max-width: none;
}

#blogSearchForm .blog-search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#blogSearchForm .blog-search-input {
  width: 100%;
  padding-left: 2.75rem;
}

#blogSearchForm .form-input {
  background-color: #FAFAFA;
  border: none;
  border-radius: 6px 0 0 6px;
}

  #blogSearchForm .form-input:focus,
  #blogSearchForm .form-input:focus-visible {
    outline: none;
    box-shadow: none;
    border: none;
  }

#blogSearchForm .button {
  border-radius: 6px;
  min-height: 3rem;
  white-space: nowrap;
}

#blogSearchForm .form-input,
#blogSearchForm .button {
  height: 3rem;
}

#blogSearchForm .form-input {
  border-right: none;
}

#blogSearchForm .blog-search-button-wrap {
  background-color: #FAFAFA;
  display: flex;
  align-items: stretch;
  border-radius: 0 6px 6px 0;
}

  #blogSearchForm .blog-search-button-wrap .button {
    border-radius: 6px;
  }

.blog-search-outer {
  padding-left: 20px;
  padding-right: 20px;
}

.blog-search-row {
  display: flex;
  gap: 0;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

@media screen and (max-width: 767px) {
  .blog-search-row {
    flex-direction: row;
  }

  #blogSearchForm .blog-search-input-wrap {
    flex: 1 1 auto;
  }

  #blogSearchForm .blog-search-button-wrap {
    flex: 0 0 auto;
  }

  #blogSearchForm .button {
    width: auto;
  }
}

/* --- Blog index cards (align with Webflow product card styles) --- */
.blog-index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

@media screen and (max-width: 991px) {
  .blog-index-grid {
    grid-template-columns: 1fr;
  }
}

.blog-card-meta {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
  align-items: center;
}

  .blog-card-meta img {
    width: 18px;
    height: 18px;
  }

.blog-card-title {
  margin: 0;
}

.blog-card-description {
  word-break: break-word;
  white-space: normal;
  overflow-wrap: break-word;
}

/* Make the entire card clickable (stretched-link pattern) */
.blog-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.blog-card-content {
  position: relative;
  z-index: 2;
}

.blog-card-readmore {
  margin-top: auto;
}

  .blog-card-readmore .read-more-link {
    justify-content: flex-start;
  }

/* Featured (first) blog post card */
.blog-featured-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  padding: 2.5rem;
}

.blog-featured-content {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.blog-featured-image {
  grid-column: 2;
  width: 100%;
  max-height: 22rem;
  object-fit: cover;
  background: #F5F4F1;
  border-radius: 16px;
  overflow: hidden;
  display: block;
}

/* Stack under 767px (image below content) */
@media screen and (max-width: 767px) {
  .blog-featured-card {
    grid-template-columns: 1fr;
    padding: 2rem;
    gap: 2rem;
  }

    .blog-featured-card .blog-featured-content {
      margin-bottom: 2rem;
    }

  .blog-featured-content {
    grid-column: auto;
  }

  .blog-featured-image {
    grid-column: auto;
    max-height: 18rem;
  }
}

/* Featured card: force 2-column grid for >= 768px */
@media screen and (min-width: 768px) {
  .product-card.blog-featured-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    align-items: center;
  }

    .product-card.blog-featured-card .blog-featured-content {
      grid-column: 1;
    }

    .product-card.blog-featured-card .blog-featured-image {
      grid-column: 2;
      justify-self: stretch;
      align-self: center;
      border-radius: 16px;
    }
}

/* Ensure the full-card link captures clicks on inner elements */
.product-card {
  position: relative;
}

  .product-card .blog-card-link {
    z-index: 2;
  }

  .product-card .blog-card-content {
    z-index: 1;
  }

  /* Keep explicit links above the overlay so they remain accessible */
  .product-card .read-more-link {
    position: relative;
    z-index: 3;
  }

/* Blog cards: consistent height + top-left alignment */
.blog-index-grid .product-card {
  height: 100%;
}

.blog-index-grid .product-card-content-v1.blog-card-content {
  height: 100%;
  min-height: 100%;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  text-align: left !important;
}

  /* Top group: date/title/description stays at the top */
  .blog-index-grid .product-card-content-v1.blog-card-content .blog-card-meta,
  .blog-index-grid .product-card-content-v1.blog-card-content .blog-card-title,
  .blog-index-grid .product-card-content-v1.blog-card-content .blog-card-description {
    text-align: left !important;
  }

  /* Bottom group: push Read more to the bottom */
  .blog-index-grid .product-card-content-v1.blog-card-content .blog-card-readmore {
    margin-top: auto !important;
    width: 100%;
  }

    .blog-index-grid .product-card-content-v1.blog-card-content .blog-card-readmore .read-more-link {
      justify-content: flex-start;
    }

/* Explicit top/bottom wrappers for blog cards */
.blog-index-grid .blog-card-top {
  width: 100%;
}

.blog-index-grid .blog-card-bottom {
  margin-top: auto !important;
  width: 100%;
}

  .blog-index-grid .blog-card-bottom .read-more-link {
    justify-content: flex-start;
  }

/* --- Individual blog post (no Bootstrap) --- */
.blog-post-meta {
  display: flex;
  justify-content: center;
  text-align: center;
}

  .blog-post-meta .blog-card-meta {
    justify-content: center;
  }

.blog-post-hero-image-wrap {
  display: flex;
  justify-content: center;
  background: #F5F4F1;
  border-radius: 16px;
  padding: 2rem;
}

.blog-post-hero-image {
  width: 100%;
  max-width: 320px;
  border-radius: 16px;
}

/* News uses the same structure as blog posts; allow wider hero image for news if needed */
.blog-post-hero-image {
  max-width: 100%;
}

.blog-post-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 2rem;
  align-items: start;
}

.blog-post-sidebar-inner {
  position: sticky;
  top: 110px;
}

@media screen and (max-width: 991px) {
  .blog-post-grid {
    grid-template-columns: 1fr;
  }

  .blog-post-sidebar-inner {
    position: static;
  }

  .blog-post-hero-image {
    max-width: 260px;
  }
}

/* Single post TOC: match KB Articles TOC look (2-level hierarchy) --- */

/* Default TOC link text */
.blog-post-sidebar .toc-scroll-content a {
  color: var(--colors--grey, #7B7B7B);
  text-decoration: none;
}

  /* TOC active item: ensure blue text + no background */
  .blog-post-sidebar .toc-scroll-content a.active,
  .blog-post-sidebar .toc-scroll-content a.is-active,
  .blog-post-sidebar .toc-scroll-content li.active > a,
  .blog-post-sidebar .toc-scroll-content a[aria-current="true"],
  .blog-post-sidebar .toc-scroll-content a[aria-current="page"],
  .blog-post-sidebar .toc-scroll-content a[aria-current="location"] {
    color: var(--colors--blue, #3388FF) !important;
    font-weight: 400;
    background: transparent !important;
  }

/* Remove bullets from TOC lists */
.blog-post-sidebar .toc-scroll-content ul,
.blog-post-sidebar .toc-scroll-content ol {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

  /* 2nd-level subsections indentation + slightly smaller text */
  .blog-post-sidebar .toc-scroll-content ul ul,
  .blog-post-sidebar .toc-scroll-content ol ol,
  .blog-post-sidebar .toc-scroll-content ul ol,
  .blog-post-sidebar .toc-scroll-content ol ul {
    padding-left: 0.75rem;
    margin-top: 0.5rem;
  }

.blog-post-sidebar .toc-scroll-content > ul > li > a,
.blog-post-sidebar .toc-scroll-content > ol > li > a {
  font-size: 1.125rem;
}

.blog-post-sidebar .toc-scroll-content ul ul a,
.blog-post-sidebar .toc-scroll-content ol ol a,
.blog-post-sidebar .toc-scroll-content ul ol a,
.blog-post-sidebar .toc-scroll-content ol ul a {
  font-size: 0.95rem;
}

/* --- Blog post TOC panel (match KB sticky panel behavior) --- */
.blog-post-sidebar {
  position: sticky;
  top: 6rem;
  align-self: start;
}

@media screen and (max-width: 991px) {
  .blog-post-sidebar {
    position: static;
    top: auto;
  }
}

.blog-toc-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 6rem);
}

.blog-toc-header {
  padding: 0;
  border-bottom: 1px solid #ECECEC;
  flex: 0 0 auto;
}

.blog-toc-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 1rem;
  flex: 1 1 auto;
  /* Hide scrollbars while keeping scroll behavior */
  -ms-overflow-style: none; /* IE 10+ */
  scrollbar-width: none; /* Firefox */
}

  .blog-toc-body::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

.product-card.blog-featured-card {
  background-color: #fff;
  border: 1px solid #ECECEC;
  border-radius: 16px;
  overflow: hidden;
}

  /* Featured blog card: top-left content + bottom-left Read more */
  .product-card.blog-featured-card .blog-featured-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

    .product-card.blog-featured-card .blog-featured-content .read-more-link {
      margin-top: auto;
      justify-content: flex-start;
    }

    /* Featured card meta/date: keep compact (avoid stretching/flexing) */
    .product-card.blog-featured-card .blog-featured-content .blog-card-meta {
      flex: 0 0 auto;
      width: auto;
    }

      .product-card.blog-featured-card .blog-featured-content .blog-card-meta,
      .product-card.blog-featured-card .blog-featured-content .blog-card-meta span {
        flex: 0 0 auto;
      }

        .product-card.blog-featured-card .blog-featured-content .blog-card-meta img {
          flex: 0 0 auto;
        }

  /* Featured blog card: round the right-side image */
  .product-card.blog-featured-card .blog-featured-image {
    border-radius: 16px;
  }

.blog-post-hero-image-wrap {
  width: 100%;
}

.blog-post-hero-image {
  max-width: 50%;
}

@media screen and (max-width: 991px) {
  .blog-post-hero-image {
    max-width: 260px;
  }
}

/* ============================================
   Blog Post Body - Markdown Content Spacing
   Only applies to parsed markdown content (#entry)
   ============================================ */
#entry p {
  margin-bottom: 1rem;
}

#entry h1,
#entry h2,
#entry h3,
#entry h4,
#entry h5,
#entry h6 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

/* Remove top margin from first heading if it's the first child */
#entry > h1:first-child,
#entry > h2:first-child,
#entry > h3:first-child,
#entry > h4:first-child,
#entry > h5:first-child,
#entry > h6:first-child {
  margin-top: 0;
}

/* Remove bottom margin from last paragraph */
#entry > p:last-child {
  margin-bottom: 0;
}
