/* Base styles for the blog page, applying brand colors */
.page-blog {
  color: #FFF6D6; /* Main text color for dark background */
  background-color: var(--color-background, #0A0A0A); /* Inherit from shared or use default dark */
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

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

.page-blog__section-title {
  font-size: 2.5em;
  color: #F2C14E; /* Primary brand color for titles */
  text-align: center;
  margin-bottom: 40px;
  font-weight: bold;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  overflow: hidden;
  background-color: #0A0A0A; /* Ensure dark background */
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-height: 500px; /* Limit height of the image wrapper */
  overflow: hidden;
  margin-bottom: 40px;
}

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

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

.page-blog__hero-title {
  font-size: clamp(2em, 4vw, 3.5em); /* Responsive font size for H1 */
  color: #FFD36B; /* Auxiliary brand color for H1 */
  margin-bottom: 20px;
  font-weight: 700;
  line-height: 1.2;
}

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

/* Intro Section */
.page-blog__intro-section {
  padding: 60px 0;
  background-color: #0A0A0A;
}

.page-blog__text-block {
  margin-bottom: 20px;
  font-size: 1.05em;
  color: #FFF6D6;
}

/* Latest Posts Section */
.page-blog__latest-posts-section {
  padding: 60px 0;
  background-color: #0A0A0A;
}

.page-blog__blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  align-items: stretch; /* Ensure cards have equal height */
  margin-bottom: 40px;
}

.page-blog__blog-card {
  background-color: #111111; /* Card background color */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%; /* Ensure card takes full height */
}

.page-blog__blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

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

.page-blog__blog-card-image {
  width: 100%;
  height: 225px; /* Fixed height for consistent image size */
  object-fit: cover;
  display: block;
}

.page-blog__blog-card-content {
  padding: 20px;
  flex-grow: 1; /* Allows content to expand and push button down */
  display: flex;
  flex-direction: column;
}

.page-blog__blog-card-title {
  font-size: 1.4em;
  color: #FFD36B; /* Auxiliary brand color for card titles */
  margin-bottom: 10px;
  font-weight: bold;
}

.page-blog__blog-card-meta {
  font-size: 0.9em;
  color: #F2C14E; /* Primary brand color for meta info */
  margin-bottom: 15px;
}

.page-blog__blog-card-excerpt {
  font-size: 1em;
  color: #FFF6D6;
  margin-bottom: 20px;
  flex-grow: 1; /* Allow excerpt to take available space */
}

.page-blog__btn-outline {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid #F2C14E; /* Primary brand color for outline */
  color: #F2C14E;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-align: center;
  margin-top: auto; /* Pushes button to the bottom */
}

.page-blog__btn-outline:hover {
  background-color: #F2C14E;
  color: #111111; /* Dark text on hover */
}

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

/* Categories Section */
.page-blog__categories-section {
  padding: 60px 0;
  background-color: #0A0A0A;
}

.page-blog__categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.page-blog__category-card {
  background-color: #111111;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  text-align: center;
  padding: 20px;
  text-decoration: none;
  color: #FFF6D6;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.page-blog__category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.page-blog__category-image {
  width: 100%;
  max-width: 200px; /* Limit image width within card */
  height: auto;
  object-fit: contain;
  margin-bottom: 15px;
}

.page-blog__category-title {
  font-size: 1.2em;
  color: #FFD36B;
  font-weight: bold;
}

/* FAQ Section */
.page-blog__faq-section {
  padding: 60px 0;
  background-color: #0A0A0A;
}

.page-blog__faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.page-blog__faq-item {
  background-color: #111111;
  border: 1px solid #3A2A12; /* Border color */
  border-radius: 10px;
  margin-bottom: 15px;
  overflow: hidden;
  color: #FFF6D6;
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  font-size: 1.15em;
  font-weight: bold;
  color: #FFD36B;
  cursor: pointer;
  list-style: none; /* Hide default marker for details summary */
}

.page-blog__faq-question::-webkit-details-marker {
  display: none; /* Hide default marker for webkit browsers */
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  transform: rotate(45deg); /* Rotate '+' to 'x' or just change to '-' */
  content: '-'; /* This won't work directly in CSS for content of span */
}

.page-blog__faq-answer {
  padding: 0 25px 20px;
  font-size: 1em;
  color: #FFF6D6;
}

/* CTA Bottom Section */
.page-blog__cta-bottom-section {
  padding: 80px 0;
  background-color: #111111; /* Card BG color for this section */
  text-align: center;
}

.page-blog__cta-content {
  max-width: 800px;
}

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

.page-blog__cta-description {
  font-size: 1.1em;
  color: #FFF6D6;
  margin-bottom: 40px;
}

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

.page-blog__cta-button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  white-space: normal;
  word-wrap: break-word;
  box-sizing: border-box;
}

