/* Base styles for the Blog page */
.page-blog {
  font-family: 'Arial', sans-serif;
  color: #1F2D3D; /* Text Main */
  background-color: #F4F7FB; /* Background */
  line-height: 1.6;
}

.page-blog__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-blog__section {
  padding: 60px 0;
}

.page-blog__section-title {
  font-size: 36px;
  font-weight: 700;
  color: #1F2D3D; /* Text Main */
  text-align: center;
  margin-bottom: 40px;
}

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

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  max-width: 100%; /* Important for responsive */
  box-sizing: border-box; /* Important for responsive */
  white-space: normal; /* Important for responsive */
  word-wrap: break-word; /* Important for responsive */
}

.page-blog__btn-primary {
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%); /* Button */
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(47, 107, 255, 0.3);
}

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

.page-blog__btn-secondary {
  background: #FFFFFF; /* Card BG */
  color: #2F6BFF; /* Primary */
  border: 2px solid #2F6BFF;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.page-blog__btn-secondary:hover {
  background: #2F6BFF;
  color: #FFFFFF;
  box-shadow: 0 6px 20px rgba(47, 107, 255, 0.4);
}

/* Hero Section */
.page-blog__hero-section {
  padding-top: 10px; /* Small top padding, assuming body handles --header-offset */
  position: relative;
  display: flex;
  flex-direction: column; /* Image above content */
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 500px;
  overflow: hidden;
  background-color: #F4F7FB; /* Background */
  padding-bottom: 60px; /* Add some space below content */
}

.page-blog__hero-image {
  width: 100%;
  max-height: 500px; /* Limit height for hero image */
  overflow: hidden;
  margin-bottom: 40px; /* Space between image and content */
}

.page-blog__hero-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  min-height: 300px; /* Ensure image is not too small */
}

.page-blog__hero-content {
  position: relative;
  z-index: 10;
  max-width: 800px;
  padding: 40px 20px;
  background-color: #FFFFFF; /* Card BG */
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-top: 0; /* No negative margin to overlap */
}

.page-blog__main-title {
  font-size: 48px;
  color: #2F6BFF; /* Primary */
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-blog__description {
  font-size: 20px;
  color: #1F2D3D; /* Text Main */
  margin-bottom: 30px;
}

/* Latest Articles Section */
.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: #FFFFFF; /* Card BG */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-blog__card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.page-blog__article-image-wrapper {
  width: 100%;
  height: 200px; /* Fixed height for consistent card images */
  overflow: hidden;
}

.page-blog__article-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  min-width: 200px; /* Min size for images */
  min-height: 200px; /* Min size for images */
}

.page-blog__article-card:hover .page-blog__article-image-wrapper img {
  transform: scale(1.05);
}

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

.page-blog__article-title {
  font-size: 22px;
  font-weight: 600;
  color: #2F6BFF; /* Primary */
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__article-excerpt {
  font-size: 16px;
  color: #1F2D3D; /* Text Main */
  margin-bottom: 15px;
}

.page-blog__article-date {
  font-size: 14px;
  color: #6FA3FF; /* Secondary */
  display: block;
  margin-bottom: 10px;
}

.page-blog__read-more-btn {
  font-size: 16px;
  font-weight: 600;
  color: #2F6BFF; /* Primary */
  text-decoration: none;
  display: inline-block;
  position: relative;
}

.page-blog__read-more-btn::after {
  content: '→';
  margin-left: 5px;
  transition: margin-left 0.3s ease;
}

.page-blog__read-more-btn:hover::after {
  margin-left: 10px;
}

.page-blog__view-all-wrapper {
  text-align: center;
}

/* Categories Section */
.page-blog__category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.page-blog__category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #FFFFFF; /* Card BG */
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: #1F2D3D; /* Text Main */
}

.page-blog__category-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.page-blog__category-item img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin-bottom: 15px;
}

.page-blog__category-name {
  font-size: 18px;
  font-weight: 600;
  color: #2F6BFF; /* Primary */
}

/* Deep Dive Section */
.page-blog__deep-dive-section {
  background: #2F6BFF; /* Primary */
  color: #FFFFFF;
}

.page-blog__deep-dive-section p,
.page-blog__deep-dive-section li {
  color: #FFFFFF;
}

