/* style/blog.css */

/* Base styles for the blog page */
.page-blog {
  font-family: 'Arial', sans-serif;
  background-color: #08160F; /* Custom background color */
  color: #F2FFF6; /* Main text color for dark background */
  line-height: 1.6;
  padding-top: 0; /* body already handles padding-top */
}

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

.page-blog__section-title {
  font-size: 2.5em;
  color: #F2FFF6;
  text-align: center;
  margin-bottom: 15px;
  font-weight: bold;
}

.page-blog__section-subtitle {
  font-size: 1.1em;
  color: #A7D9B8; /* Secondary text color */
  text-align: center;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-blog__text-block {
  margin-bottom: 1em;
  color: #F2FFF6;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 500px;
  overflow: hidden;
  padding-top: 10px; /* Small top padding, body handles header offset */
  background-color: #0A4B2C; /* Deep Green for hero section background */
}

.page-blog__hero-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.page-blog__hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2; /* Darken the image for text readability */
}

.page-blog__hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  padding: 40px 20px;
  background: rgba(0, 0, 0, 0.5); /* Semi-transparent overlay for text */
  border-radius: 10px;
}

.page-blog__main-title {
  color: #F2FFF6;
  font-size: clamp(2em, 4vw, 3.5em); /* Responsive H1 font size */
  margin-bottom: 20px;
  font-weight: bold;
  line-height: 1.2;
}

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

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

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

.page-blog__post-card {
  background-color: #11271B; /* Card BG 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;
}

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

