/* style/news.css */
/* 
  🚨🚨🚨 最高优先级要求：语言一致性检查 🚨🚨🚨
  Tất cả nội dung văn bản phải sử dụng 100% tiếng Việt.
  🚨🚨🚨 最高优先级要求：颜色对比度检查 🚨🚨🚨
  Tất cả văn bản phải rõ ràng, độ tương phản phải đạt tiêu chuẩn WCAG AA (trên 4.5:1).
*/

/* 
  🚨 Khoảng cách cố định giữa header và nội dung chính (phải tuân thủ nghiêm ngặt)
  - Sử dụng var(--header-offset) để dự trữ không gian.
  - Container nội dung đầu tiên của trang (.page-news__hero-section) đặt padding-top.
*/
.page-news__hero-section {
  padding-top: var(--header-offset, 120px); /* Mặc định cho Desktop, sẽ bị ghi đè bởi shared.css nếu được đặt trên body */
}

/* Phong cách cơ bản cho trang tin tức */
.page-news {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333333; /* Màu văn bản mặc định cho nền sáng */
  background-color: var(--secondary-color, #FFFFFF); /* Nền body từ shared */
}

/* Phần Hero */
.page-news__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 60px; /* Điều chỉnh khi cần */
  background: linear-gradient(135deg, #26A9E0, #FFFFFF); /* Màu thương hiệu */
  color: #FFFFFF; /* Văn bản trắng trên nền gradient xanh */
  overflow: hidden; /* Ngăn tràn hình ảnh */
}

.page-news__hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.page-news__hero-image {
  width: 100%;
  margin-bottom: 30px;
}

.page-news__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
}

.page-news__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  padding: 0 20px;
}

.page-news__main-title {
  font-size: 3.2em;
  margin-bottom: 20px;
  color: #FFFFFF; /* Đảm bảo độ tương phản cao */
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.page-news__hero-description {
  font-size: 1.2em;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: #FFFFFF; /* Đảm bảo độ tương phản cao */
}

.page-news__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: #EA7C07; /* Màu nút đăng nhập */
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 30px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-news__cta-button:hover {
  background: #C46706; /* Làm tối hơn khi hover */
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Phong cách chung cho các phần */
.page-news__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.page-news__section-title {
  font-size: 2.5em;
  color: #26A9E0; /* Màu thương hiệu cho tiêu đề */
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
}

.page-news__section-description {
  font-size: 1.1em;
  color: #555555;
  text-align: center;
  max-width: 900px;
  margin: 0 auto 40px auto;
}

/* Phần Tin tức mới nhất */
.page-news__latest-news-section {
  padding: 60px 0;
  background-color: #f9f9f9; /* Nền sáng cho thẻ tin tức */
  color: #333333;
}

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

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

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

.page-news__card-image {
  width: 100%;
  height: 200px; /* Chiều cao cố định cho tính nhất quán */
  object-fit: cover;
  display: block;
}

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

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

.page-news__card-title a {
  color: #26A9E0; /* Màu thương hiệu cho tiêu đề tin tức */
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-news__card-title a:hover {
  color: #2087B7; /* Làm tối hơn khi hover */
  text-decoration: underline;
}

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

.page-news__card-excerpt {
  font-size: 1em;
  color: #555555;
  margin-bottom: 20px;
  flex-grow: 1; /* Cho phép đoạn trích chiếm không gian có sẵn */
}

.page-news__read-more-button {
  display: inline-block;
  padding: 10px 20px;
  background: #26A9E0;
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 0.95em;
  font-weight: 600;
  transition: background-color 0.3s ease;
  align-self: flex-start; /* Căn chỉnh nút về phía đầu */
}

.page-news__read-more-button:hover {
  background: #2087B7; /* Làm tối hơn khi hover */
}

.page-news__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 50px;
  gap: 10px;
}

.page-news__pagination-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  color: #26A9E0;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.page-news__pagination-link:hover {
  background: #26A9E0;
  color: #ffffff;
  border-color: #26A9E0;
}

.page-news__pagination-link--active {
  background: #26A9E0;
  color: #ffffff;
  border-color: #26A9E0;
  cursor: default;
}

.page-news__pagination-link--active:hover {
  background: #26A9E0;
  color: #ffffff;
  border-color: #26A9E0;
}


/* Phần CTA */
.page-news__cta-section {
  padding: 80px 0;
  background: #26A9E0; /* Nền tối */
  color: #ffffff; /* Văn bản trắng */
  text-align: center;
}

.page-news__cta-title {
  font-size: 2.8em;
  margin-bottom: 20px;
  color: #ffffff; /* Đảm bảo độ tương phản cao */
  font-weight: 700;
}

.page-news__cta-description {
  font-size: 1.15em;
  max-width: 800px;
  margin: 0 auto 40px auto;
  color: #f0f0f0;
}

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

.page-news__btn-primary,
.page-news__btn-secondary {
  display: inline-block;
  padding: 15px 35px;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid;
  cursor: pointer;
}

.page-news__btn-primary {
  background: #EA7C07; /* Màu đăng nhập */
  color: #ffffff;
  border-color: #EA7C07;
}

.page-news__btn-primary:hover {
  background: #C46706;
  border-color: #C46706;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-news__btn-secondary {
  background: #ffffff;
  color: #26A9E0; /* Màu thương hiệu */
  border-color: #ffffff;
}

.page-news__btn-secondary:hover {
  background: #f0f0f0;
  color: #2087B7;
  border-color: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Phần FAQ */
.page-news__faq-section {
  padding: 60px 0;
  background-color: #f9f9f9; /* Nền sáng */
  color: #333333;
}

.page-news__faq-list {
  margin-top: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Phong cách container FAQ */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Trạng thái mặc định của FAQ - câu trả lời ẩn */
.page-news__faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
  padding: 0 15px;
  opacity: 0;
}

/* Trạng thái mở rộng của FAQ - 🚨 Sử dụng !important và max-height đủ lớn */
.page-news__faq-item.active .page-news__faq-answer {
  max-height: 2000px !important; /* 🚨 Sử dụng !important để đảm bảo ưu tiên, giá trị đủ lớn để chứa mọi nội dung */
  padding: 20px 25px !important; /* Tăng padding để trông đẹp hơn */
  opacity: 1;
  background: #ffffff; /* Nền trắng cho câu trả lời */
  border-top: 1px solid #e0e0e0;
  border-radius: 0 0 5px 5px;
}

/* Phong cách câu hỏi */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px; /* Tăng padding */
  background: #26A9E0; /* Màu thương hiệu cho nền câu hỏi */
  color: #ffffff; /* Văn bản trắng cho câu hỏi */
  border: 1px solid #26A9E0;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.page-news__faq-question:hover {
  background: #2087B7;
  border-color: #2087B7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.page-news__faq-item.active .page-news__faq-question {
  border-radius: 5px 5px 0 0; /* Bo tròn trên, phẳng dưới khi hoạt động */
  background: #2087B7;
}


/* Phong cách tiêu đề câu hỏi */
.page-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 1.1em;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Ngăn h3 chặn sự kiện click */
  color: #ffffff; /* Đảm bảo độ tương phản cao */
}

