/* style/news.css */

/* --- General Page Styling --- */
.page-news {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333333; /* Dark text for light body background */
    background-color: var(--secondary-color); /* #FFFFFF */
}

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

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

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

/* --- Hero Section --- */
.page-news__hero-section {
    position: relative;
    padding: 60px 0;
    text-align: center;
    background: linear-gradient(135deg, #e0f2f7, #ffffff); /* Light gradient background */
    padding-top: var(--header-offset, 120px); /* Initial offset for the hero section */
}

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

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

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

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

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

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

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

.page-news__article-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-news__article-card img {
    width: 100%;
    height: 225px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
}

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

.page-news__card-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.4;
}

.page-news__card-title a {
    color: #26A9E0; /* Primary color for article titles */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-news__card-title a:hover {
    color: #1a7bb7; /* Darker shade on hover */
}

.page-news__card-excerpt {
    font-size: 16px;
    color: #666666;
    margin-bottom: 20px;
}

.page-news__read-more {
    display: inline-block;
    color: #26A9E0;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

/* --- News Categories Section --- */
.page-news__news-categories {
    padding: 80px 0;
    background-color: #26A9E0; /* Primary brand color background */
    color: #ffffff; /* White text for dark background */
}

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

.page-news__news-categories .page-news__section-description {
    color: #e0e0e0; /* Lighter white for description */
}

.page-news__category-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
}

.page-news__category-item {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2); /* Semi-transparent white background */
    color: #ffffff;
    padding: 12px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.page-news__category-item:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
}

/* --- CTA Section --- */
.page-news__cta-section {
    padding: 80px 0;
    background-color: #ffffff; /* White background */
    text-align: center;
}

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

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-sizing: border-box; /* Crucial for responsive buttons */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
}

.page-news__btn-primary {
    background: #26A9E0; /* Primary brand color */
    color: #ffffff;
    border: 2px solid #26A9E0;
}

.page-news__btn-primary:hover {
    background: #1a7bb7; /* Darker shade on hover */
    border-color: #1a7bb7;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.page-news__btn-secondary {
    background: #EA7C07; /* Login color */
    color: #ffffff;
    border: 2px solid #EA7C07;
}

.page-news__btn-secondary:hover {
    background: #c76506; /* Darker shade on hover */
    border-color: #c76506;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* --- FAQ Section --- */
.page-news__faq-section {
    padding: 80px 0;
    background-color: #f0f7fa; /* Light blue background for FAQ */
}

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

/* FAQ容器样式 */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  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;
  opacity: 0;
}

/* FAQ展开状态 - 🚨 使用!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;
  opacity: 1;
  background: #ffffff;
  border-top: 1px solid #e0e0e0;
  border-radius: 0 0 8px 8px;
}

/* Vấn đề kiểu dáng */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-news__faq-item.active .page-news__faq-question {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: #26A9E0;
}

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

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

/* Vấn đề tiêu đề kiểu dáng */
.page-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: #333333;
  pointer-events: none; /* Ngăn thẻ h3 chặn sự kiện click */
}

/* Biểu tượng chuyển đổi */
.page-news__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: #26A9E0;
  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;
  height: 32px;
}

.page-news__faq-item.active .page-news__faq-toggle {
  color: #1a7bb7;
  transform: rotate(45deg); /* Xoay để tạo hình 'X' hoặc '−' */
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .page-news__main-title {
        font-size: 40px;
    }
    .page-news__intro-text {
        font-size: 18px;
    }
    .page-news__section-title {
        font-size: 30px;
    }
    .page-news__section-description {
        font-size: 16px;
    }
}

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

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

    /* Hero Section */
    .page-news__hero-section {
        padding-top: var(--header-offset, 120px) !important;
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-news__hero-image img {
        border-radius: 8px;
    }
    .page-news__main-title {
        font-size: 32px;
        margin-bottom: 15px;
    }
    .page-news__intro-text {
        font-size: 16px;
        margin-bottom: 30px;
    }

    /* Latest Articles Section */
    .page-news__latest-articles {
        padding: 60px 0;
    }
    .page-news__articles-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    .page-news__article-card img {
         /* Adjust height for mobile cards */
    }
    .page-news__card-content {
        padding: 20px;
    }
    .page-news__card-title {
        font-size: 20px;
    }
    .page-news__card-excerpt {
        font-size: 15px;
    }

    /* News Categories Section */
    .page-news__news-categories {
        padding: 60px 0;
    }
    .page-news__category-list {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .page-news__category-item {
        width: 100%;
        text-align: center;
        padding: 10px 15px;
        font-size: 15px;
    }

    /* CTA Section */
    .page-news__cta-section {
        padding: 60px 0;
    }
    .page-news__cta-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100% !important; /* Ensure container takes full width */
        max-width: 100% !important; /* Ensure container takes full width */
        box-sizing: border-box !important; /* Ensure padding is included in width */
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-news__cta-button {
        max-width: 100% !important;
        width: 100% !important;
        padding: 12px 25px !important;
        font-size: 16px !important;
        margin: 0 !important; /* Remove any conflicting margins */
    }

    /* FAQ Section */
    .page-news__faq-section {
        padding: 60px 0;
    }
    .page-news__faq-list {
        margin-top: 30px;
    }
    .page-news__faq-question {
        padding: 15px 20px;
    }
    .page-news__faq-question h3 {
        font-size: 16px;
    }
    .page-news__faq-toggle {
        font-size: 24px;
        width: 28px;
        height: 28px;
    }
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 15px 20px !important;
    }

    /* Image responsive enforcement */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }
    .page-news__article-card,
    .page-news__hero-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }
}

/* Ensure no image filters are used */
.page-news img {
    filter: none !important;
}