/* style/news.css */

/* Base styles for the page content */
.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Dark text for light background */
    background-color: #ffffff; /* Explicitly set for content area if body is white */
}

/* Ensure padding-top for header offset */
.page-news {
    padding-top: var(--header-offset, 120px);
}

/* Container for consistent content width */
.page-news__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Section titles */
.page-news__section-title {
    font-size: 32px;
    color: #26A9E0; /* Primary color for titles */
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
}

/* CTA Buttons */
.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: #26A9E0; /* Primary color */
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text breaking */
    max-width: 100%; /* Ensure button adapts to container */
    box-sizing: border-box;
}

.page-news__cta-button:hover {
    background: #1e87b7; /* Slightly darker primary on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-news__cta-button--secondary {
    background: #ffffff;
    color: #26A9E0;
    border: 2px solid #26A9E0;
}

.page-news__cta-button--secondary:hover {
    background: #f0f8ff;
    color: #1e87b7;
}

/* Hero Banner Section */
.page-news__hero-banner {
    padding: 80px 0;
    text-align: center;
    background-color: #ffffff;
    color: #333333;
    padding-top: 40px; /* Adjust if shared.css already adds body padding-top */
}

.page-news__main-title {
    font-size: 48px;
    color: #26A9E0;
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
}

.page-news__intro-text {
    font-size: 20px;
    max-width: 800px;
    margin: 0 auto 40px auto;
    color: #555555;
}

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

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

.page-news__article-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__article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.page-news__article-image {
    width: 100%;
    height: 225px; /* Fixed height for consistency */
    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-top: 0;
    margin-bottom: 10px;
    color: #26A9E0; /* Primary color for article titles */
    line-height: 1.3;
    flex-grow: 1; /* Allow title to take available space */
}

.page-news__article-title a {
    color: #26A9E0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-news__article-title a:hover {
    color: #1e87b7;
}

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

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

.page-news__read-more {
    display: inline-block;
    color: #26A9E0;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    margin-top: auto; /* Push to bottom */
}

.page-news__read-more:hover {
    color: #1e87b7;
    text-decoration: underline;
}

.page-news__view-all {
    text-align: center;
}

/* Categories Section */
.page-news__categories {
    padding: 60px 0;
    background-color: #26A9E0; /* Dark background for this section */
    color: #ffffff; /* White text for dark background */
}

.page-news__categories .page-news__section-title {
    color: #ffffff; /* White title for dark background */
}

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

.page-news__category-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    padding-bottom: 20px;
    text-decoration: none;
    color: #ffffff;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.page-news__category-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.page-news__category-image {
    width: 100%;
    height: 187px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    margin-bottom: 15px;
}

.page-news__category-title {
    font-size: 20px;
    margin: 0 15px;
    color: #ffffff;
    font-weight: bold;
}

.page-news__category-description {
    font-size: 14px;
    color: #f0f0f0;
    margin: 10px 15px 0;
}

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

.page-news__faq-list {
    max-width: 900px;
    margin: 0 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;
  padding: 0 15px;
  opacity: 0;
}

/* FAQ展开状态 - 🚨 Sử dụng!important và đủ lớn max-height để đả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: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

/* Question style */
.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;
}

/* Question title style */
.page-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 from blocking click events */
  color: #333333; /* Ensure contrast */
}

/* Toggle icon */
.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; /* Prevent icon from blocking click events */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-news__faq-item.active .page-news__faq-toggle {
  color: #333;
}

/* CTA Section at the bottom */
.page-news__cta-section {
    padding: 80px 0;
    text-align: center;
    background-color: #26A9E0; /* Primary color background */
    color: #ffffff;
}

.page-news__cta-section .page-news__section-title {
    color: #ffffff;
    margin-bottom: 20px;
}

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

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-news__main-title {
        font-size: 40px;
    }
    .page-news__section-title {
        font-size: 28px;
    }
    .page-news__article-grid,
    .page-news__category-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-news {
        padding-top: var(--header-offset, 120px) !important; /* Ensure mobile header offset */
    }
    .page-news__container {
        padding: 0 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-news__hero-banner {
        padding: 60px 0;
        padding-top: var(--header-offset, 120px) !important; /* Override desktop padding-top */
    }
    .page-news__main-title {
        font-size: 32px;
    }
    .page-news__intro-text {
        font-size: 16px;
    }
    .page-news__section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    /* Images responsiveness */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-news__article-card,
    .page-news__category-card {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .page-news__article-image,
    .page-news__category-image {
        height: auto; /* Allow height to adjust */
    }

    /* Buttons responsiveness */
    .page-news__cta-button {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 12px 20px;
        font-size: 16px;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    .page-news__view-all {
        padding: 0 15px;
        box-sizing: border-box;
    }

    /* FAQ mobile */
    .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;
    }
}

/* Body background is white, so elements with light-bg are fine, dark-bg needs white text */
.page-news__light-bg {
    background-color: #ffffff;
    color: #333333;
}

.page-news__dark-bg {
    background-color: #26A9E0; /* Primary brand color */
    color: #ffffff;
}