/* Base styles for page-blog */
.page-blog {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333333; /* Default deep gray text for light background */
  background-color: #ffffff; /* Default white background */
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  padding-top: 10px; /* Small top padding, relies on body padding-top for header offset */
  padding-bottom: 40px;
  text-align: center;
  background-color: #f8f8f8;
}

.page-blog__hero-image {
  position: relative;
  width: 100%;
  max-height: 500px; /* Limit hero image height */
  overflow: hidden;
}

.page-blog__hero-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.page-blog__hero-content {
  max-width: 900px;
  margin: 20px auto 0;
  padding: 0 15px;
}

.page-blog__main-title {
  font-size: 2.8em;
  font-weight: 700;
  color: #017439; /* Brand primary color */
  margin-bottom: 15px;
  line-height: 1.2;
}

.page-blog__hero-description {
  font-size: 1.1em;
  color: #555555;
  margin-bottom: 30px;
}

/* General Section Styles */
.page-blog__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.page-blog__section-title {
  font-size: 2.2em;
  font-weight: 700;
  color: #017439;
  text-align: center;
  margin-bottom: 20px;
  padding-top: 40px;
}

.page-blog__section-title--light {
  color: #ffffff;
}

.page-blog__section-subtitle {
  font-size: 1.1em;
  color: #666666;
  text-align: center;
  margin-bottom: 40px;
}

/* Latest Articles Section */
.page-blog__latest-articles-section {
  padding: 60px 0;
  background-color: #f0f0f0;
}

.page-blog__articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.page-blog__article-card {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-blog__article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.page-blog__article-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.page-blog__article-image-wrapper {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.page-blog__article-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-blog__article-content {
  padding: 20px;
}

.page-blog__article-title {
  font-size: 1.4em;
  font-weight: 600;
  color: #017439;
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__article-meta {
  font-size: 0.9em;
  color: #777777;
  margin-bottom: 15px;
}

.page-blog__article-excerpt {
  font-size: 1em;
  color: #555555;
  margin-bottom: 20px;
}

.page-blog__read-more {
  color: #017439;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: color 0.3s ease;
}

.page-blog__read-more:hover {
  color: #005a2e;
}

.page-blog__view-all-button-wrapper {
  text-align: center;
  margin-top: 30px;
}

/* Content Section */
.page-blog__content-section {
  padding: 60px 0;
  background-color: #ffffff;
}

.page-blog__dark-section {
  background-color: #017439; /* Brand primary color as background */
  color: #ffffff; /* White text for dark background */
}

.page-blog__dark-section .page-blog__text-block,
.page-blog__dark-section .page-blog__list-item,
.page-blog__dark-section .page-blog__figcaption {
  color: #ffffff;
}

.page-blog__dark-section .page-blog__category-card a {
  color: #ffffff;
}

.page-blog__dark-section .page-blog__category-card {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-blog__text-block {
  font-size: 1.1em;
  margin-bottom: 25px;
  line-height: 1.7;
}

.page-blog__figure {
  margin: 40px auto;
  text-align: center;
  max-width: 1000px;
}

.page-blog__figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.page-blog__figcaption {
  font-size: 0.95em;
  color: #777777;
  margin-top: 10px;
}

.page-blog__sub-title {
  font-size: 1.8em;
  font-weight: 600;
  color: #017439;
  margin-top: 40px;
  margin-bottom: 20px;
}

.page-blog__sub-title--light {
  color: #ffffff;
}

.page-blog__list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 25px;
}

.page-blog__list-item {
  font-size: 1.1em;
  margin-bottom: 15px;
  position: relative;
  padding-left: 30px;
}

.page-blog__list-item::before {
  content: '✔';
  color: #017439;
  font-weight: bold;
  position: absolute;
  left: 0;
  top: 0;
}

.page-blog__dark-section .page-blog__list-item::before {
  color: #FFFF00; /* Yellow for checkmark on dark background */
}

/* Categories Grid */
.page-blog__categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 30px;
  margin-bottom: 40px;
}

.page-blog__category-card {
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 25px;
  text-align: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.page-blog__category-card:hover {
  background-color: #e6f7ed;
  border-color: #017439;
}

.page-blog__category-card .page-blog__category-title {
  font-size: 1.3em;
  font-weight: 600;
  margin-bottom: 10px;
}

.page-blog__category-card .page-blog__category-title a {
  color: #017439;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-blog__category-card .page-blog__category-title a:hover {
  color: #005a2e;
}

.page-blog__category-description {
  font-size: 0.95em;
  color: #666666;
}

/* CTA Section */
.page-blog__cta-section {
  position: relative;
  padding: 80px 0;
  text-align: center;
  overflow: hidden;
}

.page-blog__cta-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.page-blog__cta-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4); /* Darken image for text contrast */
}

.page-blog__cta-content {
  position: relative;
  z-index: 1;
  color: #ffffff;
}

.page-blog__cta-description {
  font-size: 1.2em;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

/* Buttons */
.page-blog__cta-button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  max-width: 100%; /* Ensure button adapts */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__btn-primary {
  background-color: #C30808; /* Register color */
  color: #ffffff;
  border: 2px solid #C30808;
}

.page-blog__btn-primary:hover {
  background-color: #a30606;
  border-color: #a30606;
}

.page-blog__btn-secondary {
  background-color: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.page-blog__btn-secondary:hover {
  background-color: #ffffff;
  color: #C30808; /* Register color */
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-blog__main-title {
    font-size: 2.4em;
  }

  .page-blog__section-title {
    font-size: 2em;
  }

  .page-blog__articles-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  /* HERO 主图区域 */
  .page-blog__hero-section {
    padding-top: 10px; /* Relies on body padding-top */
    padding-bottom: 30px;
  }

  .page-blog__hero-image {
    max-height: 300px;
  }

  .page-blog__main-title {
    font-size: 2em;
    margin-bottom: 10px;
  }

  .page-blog__hero-description {
    font-size: 1em;
    margin-bottom: 20px;
  }

  /* 长文区 */
  .page-blog__content-section {
    padding: 40px 0;
  }

  .page-blog__section-title {
    font-size: 1.8em;
    padding-top: 30px;
    margin-bottom: 15px;
  }

  .page-blog__section-subtitle {
    font-size: 1em;
    margin-bottom: 30px;
  }

  .page-blog__text-block,
  .page-blog__list-item {
    font-size: 1em;
  }

  .page-blog__sub-title {
    font-size: 1.5em;
    margin-top: 30px;
    margin-bottom: 15px;
  }

  /* 博客区 (Articles Grid) */
  .page-blog__articles-grid {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 20px;
  }

  .page-blog__article-image-wrapper {
    height: 180px;
  }

  .page-blog__article-title {
    font-size: 1.2em;
  }

  .page-blog__categories-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  /* 通用图片与容器 */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-blog__section,
  .page-blog__card,
  .page-blog__container,
  .page-blog__hero-content,
  .page-blog__cta-content {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* 按钮与按钮容器 */
  .page-blog__cta-button,
  .page-blog__btn-primary,
  .page-blog__btn-secondary,
  .page-blog a[class*="button"],
  .page-blog a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-blog__cta-buttons,
  .page-blog__button-group,
  .page-blog__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important; /* Allow buttons to wrap */
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px; /* Spacing between stacked buttons */
  }

  .page-blog__cta-section {
    padding: 50px 0;
  }

  .page-blog__cta-description {
    font-size: 1em;
    margin-bottom: 30px;
  }
}