/* style/news.css */

/* --- General Page Styles --- */
.page-news {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Default text color for light backgrounds */
    background-color: #FFFFFF; /* Default body background is white */
}

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

.page-news__section-title {
    font-size: 36px;
    font-weight: bold;
    color: #017439; /* Primary brand color */
    text-align: center;
    margin-bottom: 20px;
    margin-top: 60px;
}

.page-news__section-title--light {
    color: #FFFFFF; /* White text for dark backgrounds */
}

.page-news__section-description {
    font-size: 18px;
    text-align: center;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: #555555;
}

.page-news__section-description--light {
    color: #f0f0f0; /* Light grey text for dark backgrounds */
}

/* --- Hero Section --- */
.page-news__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    padding-top: var(--header-offset, 120px); /* Fixed header spacing */
    background: linear-gradient(135deg, #017439, #3f9b69); /* Brand color gradient */
    color: #FFFFFF;
}

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

.page-news__hero-image {
    width: 100%;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

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

.page-news__hero-title {
    font-size: 48px;
    margin-bottom: 20px;
    line-height: 1.2;
    color: #FFFF00; /* Yellow for emphasis on title */
}

.page-news__hero-description {
    font-size: 20px;
    margin-bottom: 30px;
    color: #f0f0f0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: #C30808; /* Register/Login color */
    color: #FFFF00; /* Register/Login font color */
    text-decoration: none;
    border-radius: 50px;
    font-size: 20px;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    border: none;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-news__cta-button:hover {
    background: #e02020;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

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

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

.page-news__article-card {
    background: #FFFFFF;
    border-radius: 12px;
    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__article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.page-news__article-image {
    width: 100%;
    height: 200px; /* Fixed height for image consistency */
    overflow: hidden;
}

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

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

.page-news__article-title {
    font-size: 22px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.page-news__article-title a {
    color: #017439; /* Primary color for news titles */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-news__article-title a:hover {
    color: #3f9b69;
}

.page-news__article-meta {
    font-size: 14px;
    color: #777777;
    margin-bottom: 15px;
}

.page-news__article-summary {
    font-size: 16px;
    color: #555555;
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-news__read-more-button {
    display: inline-block;
    padding: 10px 25px;
    background: #017439;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    align-self: flex-start;
    transition: background-color 0.3s ease, transform 0.3s ease;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-news__read-more-button:hover {
    background: #3f9b69;
    transform: translateY(-2px);
}

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

.page-news__pagination-link {
    display: block;
    padding: 12px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #017439;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.page-news__pagination-link:hover:not(.page-news__pagination-link--active) {
    background-color: #f0f0f0;
    border-color: #d0d0d0;
}

.page-news__pagination-link--active {
    background-color: #017439;
    color: #FFFFFF;
    border-color: #017439;
    cursor: default;
}

/* --- Overview Section --- */
.page-news__overview-section {
    padding: 60px 0;
    background-color: #017439; /* Primary brand color for dark background */
    color: #FFFFFF;
}

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

.page-news__feature-item {
    background: #3f9b69; /* Slightly lighter green for cards on dark background */
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.page-news__feature-item:hover {
    transform: translateY(-5px);
    background-color: #5bc084;
}

.page-news__feature-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #FFFF00; /* Yellow for titles on dark background */
}

.page-news__feature-desc {
    font-size: 16px;
    color: #f0f0f0;
}

/* --- Categories Section --- */
.page-news__categories {
    padding: 60px 0;
    background-color: #017439; /* Primary brand color for dark background */
}

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

.page-news__category-card {
    background: #3f9b69; /* Slightly lighter green for cards on dark background */
    color: #FFFFFF;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 180px;
}

.page-news__category-card:hover {
    transform: translateY(-5px);
    background-color: #5bc084;
}

.page-news__category-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #FFFF00; /* Yellow for titles on dark background */
}

.page-news__category-desc {
    font-size: 15px;
    color: #f0f0f0;
}

/* --- CTA Banner Section --- */
.page-news__cta-banner {
    padding: 60px 0;
    background-color: #f0f0f0;
}

.page-news__cta-banner .page-news__container {
    display: flex;
    align-items: center;
    gap: 40px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

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

.page-news__cta-title {
    font-size: 32px;
    color: #017439;
    margin-bottom: 15px;
    font-weight: bold;
}

.page-news__cta-text {
    font-size: 18px;
    color: #555555;
    margin-bottom: 25px;
}

.page-news__cta-banner .page-news__cta-button {
    margin-top: 0; /* Override default margin */
}

.page-news__cta-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-news__cta-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

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

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

/* FAQ容器样式 */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* FAQ默认状态 - 答案隐藏 */
.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;
  color: #555555;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.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: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

/* Vấn đề kiểu dáng */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  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;
}

.page-news__faq-question:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

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

/* Kiểu tiêu đề câu hỏi */
.page-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px; /* Slightly larger for better readability */
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Ngăn thẻ h3 chặn sự kiện click */
  color: #017439; /* Primary color for questions */
}

/* Chuyển đổi biểu tượng */
.page-news__faq-toggle {
  font-size: 28px; /* Slightly larger icon */
  font-weight: bold;
  line-height: 1;
  color: #666;
  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: 32px; /* Larger touch target */
  height: 32px;
}

.page-news__faq-item.active .page-news__faq-toggle {
  color: #333;
  transform: rotate(45deg); /* Xoay để tạo thành dấu 'X' hoặc 'trừ' */
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: 40px;
    }
    .page-news__hero-description {
        font-size: 18px;
    }
    .page-news__section-title {
        font-size: 32px;
    }
    .page-news__cta-banner .page-news__container {
        flex-direction: column;
        text-align: center;
        padding: 30px;
    }
    .page-news__cta-content {
        text-align: center;
    }
    .page-news__cta-image {
        margin-top: 30px;
    }
    .page-news__overview-features {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    /* 🚨 Mobile Hero Section Adaption */
    .page-news__hero-section {
        padding-top: var(--header-offset, 120px) !important; /* Mobile fixed header spacing */
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-news__hero-title {
        font-size: 32px;
        margin-bottom: 15px;
    }
    .page-news__hero-description {
        font-size: 16px;
        margin-bottom: 20px;
    }
    .page-news__cta-button {
        padding: 12px 30px;
        font-size: 18px;
        max-width: 100% !important; /* Button responsive */
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    /* 🚨 Mobile Image Adaption */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-news__section,
    .page-news__card,
    .page-news__container,
    .page-news__article-card,
    .page-news__category-card,
    .page-news__cta-banner .page-news__container,
    .page-news__overview-features,
    .page-news__feature-item {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-news__latest-articles,
    .page-news__categories,
    .page-news__cta-banner,
    .page-news__faq-section,
    .page-news__overview-section {
        padding: 40px 0;
    }
    .page-news__articles-grid,
    .page-news__categories-grid,
    .page-news__overview-features {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .page-news__section-title {
        font-size: 28px;
        margin-top: 40px;
    }
    .page-news__section-description {
        font-size: 16px;
    }

    /* 🚨 Mobile FAQ Adaption */
    .page-news__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    .page-news__faq-question h3 {
        font-size: 16px;
        margin-bottom: 0;
        width: calc(100% - 40px);
    }
    .page-news__faq-toggle {
        margin-left: 10px;
        width: 28px;
        height: 28px;
        font-size: 24px;
    }
    .page-news__faq-answer {
        padding: 0 15px;
    }
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 15px !important;
    }

    /* 🚨 Mobile Button Containers Adaption */
    .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 {
        flex-direction: column;
    }
}