/* 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: var(--background-color, #FFFFFF); /* Default to white if var not set */
    padding-top: var(--header-offset, 120px); /* Ensure content is not hidden by fixed header */
}

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

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

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

/* 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 is handled by .page-news */
}

.page-news__hero-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.page-news__hero-image {
    width: 100%;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.page-news__hero-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.page-news__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    padding: 40px;
    background: #FFFFFF; /* Light background for content area */
    color: #333333;
}

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

.page-news__intro-description {
    font-size: 18px;
    max-width: 900px;
    margin: 0 auto 30px auto;
    color: #555555;
}

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: #EA7C07; /* Login color for CTA */
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-news__cta-button:hover {
    background: #D26F06; /* Darken on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

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

.page-news__articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 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.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

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

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

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

.page-news__card-title a:hover {
    color: #1F8CBF; /* Darken on hover */
}

.page-news__card-excerpt {
    font-size: 16px;
    color: #666666;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-news__read-more-button {
    display: inline-block;
    padding: 10px 20px;
    background: #26A9E0; /* Primary color */
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.page-news__read-more-button:hover {
    background: #1F8CBF; /* Darken on hover */
}

.page-news__view-all-button-container {
    text-align: center;
    margin-top: 40px;
}

/* Promo Section */
.page-news__promo-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #26A9E0, #1a8ccf); /* Gradient using primary color */
    color: #ffffff; /* White text for dark background */
    text-align: center;
}

.page-news__promo-section .page-news__section-title {
    color: #ffffff; /* White title */
}

.page-news__promo-section .page-news__section-description {
    color: #f0f0f0;
}

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

.page-news__btn-primary {
    display: inline-block;
    padding: 15px 35px;
    background: #EA7C07; /* Login color */
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: none;
}

.page-news__btn-primary:hover {
    background: #D26F06;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.page-news__btn-secondary {
    display: inline-block;
    padding: 15px 35px;
    background: #ffffff;
    color: #26A9E0; /* Primary color */
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: none;
}

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


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

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

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

/* 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 15px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

/* 问题样式 */
.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;
}

/* 问题标题样式 */
.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;
  color: #333333;
  pointer-events: none; /* 防止h3标签阻止点击事件 */
}

/* 切换图标 */
.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; /* 防止图标阻止点击事件 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-news__faq-item.active .page-news__faq-toggle {
  color: #26A9E0; /* Primary color for active toggle */
  transform: rotate(45deg); /* Rotate for minus sign effect */
}

.page-news__faq-answer p {
    font-size: 16px;
    color: #555555;
    margin: 0;
}


/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__main-title {
        font-size: 36px;
    }
    .page-news__intro-description {
        font-size: 17px;
    }
    .page-news__section-title {
        font-size: 28px;
    }
    .page-news__articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .page-news__article-card img {
        
    }
    .page-news__card-title {
        font-size: 20px;
    }
    .page-news__cta-button, .page-news__btn-primary, .page-news__btn-secondary {
        padding: 12px 30px;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .page-news {
        font-size: 16px;
        line-height: 1.6;
        padding-top: var(--header-offset, 120px) !important; /* Mobile specific header offset */
    }

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

    /* Images responsiveness */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }

    .page-news__hero-section {
        padding: 40px 15px;
    }
    .page-news__hero-content {
        padding: 30px 20px;
    }
    .page-news__main-title {
        font-size: 28px;
        margin-bottom: 15px;
    }
    .page-news__intro-description {
        font-size: 16px;
        margin-bottom: 20px;
    }
    .page-news__cta-button {
        padding: 12px 25px;
        font-size: 16px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-news__section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
    .page-news__section-description {
        font-size: 16px;
    }
    .page-news__latest-articles {
        padding: 60px 0;
    }
    .page-news__articles-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 20px;
    }
    .page-news__article-card img {
        
    }
    .page-news__card-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    .page-news__card-excerpt {
        font-size: 15px;
        margin-bottom: 15px;
    }
    .page-news__read-more-button {
        padding: 8px 15px;
        font-size: 14px;
    }

    .page-news__promo-section {
        padding: 60px 15px;
    }
    .page-news__promo-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .page-news__btn-primary, .page-news__btn-secondary {
        max-width: 100% !important;
        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__faq-section {
        padding: 60px 0;
    }
    .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: 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;
    }

    /* General containers for mobile to prevent overflow */
    .page-news__section,
    .page-news__card,
    .page-news__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}