:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --text-color-dark: #333333;
    --text-color-light: #ffffff;
    --button-register-bg: #C30808;
    /* 🚨 Contrast override: Using white text on red button for WCAG AA compliance (4.7:1) */
    --button-register-text: #ffffff;
    --button-login-bg: #C30808;
    /* 🚨 Contrast override: Using white text on red button for WCAG AA compliance (4.7:1) */
    --button-login-text: #ffffff;
    --background-color: #FFFFFF;
}

.page-news {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color-dark); /* Default text color for light background */
    background-color: var(--background-color);
}

/* Fixed header offset */
.page-news__hero-section {
    padding-top: var(--header-offset, 120px); /* Ensures content is not hidden by fixed header */
}

/* Hero Section */
.page-news__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-bottom: 60px; /* Adjust padding-top is handled by var(--header-offset) */
    background: var(--primary-color); /* Dark section background */
    color: var(--text-color-light); /* Light text on dark background */
}

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

.page-news__hero-title {
    font-size: 3.2em;
    margin-bottom: 20px;
    color: var(--text-color-light);
    line-height: 1.2;
}

.page-news__hero-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-color-light);
}

.page-news__hero-image {
    width: 100%;
    margin-bottom: 30px;
    max-width: 900px; /* Constraint for hero image width */
}

.page-news__hero-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* General Section Styling */
.page-news__latest-articles,
.page-news__featured-articles,
.page-news__categories,
.page-news__faq-section {
    padding: 80px 0;
}

.page-news__dark-section {
    background-color: var(--primary-color);
    color: var(--text-color-light);
}

.page-news__light-bg {
    background-color: var(--background-color);
    color: var(--text-color-dark);
}

.page-news__section-title {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 25px;
    color: inherit; /* Inherit color from section (dark or light text) */
}

.page-news__section-intro {
    font-size: 1.1em;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 50px auto;
    line-height: 1.8;
    color: inherit; /* Inherit color from section */
}

/* Buttons */
.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-align: center;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-news__btn-primary {
    background: var(--primary-color);
    color: var(--text-color-light);
}

.page-news__btn-primary:hover {
    background: #005a2e; /* A slightly darker green */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-news__btn-secondary {
    background: var(--secondary-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

/* Register Button Specific Styling */
.page-news__btn-register {
    background: var(--button-register-bg); /* #C30808 */
    color: var(--button-register-text);   /* 🚨 Overridden to #FFFFFF for contrast */
    margin-left: 20px; /* Spacing between buttons */
}

.page-news__btn-register:hover {
    background: #a60707; /* Slightly darker red */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Articles Grid */
.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: var(--secondary-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    color: var(--text-color-dark);
}

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

.page-news__article-thumbnail {
    width: 100%;
    height: 225px; /* Fixed height for thumbnails */
    overflow: hidden;
}

.page-news__article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.page-news__article-card:hover .page-news__article-thumbnail img {
    transform: scale(1.05);
}

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

.page-news__article-title {
    font-size: 1.4em;
    margin-bottom: 10px;
    line-height: 1.4;
    flex-grow: 1;
}

.page-news__article-title a {
    text-decoration: none;
    color: var(--text-color-dark);
    transition: color 0.3s ease;
}

.page-news__article-title a:hover {
    color: var(--primary-color);
}

.page-news__article-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
}

.page-news__article-summary {
    font-size: 1em;
    color: #555;
    margin-bottom: 20px;
    flex-grow: 1; /* Allow summary to take available space */
}

.page-news__read-more-button {
    margin-top: auto; /* Push button to bottom */
    align-self: flex-start; /* Align button to start */
    padding: 10px 20px;
    font-size: 0.95em;
    border-radius: 5px;
}

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

.page-news__pagination-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 5px;
    text-decoration: none;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
    font-weight: bold;
    font-size: 1.1em;
}

.page-news__pagination-link:hover {
    background: var(--primary-color);
    color: var(--text-color-light);
}

.page-news__pagination-active {
    background: var(--primary-color);
    color: var(--text-color-light);
    pointer-events: none;
    cursor: default;
}

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

.page-news__category-card {
    display: block;
    background: var(--secondary-color);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color-dark);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-news__category-title {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.page-news__category-description {
    font-size: 1em;
    color: #555;
}

/* CTA Section */
.page-news__cta-section {
    padding: 80px 0;
    text-align: center;
    background: linear-gradient(135deg, #017439, #004d26); /* Darker green gradient */
    color: var(--text-color-light);
}

.page-news__cta-content {
    max-width: 900px;
}

.page-news__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

/* FAQ Section */
.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;
  background: var(--secondary-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 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 25px; /* Adjusted padding for consistency */
  opacity: 0;
  color: var(--text-color-dark);
}

/* FAQ展开状态 - 🚨 Sử dụng!important và đủ lớn max-height để đảm bảo có thể 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 25px !important; /* Adjusted padding for consistency */
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

/* Vấn đề kiểu */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px; /* Adjusted padding for consistency */
  background: var(--secondary-color);
  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: var(--text-color-dark);
}

.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: 1.15em;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Ngăn thẻ h3 chặn sự kiện click */
  color: var(--text-color-dark);
}

/* Chuyển đổi biểu tượng */
.page-news__faq-toggle {
  font-size: 24px;
  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: 28px;
  height: 28px;
}

.page-news__faq-item.active .page-news__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Thay đổi thành X cho trạng thái hoạt động */
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: 2.8em;
    }
    .page-news__section-title {
        font-size: 2em;
    }
    .page-news__hero-description,
    .page-news__section-intro {
        font-size: 1.1em;
    }
}

@media (max-width: 768px) {
    /* Mobile Hero Section */
    .page-news__hero-section {
        padding-top: var(--header-offset, 120px) !important; /* Mobile specific offset */
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-news__hero-title {
        font-size: 2.2em;
        margin-bottom: 15px;
    }

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

    .page-news__hero-image {
        margin-bottom: 20px;
    }

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

    /* General Section Styling */
    .page-news__latest-articles,
    .page-news__featured-articles,
    .page-news__categories,
    .page-news__faq-section,
    .page-news__cta-section {
        padding: 40px 0;
    }

    .page-news__container {
        padding: 0 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-news__section-title {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

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

    /* Articles Grid */
    .page-news__articles-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .page-news__article-card {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }

    .page-news__article-thumbnail {
        height: 180px;
    }

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

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

    .page-news__article-meta {
        font-size: 0.85em;
    }
}