/* style/news.css */
/* 
 * Kiểm tra độ tương phản màu:
 * - Màu nền body mặc định là trắng (default), do đó màu chữ nên dùng màu tối (#333333).
 * - Tông màu chính #FFD700 (vàng kim), màu phụ #8B0000 (đỏ đậm).
 * - Đảm bảo tất cả văn bản và nền có độ tương phản đáp ứng tiêu chuẩn WCAG AA (4.5:1).
 */

.page-news {
    font-family: 'Arial', sans-serif;
    color: #333333; /* Màu chữ mặc định cho nền sáng */
    line-height: 1.6;
    padding-top: 0; /* Giả định shared.css xử lý padding-top cho body */
    margin-top: 0;
}

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

/* Phần Hero Banner */
.page-news__hero-banner {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-top: 0; /* Giả định shared.css xử lý padding-top cho body */
    margin-top: 0;
}

.page-news__hero-image-wrapper {
    width: 100%;
    height: auto;
    display: block;
}

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

.page-news__hero-content-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: rgba(0, 0, 0, 0.4); /* Lớp phủ tối cho dễ đọc văn bản */
    padding: 20px;
    box-sizing: border-box;
}

.page-news__hero-title {
    font-size: 3.5em;
    color: #FFD700; /* Chữ vàng trên lớp phủ tối */
    margin-bottom: 15px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    font-weight: bold;
}

.page-news__hero-description {
    font-size: 1.5em;
    color: #ffffff; /* Chữ trắng trên lớp phủ tối */
    max-width: 800px;
    line-height: 1.5;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Kiểu chung cho các phần */
.page-news__section-title {
    font-size: 2.2em;
    color: #8B0000; /* Đỏ đậm cho tiêu đề */
    text-align: center;
    margin-bottom: 40px;
    margin-top: 60px;
    font-weight: bold;
    line-height: 1.3;
}

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

/* Phần Giới thiệu */
.page-news__introduction-section {
    padding: 60px 0;
    background-color: #f9f9f9;
}

/* Phần Bài viết nổi bật */
.page-news__featured-articles {
    padding: 60px 0;
    background-color: #ffffff;
}

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

.page-news__article-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-news__article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

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

.page-news__article-image-wrapper {
    width: 100%;
    max-height: 250px; /* Giới hạn chiều cao của khung hình ảnh */
    overflow: hidden;
}

.page-news__article-image-wrapper img {
    width: 100%;
    height: auto; /* Duy trì tỷ lệ khung hình */
    object-fit: cover;
    display: block;
}

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

.page-news__article-title {
    font-size: 1.4em;
    color: #8B0000;
    margin-bottom: 10px;
    line-height: 1.4;
    font-weight: bold;
}

.page-news__article-excerpt {
    font-size: 0.95em;
    color: #555555;
    margin-bottom: 15px;
}

.page-news__article-date {
    font-size: 0.85em;
    color: #777777;
    display: block;
    text-align: right;
}

/* Phần Danh mục tin tức */
.page-news__news-categories {
    padding: 60px 0;
    background-color: #f0f0f0;
}

.page-news__categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Đảm bảo kích thước tối thiểu 200px */
    gap: 25px;
    text-align: center;
}

.page-news__category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-news__category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.page-news__category-card img {
    width: 200px; /* Đảm bảo kích thước hiển thị tối thiểu 200px */
    height: 200px;
    object-fit: cover;
    border-radius: 8px; 
    margin-bottom: 15px;
    display: block;
}

.page-news__category-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #333333;
}

/* Phần Danh sách bài viết */
.page-news__article-listing {
    padding: 60px 0;
    background-color: #ffffff;
}

.page-news__list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.page-news__list-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-news__list-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.page-news__list-item-content {
    display: flex;
    flex-direction: column;
}

.page-news__list-item-title {
    font-size: 1.3em;
    color: #8B0000;
    margin-bottom: 8px;
    line-height: 1.4;
    font-weight: bold;
}

.page-news__list-item-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.page-news__list-item-title a:hover {
    color: #FFD700;
}

.page-news__list-item-excerpt {
    font-size: 0.95em;
    color: #555555;
    margin-bottom: 10px;
}

.page-news__list-item-date {
    font-size: 0.8em;
    color: #777777;
    text-align: right;
}

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

.page-news__pagination-link {
    display: block;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    text-decoration: none;
    color: #333333;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

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

.page-news__pagination-link--active {
    background-color: #8B0000;
    color: #ffffff;
    border-color: #8B0000;
    font-weight: bold;
}

/* Phần CTA */
.page-news__cta-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #FFD700, #8B0000); /* Chuyển màu vàng sang đỏ */
    color: #ffffff;
    text-align: center;
}

.page-news__cta-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.page-news__cta-content {
    flex: 1;
    text-align: left;
}

.page-news__cta-title {
    font-size: 2.5em;
    margin-bottom: 20px;
    line-height: 1.3;
    font-weight: bold;
    color: #ffffff;
}

