/* style/blog.css */
/* body 已 padding-top: var(--header-offset)；页面禁止再写该变量 */

/* Base styles for the blog page, ensuring light text on a dark body background */
.page-blog {
  color: #ffffff; /* Light text for dark body background */
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: transparent; /* Assuming body background is handled by shared.css */
}

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

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

.page-blog__section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: #26A9E0; /* Brand color for titles */
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-blog__section-intro {
  font-size: 18px;
  color: #f0f0f0; /* Slightly off-white for contrast on dark background */
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column; /* Ensure image is above text */
  align-items: center;
  padding: 10px 0 60px 0; /* Small top padding, body handles header offset */
  background-color: #0d0d0d; /* A dark background for this section */
}

.page-blog__hero-image {
  width: 100%;
  max-width: 1920px;
  height: auto;
  display: block;
  object-fit: cover;
  margin-bottom: 30px; /* Space between image and content */
}

.page-blog__hero-content {
  text-align: center;
  max-width: 900px;
  padding: 0 20px;
}

.page-blog__main-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  color: #26A9E0;
  margin-bottom: 15px;
  line-height: 1.1;
}

.page-blog__hero-description {
  font-size: 20px;
  color: #f8f8f8;
  margin-bottom: 30px;
}

/* Latest Articles Section */
.page-blog__latest-articles {
  background-color: #1a1a1a; /* Dark background for this section */
}

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

.page-blog__article-card {
  background-color: rgba(255, 255, 255, 0.05); /* Slightly transparent white on dark background */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: #ffffff; /* Light text for card content */
}

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

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

.page-blog__card-image {
  width: 100%;
  height: 225px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
}

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

.page-blog__card-date {
  display: block;
  font-size: 14px;
  color: #999999;
  margin-bottom: 10px;
}

.page-blog__card-title {
  font-size: 22px;
  font-weight: 600;
  color: #26A9E0; /* Brand color for card titles */
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__card-description {
  font-size: 16px;
  color: #f0f0f0;
}

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

/* Categories Section */
.page-blog__categories-section {
  background-color: #26A9E0; /* Brand color background */
  color: #ffffff; /* White text for brand color background */
}

.page-blog__categories-section .page-blog__section-title {
  color: #ffffff; /* White title on brand color background */
}

.page-blog__categories-section .page-blog__section-intro {
  color: #f0f0f0;
}

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

.page-blog__category-item {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 25px;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.page-blog__category-item:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
}

.page-blog__category-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #ffffff;
}

.page-blog__category-description {
  font-size: 15px;
  color: #f0f0f0;
}

/* Featured Guides Section */
.page-blog__featured-guides {
  background-color: #0d0d0d; /* Dark background */
}

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

.page-blog__guide-card {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: #ffffff;
}

.page-blog__guide-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-blog__guide-card .page-blog__card-image {
  height: 225px; /* Fixed height for consistency */
}

.page-blog__guide-card .page-blog__card-content {
  padding: 20px;
}

.page-blog__guide-card .page-blog__card-title {
  color: #26A9E0;
}

.page-blog__guide-card .page-blog__card-description {
  color: #f0f0f0;
  margin-bottom: 20px;
}

.page-blog__read-more-btn {
  display: inline-block;
  background-color: #26A9E0;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.page-blog__read-more-btn:hover {
  background-color: #1a8cc7;
}

/* Call to Action Section */
.page-blog__cta-section {
  background-color: #26A9E0;
  padding: 80px 20px;
  text-align: center;
  color: #ffffff;
}

.page-blog__cta-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  margin-bottom: 20px;
  color: #ffffff;
}

.page-blog__cta-description {
  font-size: 18px;
  max-width: 800px;
  margin: 0 auto 30px;
  color: #f0f0f0;
}

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

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  box-sizing: border-box; /* Ensure padding is included in width */
  max-width: 100%; /* For responsive buttons */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Break long words */
}

.page-blog__btn-primary {
  background-color: #EA7C07; /* Login color for primary action */
  color: #ffffff;
  border: 2px solid #EA7C07;
}

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

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

.page-blog__btn-secondary:hover {
  background-color: #ffffff;
  color: #26A9E0;
}

/* FAQ Section */
.page-blog__faq-section {
  background-color: #1a1a1a; /* Dark background */
}

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

.page-blog__faq-item {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  color: #ffffff;
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  font-size: 18px;
  font-weight: 600;
  color: #26A9E0;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  list-style: none; /* For details/summary */
}

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

.page-blog__faq-item[open] .page-blog__faq-question {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.page-blog__faq-qtext {
  flex-grow: 1;
}

.page-blog__faq-toggle {
  font-size: 24px;
  line-height: 1;
  margin-left: 15px;
  transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  transform: rotate(45deg); /* Rotate for 'x' effect */
}

.page-blog__faq-answer {
  padding: 0 20px 20px;
  font-size: 16px;
  color: #f0f0f0;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .page-blog {
    font-size: 16px;
    line-height: 1.6;
  }

  .page-blog__container {
    padding: 0 15px; /* Smaller padding for mobile */
  }

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

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

  .page-blog__section-intro {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .page-blog__hero-section {
    padding-top: 10px !important; /* Small top padding for mobile */
    padding-bottom: 40px;
  }

  .page-blog__main-title {
    font-size: 36px;
  }

  .page-blog__hero-description {
    font-size: 18px;
  }

  /* Images responsive */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* Card and container responsive */
  .page-blog__section,
  .page-blog__container,
  .page-blog__article-card,
  .page-blog__guide-card,
  .page-blog__category-item,
  .page-blog__faq-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px; /* Add padding to prevent content touching edges */
    padding-right: 15px; /* Add padding to prevent content touching edges */
  }

  .page-blog__article-card {
    padding-left: 0;
    padding-right: 0;
  }
  .page-blog__article-card .page-blog__card-content,
  .page-blog__guide-card .page-blog__card-content {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Buttons responsive */
  .page-blog__cta-buttons {
    flex-direction: column !important; /* Stack buttons vertically on mobile */
    gap: 15px !important;
  }

  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-blog__cta-section {
    padding: 60px 15px;
  }

  .page-blog__cta-title {
    font-size: 30px;
  }

  .page-blog__faq-question {
    font-size: 16px;
    padding: 15px;
  }

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