/* Biểu tượng chuyển đổi */
.page-news__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #ffffff; /* Màu trắng cho biểu tượng chuyển đổi */
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Ngăn biểu tượng chặn sự kiện click */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-news__faq-item.active .page-news__faq-toggle {
  transform: rotate(45deg); /* Xoay để tạo hiệu ứng 'x' */
  color: #ffffff;
}

/* --- Thiết kế đáp ứng --- */
@media (max-width: 1024px) {
  .page-news__main-title {
    font-size: 2.8em;
  }

  .page-news__cta-title {
    font-size: 2.4em;
  }
}

@media (max-width: 768px) {
  /* 🚨 Khoảng cách header di động (quan trọng!) */
  .page-news__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Đảm bảo bù đắp header di động */
    padding-bottom: 40px;
  }
  
  .page-news__hero-content,
  .page-news__container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-news__hero-image img {
    border-radius: 4px;
  }

  .page-news__main-title {
    font-size: 2em;
    margin-bottom: 15px;
  }

  .page-news__hero-description {
    font-size: 1em;
    margin-bottom: 20px;
  }

  .page-news__cta-button {
    padding: 12px 30px;
    font-size: 1em;
    margin-top: 20px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-news__section-title {
    font-size: 2em;
    margin-bottom: 15px;
  }

  .page-news__section-description {
    font-size: 1em;
    margin-bottom: 30px;
  }

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

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

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

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

  .page-news__card-excerpt {
    font-size: 0.95em;
  }

  .page-news__read-more-button {
    padding: 8px 15px;
    font-size: 0.9em;
  }

  .page-news__pagination {
    margin-top: 30px;
  }

  .page-news__pagination-link {
    width: 35px;
    height: 35px;
    font-size: 0.9em;
  }

  .page-news__cta-section {
    padding: 50px 0;
  }

  .page-news__cta-title {
    font-size: 2em;
    margin-bottom: 15px;
  }

  .page-news__cta-description {
    font-size: 1em;
    margin-bottom: 30px;
  }

  .page-news__cta-buttons {
    flex-direction: column; /* Xếp chồng các nút theo chiều dọc */
    gap: 15px;
  }

  .page-news__btn-primary,
  .page-news__btn-secondary {
    padding: 12px 25px;
    font-size: 1em;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-news__faq-section {
    padding: 50px 0;
  }
  
  .page-news__faq-question {
    padding: 15px 20px;
    flex-wrap: wrap;
  }
  
  .page-news__faq-question h3 {
    font-size: 1em;
    width: calc(100% - 40px);
  }
  
  .page-news__faq-toggle {
    margin-left: 10px;
    width: 24px;
    height: 24px;
    font-size: 20px;
  }
  
  .page-news__faq-item.active .page-news__faq-answer {
    padding: 15px 20px !important;
  }

  /* 🚨 Điều chỉnh hình ảnh đáp ứng */
  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-news__section,
  .page-news__card,
  .page-news__container,
  .page-news__news-card { /* Thêm news-card ở đây để có chiều rộng đầy đủ trên di động */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Đảm bảo hình ảnh và container trong khu vực nội dung không gây tràn */
.page-news__content-area img,
.page-news__latest-news-section img,
.page-news__cta-section img,
.page-news__faq-section img {
  max-width: 100%;
  height: auto;
  display: block;
}
.page-news__content-area,
.page-news__latest-news-section,
.page-news__cta-section,
.page-news__faq-section {
  overflow-x: hidden; /* Ngăn cuộn ngang */
}