.page-blog__post-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.page-blog__post-content {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.page-blog__post-title {
  font-size: 1.5em;
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__post-title a {
  color: #F2FFF6;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-blog__post-title a:hover {
  color: #22C768; /* Auxiliary color on hover */
}

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

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

.page-blog__read-more-btn {
  display: inline-block;
  background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%); /* Button gradient */
  color: #F2FFF6;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: opacity 0.3s ease;
  text-align: center;
}

.page-blog__read-more-btn:hover {
  opacity: 0.9;
}

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

.page-blog__view-all-btn {
  display: inline-block;
  background: transparent;
  border: 2px solid #22C768; /* Auxiliary color border */
  color: #22C768;
  padding: 12px 30px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.page-blog__view-all-btn:hover {
  background-color: #22C768;
  color: #F2FFF6;
}

/* Categories Section */
.page-blog__categories-section {
  padding: 60px 0;
  background-color: #11271B; /* Card BG color for this section */
}

.page-blog__category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.page-blog__category-card {
  background-color: #0A4B2C; /* Deep Green */
  border-radius: 8px;
  padding: 25px;
  text-align: center;
  text-decoration: none;
  color: #F2FFF6;
  transition: background-color 0.3s ease, transform 0.3s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.page-blog__category-card:hover {
  background-color: #13994A; /* Darker main color */
  transform: translateY(-3px);
}

.page-blog__category-title {
  font-size: 1.3em;
  margin-bottom: 10px;
  color: #F2FFF6;
}

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

/* Featured Article Section */
.page-blog__featured-article-section {
  padding: 80px 0;
  background-color: #08160F;
}

.page-blog__featured-article-wrapper {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.page-blog__featured-article-content {
  flex: 1;
  min-width: 300px;
}

.page-blog__featured-article-image-wrapper {
  flex: 1;
  min-width: 300px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.page-blog__featured-article-image {
  width: 100%;
  height: auto;
  display: block;
}

/* FAQ Section */
.page-blog__faq-section {
  padding: 60px 0;
  background-color: #11271B; /* Card BG color for this section */
}

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

.page-blog__faq-item {
  background-color: #0A4B2C; /* Deep Green */
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  color: #F2FFF6;
}

.page-blog__faq-item summary {
  list-style: none; /* Hide default marker */
  cursor: pointer;
  padding: 20px 25px;
  font-size: 1.2em;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #F2FFF6;
  position: relative;
  user-select: none;
}

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

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  color: #22C768; /* Auxiliary color */
  transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  transform: rotate(45deg);
}

.page-blog__faq-answer {
  padding: 0 25px 20px 25px;
  font-size: 1em;
  color: #A7D9B8;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.page-blog__faq-item[open] .page-blog__faq-answer {
  max-height: 500px; /* Adjust as needed for content height */
  transition: max-height 0.5s ease-in;
}

.page-blog__faq-answer p {
  margin-bottom: 0;
}

/* CTA Section */
.page-blog__cta-section {
  padding: 80px 0;
  background-color: #0A4B2C; /* Deep Green */
  text-align: center;
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 15px 35px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
  max-width: 100%; /* Ensure responsiveness */
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
}

.page-blog__btn-primary {
  background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%); /* Button gradient */
  color: #F2FFF6;
  border: none;
  box-shadow: 0 4px 15px rgba(42, 209, 111, 0.4); /* Glow effect */
}

.page-blog__btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(42, 209, 111, 0.6);
}

.page-blog__btn-secondary {
  background-color: transparent;
  color: #2AD16F; /* Main color for text */
  border: 2px solid #2AD16F; /* Main color for border */
}

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

/* More About WY88 Section */
.page-blog__more-about-wy88 {
    padding: 80px 0;
    background-color: #08160F;
}

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

.page-blog__content-block {
    background-color: #11271B; /* Card BG color */
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.page-blog__content-block-title {
    font-size: 1.8em;
    color: #F2FFF6;
    margin-bottom: 15px;
    font-weight: bold;
}


/* Responsive styles */
@media (max-width: 1024px) {
  .page-blog__hero-content {
    padding: 30px 15px;
  }

  .page-blog__main-title {
    font-size: clamp(1.8em, 5vw, 3em);
  }

  .page-blog__hero-description {
    font-size: 1.1em;
  }

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

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

  .page-blog__featured-article-wrapper {
    flex-direction: column;
  }

  .page-blog__featured-article-content,
  .page-blog__featured-article-image-wrapper {
    min-width: unset;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .page-blog__hero-section {
    min-height: 400px;
    padding: 10px 0; /* Small top padding for mobile */
  }

  .page-blog__hero-content {
    padding: 25px 15px;
  }

  .page-blog__main-title {
    font-size: clamp(1.5em, 6vw, 2.5em);
  }

  .page-blog__hero-description {
    font-size: 1em;
  }

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

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

  .page-blog__latest-posts-section,
  .page-blog__categories-section,
  .page-blog__featured-article-section,
  .page-blog__faq-section,
  .page-blog__cta-section,
  .page-blog__more-about-wy88 {
    padding: 50px 0;
  }

  .page-blog__post-grid,
  .page-blog__category-grid {
    grid-template-columns: 1fr; /* Single column for mobile */
  }

  .page-blog__post-title {
    font-size: 1.3em;
  }

  .page-blog__post-excerpt {
    font-size: 0.9em;
  }

  .page-blog__read-more-btn,
  .page-blog__view-all-btn {
    width: 100%;
    padding: 12px 15px;
  }

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

  .page-blog__cta-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    width: 100% !important; /* Force full width on mobile */
    max-width: 100% !important;
    padding: 15px 15px;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block;
  }
  
  .page-blog__section,
  .page-blog__card,
  .page-blog__container,
  .page-blog__featured-article-wrapper,
  .page-blog__content-grid,
  .page-blog__faq-list,
  .page-blog__cta-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden; /* Prevent horizontal scroll */
  }

  .page-blog__video-section {
    padding-top: 10px !important; /* body 已承担 --header-offset，此处禁止 var(--header-offset) */
  }
}

@media (max-width: 480px) {
  .page-blog__hero-content {
    padding: 20px 10px;
  }

  .page-blog__main-title {
    font-size: clamp(1.3em, 7vw, 2em);
  }

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

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

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

/* Ensure all images are responsive */
.page-blog img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Contrast safety for specific elements if needed */
.page-blog__dark-bg {
  color: #ffffff; /* Deep Green for hero section background */
  background: #11A84E; /* Using brand color, ensure contrast */
}

.page-blog__light-bg {
  color: #333333; /* For light backgrounds */
  background: #ffffff;
}

.page-blog__medium-bg {
  color: #000000; /* Default for medium backgrounds */
  background: #22C768;
}

.page-blog__contrast-fix {
  background: #ffffff !important;
  color: #333333 !important;
  border: 1px solid #e0e0e0 !important;
}

.page-blog__text-contrast-fix {
  color: #333333 !important;
  text-shadow: none !important;
}