.page-blog__content-block {
  max-width: 900px;
  margin: 0 auto;
}

.page-blog__sub-title {
  font-size: 28px;
  font-weight: 700;
  color: #6FA3FF; /* Secondary */
  margin-top: 40px;
  margin-bottom: 20px;
}

.page-blog__article-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 60px;
}

.page-blog__article-detail-grid--reverse {
  grid-template-columns: 1fr 1fr; /* Reset for desktop */
}

.page-blog__article-detail-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  min-width: 200px; /* Min size for images */
  min-height: 200px; /* Min size for images */
}

.page-blog__list {
  list-style: disc;
  margin-left: 20px;
  margin-bottom: 20px;
}

.page-blog__list li {
  margin-bottom: 10px;
}

/* CTA Section */
.page-blog__cta-section {
  text-align: center;
}

.page-blog__cta-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px;
  background: #FFFFFF; /* Card BG */
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.page-blog__cta-content .page-blog__section-title {
  margin-bottom: 20px;
  color: #2F6BFF; /* Primary */
}

.page-blog__cta-content .page-blog__description {
  margin-bottom: 30px;
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  width: 100%; /* Important for responsive */
  max-width: 100%; /* Important for responsive */
  box-sizing: border-box; /* Important for responsive */
  overflow: hidden; /* Important for responsive */
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-blog__main-title {
    font-size: 40px;
  }
  .page-blog__description {
    font-size: 18px;
  }
  .page-blog__hero-image {
    margin-bottom: 30px;
  }
  .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; /* Specific for mobile, not using var(--header-offset) */
    min-height: auto;
    flex-direction: column; /* Image above content */
    padding-bottom: 30px;
  }

  .page-blog__hero-image {
    max-height: 300px;
    margin-bottom: 20px;
  }
  
  .page-blog__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-height: 200px !important;
  }

  .page-blog__hero-content {
    margin-top: 0;
    padding: 30px 15px;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-blog__main-title {
    font-size: 32px;
    margin-bottom: 15px;
  }

  .page-blog__description {
    font-size: 16px;
    margin-bottom: 25px;
  }

  .page-blog__section {
    padding: 40px 0;
  }

  .page-blog__section-title {
    font-size: 28px;
    margin-bottom: 30px;
    padding: 0 15px; /* Add padding to title for better mobile readability */
  }

  .page-blog__container {
    padding: 0 15px; /* General container padding for mobile */
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  /* 通用图片与容器 */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block;
    min-width: 200px !important; /* Enforce minimum size on mobile */
    min-height: 200px !important; /* Enforce minimum size on mobile */
  }

  .page-blog__section,
  .page-blog__card,
  .page-blog__container,
  .page-blog__article-card,
  .page-blog__category-item,
  .page-blog__cta-content,
  .page-blog__content-block {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

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

  .page-blog__article-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-blog__article-image-wrapper {
    height: 180px; /* Adjust image height for mobile cards */
  }

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

  .page-blog__article-title {
    font-size: 20px;
  }

  /* Categories Section */
  .page-blog__category-list {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 15px;
  }

  .page-blog__category-item img {
    width: 200px !important;
    height: 200px !important;
    margin-bottom: 10px;
  }
  .page-blog__category-name {
    font-size: 16px;
  }

  /* 长文区 (Deep Dive) */
  .page-blog__deep-dive-section {
    padding: 30px 15px;
  }

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

  .page-blog__article-detail-grid {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 30px;
    margin-bottom: 40px;
  }

  .page-blog__article-detail-grid--reverse {
    grid-template-columns: 1fr; /* Single column for mobile */
  }

  .page-blog__list {
    margin-left: 15px;
  }

  /* 按钮与按钮容器 */
  .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-direction: column !important; /* Stack buttons vertically */
    gap: 15px;
  }
  .page-blog__cta-buttons {
    display: flex; /* Ensure flex context for column direction */
  }
}

@media (max-width: 480px) {
  .page-blog__main-title {
    font-size: 28px;
  }
  .page-blog__section-title {
    font-size: 24px;
  }
  .page-blog__hero-content {
    padding: 25px 10px;
  }
  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    font-size: 16px;
    padding: 12px 20px;
  }
}