/* style/blog.css */

/* Base styles for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light backgrounds */
}

.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;
  justify-content: center;
  text-align: center;
  background-color: #FFFFFF; /* Light background */
  color: #333333; /* Dark text for light background */
  padding: 60px 0;
  padding-top: 10px; /* Small top padding, body handles header offset */
}

.page-blog__hero-image-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  margin-bottom: 30px;
}

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

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

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

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

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

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
  text-align: center;
}

.page-blog__btn-primary {
  background-color: #26A9E0;
  color: #FFFFFF;
  border: 2px solid #26A9E0;
}

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

.page-blog__btn-secondary {
  background-color: #FFFFFF;
  color: #26A9E0;
  border: 2px solid #26A9E0;
}

.page-blog__btn-secondary:hover {
  background-color: #f0f0f0;
}

/* --- General Sections --- */
.page-blog__section-title {
  font-size: 2.2em;
  font-weight: 700;
  color: #26A9E0;
  text-align: center;
  margin-bottom: 40px;
  margin-top: 60px;
}

.page-blog__text-block {
  font-size: 1.05em;
  margin-bottom: 20px;
  line-height: 1.7;
  text-align: justify;
}

.page-blog__image {
  width: 100%;
  height: auto;
  display: block;
  margin: 30px auto;
  border-radius: 8px;
  object-fit: cover;
  min-width: 200px;
  min-height: 200px;
}

/* --- Introduction Section --- */
.page-blog__introduction-section {
  padding: 60px 0;
  background-color: #FFFFFF;
  color: #333333;
}

/* --- Latest Articles Section --- */
.page-blog__latest-articles {
  padding: 60px 0;
  background-color: #f8f9fa;
  color: #333333;
}

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

.page-blog__article-card {
  background-color: #FFFFFF;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-blog__article-image {
  width: 100%;
  height: 250px; /* Fixed height for consistent card appearance */
  object-fit: cover;
  display: block;
  min-width: 200px;
  min-height: 200px;
}

.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.4;
}

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

.page-blog__article-title a:hover {
  color: #1a8cc4;
}

.page-blog__article-meta {
  font-size: 0.9em;
  color: #777777;
  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;
  padding: 8px 15px;
  background-color: #26A9E0;
  color: #FFFFFF;
  text-decoration: none;
  border-radius: 5px;
  font-size: 0.9em;
  font-weight: 600;
  transition: background-color 0.3s ease;
  align-self: flex-start;
}

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

.page-blog__view-all-btn-container {
  text-align: center;
  margin-top: 50px;
}

/* --- Categories Section --- */
.page-blog__categories-section {
  padding: 60px 0;
  background-color: #26A9E0; /* Dark background */
  color: #FFFFFF; /* Light text for dark background */
}

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

.page-blog__text-block--white {
  color: #f0f0f0;
}

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

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

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

.page-blog__category-image {
  width: 100%;
  max-width: 150px; /* Adjust size for category images */
  height: auto;
  margin-bottom: 15px;
  border-radius: 5px;
  min-width: 200px;
  min-height: 200px;
  object-fit: cover;
}

.page-blog__category-title {
  font-size: 1.2em;
  font-weight: 600;
  line-height: 1.3;
}

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

.page-blog__faq-list {
  margin-top: 40px;
}

.page-blog__faq-item {
  background-color: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.15em;
  font-weight: 600;
  color: #26A9E0;
  cursor: pointer;
  background-color: #eaf6fd;
  border-bottom: 1px solid #e0e0e0;
  user-select: none;
  list-style: none; /* For details/summary */
}

.page-blog__faq-item summary::-webkit-details-marker {
  display: none;
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  margin-left: 15px;
  color: #26A9E0;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  content: '−'; /* Change to minus when open for details tag */
}

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

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

/* --- CTA Section --- */
.page-blog__cta-section {
  padding: 80px 0;
  background-color: #26A9E0; /* Dark background */
  color: #FFFFFF; /* Light text for dark background */
  text-align: center;
}

.page-blog__cta-section .page-blog__section-title {
  color: #FFFFFF;
  margin-top: 0;
}

.page-blog__cta-section .page-blog__text-block {
  color: #f0f0f0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 40px;
}

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

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

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

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

  .page-blog__container {
    padding: 0 15px;
  }

  .page-blog__hero-section {
    padding: 40px 0;
    padding-top: 10px !important;
  }

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

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

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

  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

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

  .page-blog__introduction-section,
  .page-blog__latest-articles,
  .page-blog__categories-section,
  .page-blog__faq-section,
  .page-blog__cta-section {
    padding: 40px 0;
  }

  .page-blog__articles-grid {
    grid-template-columns: 1fr;
  }

  .page-blog__article-image {
    height: 200px;
  }

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

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

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

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

  /* Mobile image responsive */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-blog__section,
  .page-blog__card,
  .page-blog__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-blog__video-section {
    padding-top: 10px !important; /* body đã xử lý --header-offset, đây chỉ là phần đệm nhỏ */
  }

  /* Ensure all containers with images/buttons/videos are responsive */
  .page-blog__hero-image-container,
  .page-blog__articles-grid,
  .page-blog__categories-grid,
  .page-blog__cta-buttons,
  .page-blog__faq-list {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important; /* Prevent horizontal scroll */
  }
}

@media (max-width: 480px) {
  .page-blog__main-title {
    font-size: clamp(1.4em, 8vw, 2em);
  }

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

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

  .page-blog__faq-question {
    font-size: 0.95em;
  }
}

/* Color contrast fixes */
.page-blog__dark-bg {
  color: #ffffff;
  background: #26A9E0;
}

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

.page-blog__cta-section .page-blog__btn-primary {
  background-color: #EA7C07; /* Custom color for login/register type CTA */
  border-color: #EA7C07;
}

.page-blog__cta-section .page-blog__btn-primary:hover {
  background-color: #c46406;
  border-color: #c46406;
}