/* General styles for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  color: #333333; /* Default text color for light backgrounds */
  background-color: #F5F7FA; /* Body background from custom colors */
  line-height: 1.6;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  overflow: hidden;
  padding-top: 10px; /* Small top padding as body should have header offset */
  background: #E53935; /* Brand primary color for dark section */
  color: #ffffff; /* White text on dark background */
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    margin-bottom: 20px;
}

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

.page-blog__hero-content {
  max-width: 900px;
  padding: 0 20px;
  z-index: 1;
}

.page-blog__main-title {
  font-size: clamp(2em, 4vw, 3.5em);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 15px;
  color: #ffffff;
}

.page-blog__description {
  font-size: 1.1em;
  margin-bottom: 30px;
  color: #f0f0f0;
}

/* Call to Action Buttons */
.page-blog__cta-button {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__btn-primary {
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
  color: #ffffff;
  border: none;
  margin-right: 15px;
}

.page-blog__btn-primary:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

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

.page-blog__btn-secondary:hover {
  transform: translateY(-2px);
  background: #f0f0f0;
}

/* Container for content sections */
.page-blog__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Section Titles */
.page-blog__section-title {
  font-size: 2.5em;
  font-weight: 700;
  color: #333333;
  text-align: center;
  margin-bottom: 40px;
}

/* Blog Post Grid */
.page-blog__post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
  align-items: stretch;
}

.page-blog__blog-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-blog__blog-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-blog__blog-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.page-blog__blog-card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

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

.page-blog__blog-card-meta {
  font-size: 0.9em;
  color: #666666;
  margin-bottom: 15px;
}

.page-blog__blog-card-excerpt {
  font-size: 1em;
  color: #555555;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-blog__btn-outline {
  display: inline-block;
  padding: 8px 15px;
  border: 1px solid #E53935;
  color: #E53935;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease;
  align-self: flex-start;
  margin-top: auto;
}

.page-blog__btn-outline:hover {
  background-color: #E53935;
  color: #ffffff;
}

/* Pagination / View all posts button */
.page-blog__pagination {
  text-align: center;
  margin-top: 30px;
}

.page-blog__pagination-link {
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
  color: #ffffff;
  padding: 12px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: opacity 0.3s ease;
}

.page-blog__pagination-link:hover {
  opacity: 0.9;
}

/* CTA Section at bottom */
.page-blog__cta-section {
  background: #E53935;
  color: #ffffff;
  text-align: center;
  padding: 60px 20px;
}

.page-blog__cta-title {
  font-size: 2.2em;
  font-weight: 700;
  margin-bottom: 20px;
  color: #ffffff;
}

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

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

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-blog__hero-image {
        max-height: 500px;
    }
    .page-blog__main-title {
        font-size: clamp(2em, 5vw, 3em);
    }
    .page-blog__description {
        font-size: 1em;
    }
    .page-blog__section-title {
        font-size: 2em;
    }
    .page-blog__post-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .page-blog__cta-title {
        font-size: 2em;
    }
    .page-blog__cta-description {
        font-size: 1em;
    }
}

@media (max-width: 768px) {
  /* HERO 主图区域 */
  .page-blog__hero-section {
    padding-top: 10px !important;
    padding-bottom: 30px;
  }
  .page-blog__hero-image-wrapper,
  .page-blog__hero-content {
      padding-left: 15px;
      padding-right: 15px;
  }
  .page-blog__hero-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    max-height: 350px;
  }
  .page-blog__main-title {
    font-size: clamp(1.8em, 7vw, 2.5em) !important;
  }
  .page-blog__description {
    font-size: 0.95em;
  }

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

  /* 博客卡片区 */
  .page-blog__post-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
  .page-blog__blog-card-image {
    height: 180px;
  }
  .page-blog__blog-card-title {
    font-size: 1.2em;
  }
  .page-blog__blog-card-excerpt {
    font-size: 0.9em;
  }
  .page-blog__btn-outline {
      width: 100%;
      text-align: center;
  }

  /* 按钮与按钮容器 */
  .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;
    gap: 15px;
    flex-direction: column !important;
  }
  .page-blog__cta-buttons .page-blog__cta-button {
      margin-right: 0 !important;
  }

  /* Section titles */
  .page-blog__section-title {
    font-size: 1.8em;
    margin-bottom: 30px;
  }
  .page-blog__cta-title {
    font-size: 1.8em;
  }
  .page-blog__cta-description {
    font-size: 0.95em;
  }
}