/* style/blog.css */
/* body đã có padding-top: var(--header-offset) từ shared.css; trang này không cần thêm */

.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: #f8f8f8; /* Nền sáng cho trang */
}

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

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px; /* Khoảng đệm trên nhỏ, body xử lý offset header */
  padding-bottom: 60px;
  background-color: #f0f0f0;
}

.page-blog__hero-image-wrapper {
  width: 100%;
  overflow: hidden;
}

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

.page-blog__hero-content {
  text-align: center;
  padding: 40px 20px;
  background-color: #ffffff; /* Nền trắng cho khối văn bản */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-top: -80px; /* Chồng lấn nhẹ với hình ảnh để tạo điểm nhấn */
  position: relative;
  z-index: 10;
  border-radius: 10px;
  max-width: 900px;
  width: calc(100% - 40px);
}

.page-blog__main-title {
  font-size: clamp(2.2rem, 3.5vw, 3.2rem); /* Kích thước H1 với clamp */
  color: #017439; /* Màu thương hiệu cho H1 */
  margin-bottom: 20px;
  font-weight: bold;
  line-height: 1.2;
}

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

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Cho phép các nút xuống dòng trên màn hình nhỏ */
}

/* Primary Button */
.page-blog__btn-primary {
  display: inline-block;
  background-color: #017439; /* Màu thương hiệu chính */
  color: #ffffff;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.05rem;
  transition: background-color 0.3s ease;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.page-blog__btn-primary:hover {
  background-color: #005f2e; /* Màu đậm hơn khi hover */
}

/* Secondary Button */
.page-blog__btn-secondary {
  display: inline-block;
  background-color: #ffffff;
  color: #017439; /* Màu thương hiệu chính */
  padding: 15px 30px;
  border: 2px solid #017439;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
}

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

/* Specific buttons for CTA section */
.page-blog__btn-register {
  display: inline-block;
  background-color: #C30808; /* Màu tùy chỉnh cho đăng ký */
  color: #FFFF00; /* Màu chữ tùy chỉnh cho đăng ký */
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.05rem;
  transition: background-color 0.3s ease;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.page-blog__btn-register:hover {
  background-color: #a30606;
}

.page-blog__btn-login {
  display: inline-block;
  background-color: #C30808; /* Màu tùy chỉnh cho đăng nhập */
  color: #FFFF00; /* Màu chữ tùy chỉnh cho đăng nhập */
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.05rem;
  transition: background-color 0.3s ease;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.page-blog__btn-login:hover {
  background-color: #a30606;
}

/* Blog Posts Section */
.page-blog__posts-section {
  padding: 60px 0;
  background-color: #ffffff;
}

.page-blog__section-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: #017439;
  text-align: center;
  margin-bottom: 40px;
  font-weight: bold;
}

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

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

.page-blog__post-card:hover {
  transform: translateY(-5px);
}

.page-blog__post-image-wrapper {
  width: 100%;
  height: 200px; /* Chiều cao cố định để nhất quán */
  overflow: hidden;
}

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

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

.page-blog__post-title {
  font-size: 1.4rem;
  margin-bottom: 10px;
  line-height: 1.3;
  font-weight: bold;
}

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

.page-blog__post-title a:hover {
  color: #005f2e;
}

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

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

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

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

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

/* Call to Action Section (bottom) */
.page-blog__cta-section {
  background-color: #017439; /* Màu chính của thương hiệu cho phần tối */
  color: #ffffff;
  padding: 80px 20px;
  text-align: center;
}

.page-blog__cta-title {
  font-size: clamp(2rem, 3.8vw, 3rem);
  margin-bottom: 20px;
  font-weight: bold;
}

.page-blog__cta-description {
  font-size: 1.15rem;
  max-width: 800px;
  margin: 0 auto 40px auto;
}

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

  .page-blog__container {
    padding-left: 15px !important;
    padding-right: 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Hero Section */
  .page-blog__hero-section {
    padding-top: 10px !important; /* body xử lý offset header */
    padding-bottom: 40px;
  }

  .page-blog__hero-content {
    margin-top: -60px;
    padding: 30px 15px;
    width: calc(100% - 30px);
  }

  .page-blog__main-title {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
    margin-bottom: 15px;
  }

  .page-blog__description {
    font-size: 1rem;
    margin-bottom: 20px;
  }

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

  .page-blog__cta-buttons a {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 20px;
    font-size: 1rem;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

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

  /* Containers for images, videos, buttons */
  .page-blog__section,
  .page-blog__card,
  .page-blog__container,
  .page-blog__hero-image-wrapper,
  .page-blog__post-image-wrapper,
  .page-blog__post-card,
  .page-blog__cta-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Blog Posts Section */
  .page-blog__posts-section {
    padding: 40px 0;
  }

  .page-blog__section-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
    margin-bottom: 30px;
  }

  .page-blog__posts-grid {
    grid-template-columns: 1fr; /* Một cột trên di động */
  }

  .page-blog__post-card {
    padding: 0;
  }

  .page-blog__post-image-wrapper {
    height: 180px; /* Điều chỉnh chiều cao cho di động */
  }

  .page-blog__post-title {
    font-size: 1.2rem;
  }

  .page-blog__post-excerpt {
    font-size: 0.95rem;
  }

  /* CTA Section (bottom) */
  .page-blog__cta-section {
    padding: 60px 15px;
  }

  .page-blog__cta-title {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
    margin-bottom: 15px;
  }

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

/* Đảm bảo không có filter trên hình ảnh */
.page-blog img {
  filter: none !important;
}