.blog-page-main {
  --blog-header-height: 78px;
  --blog-title-gap: 36px;
  --blog-post-inset: 54px;
  position: relative;
  min-width: 0;
  padding-top: var(--blog-header-height);
  background: #fff;
  color: #17231b;
  font-family: Manrope, Arial, sans-serif;
}

.blog-content,
.blog-post {
  width: 100%;
  max-width: 1512px;
  min-width: 0;
  margin: 0 auto;
  padding: 24px clamp(20px, 6vw, 104px) clamp(48px, 6vw, 88px);
}

.blog-heading {
  margin-bottom: var(--blog-title-gap);
  text-align: center;
}

.blog-content {
  padding-top: var(--blog-title-gap);
}

.blog-post {
  max-width: none;
  padding-top: var(--blog-post-inset);
  padding-right: 0;
  padding-left: 0;
}

.blog-material {
  position: relative;
  min-width: 0;
}

.blog-material-copy,
.blog-post-related {
  width: 100%;
  max-width: 1512px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 clamp(20px, 6vw, 104px);
}

.blog-back-rail {
  position: absolute;
  inset: 0 auto 0 clamp(24px, 5vw, 76px);
  width: 174px;
}

.blog-heading h1,
.blog-post h1 {
  margin: 0;
  color: #147024;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.blog-heading h1 {
  font-size: 40px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 24px;
}

.blog-card,
.blog-card-link {
  min-width: 0;
}

.blog-card-link {
  display: flex;
  height: 100%;
  flex-direction: column;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
}

.blog-card-cover {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 16px;
  background: #f0f5ed;
}

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

.blog-card-title {
  margin: 16px 0 0;
  color: #17231b;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.blog-card-excerpt {
  margin: 12px 0 20px;
  color: #607064;
  font-size: 15px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.blog-card-read {
  display: inline-flex;
  min-height: 44px;
  max-width: 100%;
  align-self: flex-start;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: auto;
  padding: 10px 18px;
  border-radius: 12px;
  color: #fff;
  background: #147024;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.blog-card-read .arrow-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.blog-card-link:hover .blog-card-title {
  color: #147024;
}

.blog-card-link:hover .blog-card-read {
  background: #0b5018;
}

.blog-card-link:focus-visible,
.blog-pagination a:focus-visible,
.blog-back:focus-visible,
.blog-button:focus-visible {
  outline: 2px solid #147024;
  outline-offset: 5px;
}

.blog-empty {
  max-width: 680px;
  margin: 20px auto 0;
  color: #607064;
  font-size: 17px;
  line-height: 1.6;
  text-align: center;
  overflow-wrap: anywhere;
}

.blog-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 24px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #e0e7df;
  font-size: 14px;
}

.blog-pagination a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  color: #147024;
  text-decoration: none;
}

.blog-pagination > span {
  color: #68766c;
}

/* Match the visible header .main-nav pill, not its smaller inner button. */
.blog-back {
  position: sticky;
  z-index: 1;
  top: calc(var(--blog-header-height) + 8px);
  display: inline-flex;
  box-sizing: border-box;
  width: 174px;
  height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 21px;
  border: 1px solid #147024;
  border-radius: 34px;
  color: #fff;
  background: #147024;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-decoration: none;
}

.blog-back .arrow-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.blog-back:hover {
  background: #0b5018;
}

/* Keep this page-only control out of every shared overlay without changing them. */
body:has(.overlay.active) .blog-back,
body:has(.category-modal.open) .blog-back,
body:has(.side-drawer.open) .blog-back,
body:has(.burger-menu.open) .blog-back,
body:has(.search-panel.open) .blog-back,
body:has(.header-search-dialog[open]) .blog-back {
  visibility: hidden;
  pointer-events: none;
}

.blog-material-copy :is([id], a, button, [tabindex]) {
  scroll-margin-top: calc(var(--blog-header-height) + 70px);
}

.blog-post-heading {
  max-width: 760px;
  margin: 0 auto;
}

.blog-post-body {
  max-width: 760px;
  margin: 24px auto 0;
  font-size: 17px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.blog-post-body p {
  margin: 0 0 20px;
  font-size: 17px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.blog-post-body h2,
.blog-post-body h3,
.blog-post-body h4,
.blog-post-body h5,
.blog-post-body h6 {
  margin: 28px 0 16px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
}

.blog-post-body ul,
.blog-post-body ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.blog-post-body li {
  margin: 8px 0;
  white-space: pre-wrap;
}

.blog-post-body li > ul,
.blog-post-body li > ol {
  margin-top: 8px;
  margin-bottom: 0;
}

.blog-post-actions {
  display: flex;
  max-width: 760px;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px auto 0;
  padding-top: 24px;
  border-top: 1px solid #e0e7df;
}

.blog-button {
  display: inline-flex;
  min-height: 48px;
  max-width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  border: 1px solid #147024;
  border-radius: 12px;
  background: #147024;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
}

.blog-button span {
  min-width: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.blog-button:hover {
  background: #0b5018;
}

.blog-related {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid #e0e7df;
}

.blog-related > h2 {
  margin: 0 0 24px;
  color: #147024;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

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

@media (max-width: 1280px) {
  .blog-back-rail {
    position: sticky;
    z-index: 2;
    inset: auto;
    top: calc(var(--blog-header-height) + 8px);
    width: 100%;
    height: 46px;
    margin-bottom: 24px;
    padding-left: clamp(24px, 5vw, 76px);
    background: #fff;
  }

  .blog-back {
    position: static;
  }
}

@media (max-width: 850px) {
  .blog-page-main {
    --blog-header-height: 108px;
    --blog-post-inset: 24px;
  }
}

@media (max-width: 600px) {
  .blog-page-main {
    --blog-title-gap: 28px;
  }

  .blog-heading h1 {
    font-size: 32px;
  }

  .blog-post h1 {
    font-size: 26px;
  }

  .blog-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .blog-pagination {
    gap: 12px 16px;
  }

  .blog-back {
    width: clamp(110px, 34vw, 145px);
    padding: 0 15px;
    font-size: 10px;
  }

  .blog-button {
    width: 100%;
  }

  .blog-related > h2 {
    font-size: 22px;
  }
}