.page-news__cta-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    line-height: 1.6;
    color: #f0f0f0;
}

.page-news__cta-button {
    display: inline-block;
    background: #ffffff;
    color: #8B0000;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.2em;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    border: 2px solid #ffffff;
    max-width: 100%; /* Nút responsive */
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-news__cta-button:hover {
    background: #FFD700;
    color: #ffffff;
    transform: translateY(-3px);
    border-color: #FFD700;
}

.page-news__cta-image-wrapper {
    flex: 0 0 auto;
    width: 400px; 
    height: auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

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

/* Phần FAQ */
.page-news__faq-section {
    padding: 60px 0;
    background-color: #f9f9f9;
}

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

/* Kiểu container FAQ */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* Trạng thái mặc định FAQ - ẩn câu trả lời */
.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, opacity 0.4s ease;
  padding: 0 15px;
  opacity: 0;
}

/* Trạng thái mở rộng FAQ - 🚨 Sử dụng !important và max-height đủ lớn để đảm bảo mở rộng */
.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 15px !important;
  opacity: 1;
  background: #ffffff; /* Nền sáng cho câu trả lời */
  border-radius: 0 0 5px 5px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

/* Kiểu câu hỏi */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #FFD700; /* Nền vàng cho câu hỏi */
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
  color: #333333; /* Chữ tối trên nền vàng để có độ tương phản */
}

.page-news__faq-question:hover {
  background: #e6c200; /* Vàng đậm hơn một chút khi di chuột */
  border-color: #d0d0d0;
}

.page-news__faq-question:active {
  background: #ccaf00;
}

/* Kiểu 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 thẻ h3 chặn sự kiện click */
  color: #333333; /* Chữ tối trên nền vàng để có độ tương phản */
}

/* Biểu tượng chuyển đổi */
.page-news__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #333333; /* Chữ tối trên nền vàng để có độ tương phản */
  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 {
  color: #8B0000; /* Đỏ đậm khi hoạt động */
  transform: rotate(45deg); /* Xoay để tạo hiệu ứng 'trừ' */
}

/* Kiểu Responsive */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: 2.8em;
    }
    .page-news__hero-description {
        font-size: 1.2em;
    }
    .page-news__section-title {
        font-size: 2em;
    }
    .page-news__articles-grid {
        grid-template-columns: 1fr;
    }
    .page-news__categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    .page-news__cta-container {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
    .page-news__cta-content {
        text-align: center;
    }
    .page-news__cta-image-wrapper {
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .page-news {
        font-size: 16px;
        line-height: 1.6;
    }
    .page-news__hero-banner {
        padding-top: 0 !important; /* Khoảng cách đầu trang cố định - nếu shared xử lý padding body */
    }
    .page-news__hero-title {
        font-size: 2em;
        margin-bottom: 10px;
    }
    .page-news__hero-description {
        font-size: 1em;
    }
    .page-news__section-title {
        font-size: 1.8em;
        margin-top: 40px;
        margin-bottom: 30px;
    }
    .page-news__section-description {
        font-size: 1em;
        margin-bottom: 40px;
        padding: 0 15px;
    }
    .page-news__container {
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    .page-news__articles-grid {
        gap: 20px;
    }
    .page-news__article-image-wrapper {
        max-height: 200px; /* Giới hạn chiều cao trên di động */
    }
    .page-news__article-title {
        font-size: 1.2em;
    }
    .page-news__categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    /* .page-news__category-card img không bị thay đổi kích thước dưới 200px do quy tắc chung */

    .page-news__list-item-title {
        font-size: 1.1em;
    }
    .page-news__cta-section {
        padding: 50px 15px;
    }
    .page-news__cta-title {
        font-size: 1.8em;
    }
    .page-news__cta-description {
        font-size: 1em;
    }
    .page-news__cta-button {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-news__cta-image-wrapper {
        width: 100%;
    }
    .page-news__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    .page-news__faq-question h3 {
        font-size: 15px;
        margin-bottom: 0;
        width: calc(100% - 40px);
    }
    .page-news__faq-toggle {
        margin-left: 10px;
        width: 24px;
        height: 24px;
        font-size: 20px;
    }
    .page-news__faq-answer {
        padding: 0 15px;
    }
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 15px !important;
    }

    /* Quy tắc responsive cho hình ảnh và container trên di độ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__hero-banner,
    .page-news__introduction-section,
    .page-news__featured-articles,
    .page-news__news-categories,
    .page-news__article-listing,
    .page-news__cta-section,
    .page-news__faq-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        /* padding-left và padding-right được xử lý bởi .page-news__container */
    }
    /* Đảm bảo các nhóm nút cũng responsive */
    .page-news__cta-buttons,
    .page-news__button-group,
    .page-news__btn-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        flex-wrap: wrap !important;
        gap: 10px;
    }
    .page-news__cta-buttons {
        display: flex;
        flex-direction: column; 
    }
}