.page-blog__btn-primary {
  background: linear-gradient(180deg, #FFD86A 0%, #DDA11D 100%); /* Button gradient */
  color: #111111; /* Dark text for primary button */
  border: none;
}

.page-blog__btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(255, 216, 106, 0.4);
}

.page-blog__btn-secondary {
  background: transparent;
  color: #F2C14E; /* Primary brand color for secondary button text */
  border: 2px solid #F2C14E; /* Border color */
}

.page-blog__btn-secondary:hover {
  background-color: #F2C14E;
  color: #111111; /* Dark text on hover */
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(242, 193, 78, 0.4);
}

/* General image and button styles for responsiveness */
.page-blog img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-blog__container {
    padding: 20px 30px;
  }

  .page-blog__hero-section {
    padding: 60px 20px;
  }

  .page-blog__hero-title {
    font-size: 2.8em;
  }

  .page-blog__blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .page-blog__categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .page-blog__section-title {
    font-size: 2em;
    margin-bottom: 30px;
  }

  .page-blog__cta-title {
    font-size: 1.8em;
  }

  .page-blog__faq-question {
    font-size: 1.1em;
    padding: 15px 20px;
  }

  .page-blog__faq-answer {
    padding: 0 20px 15px;
  }
}

@media (max-width: 768px) {
  /* HERO 主图区域 */
  .page-blog__hero-section {
    padding-top: 10px; /* Small top padding for mobile */
    padding-bottom: 40px;
  }

  .page-blog__hero-image-wrapper {
    max-height: 300px;
    margin-bottom: 20px;
  }

  .page-blog__hero-title {
    font-size: 2em; /* Smaller H1 for mobile */
    margin-bottom: 15px;
  }

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

  /* 长文金框区 (Intro Section equivalent) */
  .page-blog__intro-section {
    padding: 40px 0;
  }

  .page-blog__text-block {
    font-size: 0.95em;
  }

  /* 博客卡片区 */
  .page-blog__blog-grid {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 20px;
  }

  .page-blog__blog-card-image {
    height: 180px;
  }

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

  .page-blog__btn-outline {
    padding: 8px 15px;
    font-size: 0.9em;
  }

  .page-blog__view-all {
    padding: 0 15px;
  }

  /* Categories Section */
  .page-blog__categories-grid {
    grid-template-columns: repeat(2, 1fr); /* Two columns for mobile categories */
    gap: 15px;
  }

  .page-blog__category-card {
    padding: 15px;
  }

  .page-blog__category-image {
    max-width: 150px;
  }

  .page-blog__category-title {
    font-size: 1.1em;
  }

  /* FAQ Section */
  .page-blog__faq-section {
    padding: 40px 0;
  }

  .page-blog__faq-question {
    font-size: 1em;
    padding: 15px 20px;
  }

  .page-blog__faq-answer {
    padding: 0 20px 15px;
  }

  /* CTA Bottom Section */
  .page-blog__cta-bottom-section {
    padding: 50px 0;
  }

  .page-blog__cta-title {
    font-size: 1.6em;
  }

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

  .page-blog__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    padding: 0 15px; /* Add padding to button container */
  }

  .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: 12px 20px !important; /* Adjust padding for mobile buttons */
    font-size: 1em !important;
  }

  /* 通用图片与容器 */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-blog__container,
  .page-blog__section,
  .page-blog__card,
  .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 !important;
    padding-right: 15px !important;
    overflow-x: hidden; /* Prevent horizontal scroll */
  }

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