/* style/blog.css */
/* body đã padding-top: var(--header-offset)；trang này không được viết lại biến đó */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Màu chữ mặc định cho nền sáng */
  background-color: #ffffff; /* Nền trắng mặc định */
}

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

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px; /* Small top padding, body handles header offset */
  padding-bottom: 60px;
  text-align: center;
  background-color: #f5f5f5;
  overflow: hidden; /* Ensure content doesn't overflow */
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-height: 675px; /* Limit height for hero image */
  overflow: hidden;
  margin-bottom: 30px;
}

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

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

.page-blog__main-title {
  font-size: clamp(2em, 4vw, 2.8em); /* Responsive font size for H1 */
  font-weight: 700;
  color: #017439;
  margin-bottom: 15px;
  line-height: 1.2;
}

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

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

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

.page-blog__btn-primary:hover {
  background-color: #005a2e;
  transform: translateY(-2px);
}

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

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

/* Sections */
.page-blog__latest-articles,
.page-blog__featured-categories,
.page-blog__about-platform,
.page-blog__faq-section,
.page-blog__cta-banner {
  padding: 60px 0;
}

.page-blog__dark-bg {
  background-color: #017439;
  color: #ffffff;
}

.page-blog__light-bg {
  background-color: #ffffff;
  color: #333333;
}

.page-blog__section-title {
  font-size: 2.2em;
  font-weight: 700;
  margin-bottom: 15px;
  text-align: center;
  color: inherit; /* Inherit color from parent section */
}

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

.page-blog__dark-bg .page-blog__section-subtitle {
  color: #e0e0e0;
}

/* Articles Grid */
.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-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

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

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

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

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

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

.page-blog__article-title a:hover {
  color: #005a2e;
}

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

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

.page-blog__read-more-btn {
  display: inline-block;
  color: #017439;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.page-blog__read-more-btn:hover {
  color: #005a2e;
  text-decoration: underline;
}

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

/* Categories Grid */
.page-blog__categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.page-blog__category-card {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  transition: transform 0.3s ease, background-color 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Align content to bottom */
  position: relative;
  min-height: 250px;
}

.page-blog__category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4); /* Dark overlay for text readability */
  z-index: 1; /* Above image, below text */
  transition: background 0.3s ease;
}

.page-blog__category-card:hover::before {
  background: rgba(0, 0, 0, 0.5); /* Slightly darker on hover */
}

.page-blog__category-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

.page-blog__category-card h3 {
  position: relative;
  z-index: 2;
  font-size: 1.3em;
  font-weight: 600;
  padding: 20px;
  background-color: transparent; /* No background needed if overlay is used */
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  color: #ffffff;
}

/* About Platform Section */
.page-blog__about-content {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.page-blog__about-text {
  flex: 1;
  min-width: 300px;
}

.page-blog__about-text p {
  margin-bottom: 20px;
  color: #555555;
}

.page-blog__about-image-wrapper {
  flex: 1;
  min-width: 300px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

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

.page-blog__faq-item {
  background-color: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.15em;
  font-weight: 600;
  color: #017439;
  cursor: pointer;
  background-color: #e8f5e9; /* Lighter green for question background */
  border-bottom: 1px solid #dcdcdc;
  list-style: none; /* For <summary> tag */
}

.page-blog__faq-question::-webkit-details-marker {
  display: none; /* For <summary> tag */
}

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

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

.page-blog__faq-item[open] .page-blog__faq-toggle {
  transform: rotate(45deg); /* Change + to X or - */
}

.page-blog__faq-answer {
  padding: 20px 25px;
  font-size: 1em;
  color: #555555;
  border-top: 1px solid #f0f0f0;
}

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

/* CTA Banner */
.page-blog__cta-banner {
  text-align: center;
  padding: 80px 20px;
}

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

.page-blog__banner-description {
  font-size: 1.2em;
  color: #e0e0e0;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__main-title {
    font-size: clamp(2em, 5vw, 2.5em);
  }
  .page-blog__section-title {
    font-size: 2em;
  }
  .page-blog__banner-title {
    font-size: 2.2em;
  }
}

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

  /* Global responsive for images, videos, buttons, containers */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-blog video,
  .page-blog__video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-blog__section,
  .page-blog__card,
  .page-blog__container,
  .page-blog__video-section,
  .page-blog__video-container,
  .page-blog__video-wrapper,
  .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;
    overflow: hidden !important; /* Ensure no overflow */
  }

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

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

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

  .page-blog__description {
    font-size: 1em;
  }

  .page-blog__cta-button {
    width: 100% !important;
    padding: 12px 20px;
  }

  .page-blog__articles-grid,
  .page-blog__categories-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-blog__article-content,
  .page-blog__category-card h3 {
    padding: 15px;
  }

  .page-blog__about-content {
    flex-direction: column;
    gap: 30px;
  }

  .page-blog__about-text,
  .page-blog__about-image-wrapper {
    min-width: unset;
    width: 100%;
  }

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

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

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

  .page-blog__banner-description {
    font-size: 1em;
  }
  
  .page-blog__cta-buttons {
    display: flex;
    flex-direction: column; /* Vertical stack for multiple buttons */
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .page-blog__main-title {
    font-size: clamp(1.6em, 7vw, 2em);
  }
  .page-blog__section-title {
    font-size: 1.8em;
  }
  .page-blog__banner-title {
    font-size: 1.6em;
  }
}