/* style/news.css */

/* --- General Styles for News Page --- */
.page-news {
  font-family: Arial, sans-serif;
  color: #333333; /* Dark text for light body background */
  background-color: #f4f4f4; /* Inherited from body, but explicitly set for clarity */
}

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

.page-news__section-title {
  font-size: 36px;
  font-weight: bold;
  color: #0A192F; /* Main brand color for titles */
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 15px;
}

.page-news__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: #FFD700; /* Accent color for underline */
  border-radius: 2px;
}

/* --- 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); /* Ensure space for fixed header */
  background-color: #0A192F; /* Dark background for hero */
  color: #ffffff; /* White text on dark background */
}

.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;
}

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

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

.page-news__hero-content h1 {
  font-size: 48px;
  margin-bottom: 20px;
  line-height: 1.2;
  color: #FFD700; /* Gold for main title */
}

.page-news__hero-description {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 30px;
  color: #f0f0f0; /* Slightly off-white for body text */
}

.page-news__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: #FFD700; /* Gold button */
  color: #0A192F; /* Dark text on gold button */
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.page-news__cta-button:hover {
  background: #e6c200; /* Darker gold on hover */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.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-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  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-card img {
  width: 100%;
  height: 220px; /* 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-content h3 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 15px;
  line-height: 1.3;
}

.page-news__article-content h3 a {
  color: #0A192F; /* Dark blue for article titles */
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-news__article-content h3 a:hover {
  color: #FFD700; /* Gold on hover */
}

.page-news__article-content p {
  font-size: 16px;
  line-height: 1.6;
  color: #555555;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-news__read-more {
  display: inline-block;
  font-size: 16px;
  font-weight: bold;
  color: #FFD700; /* Gold for read more links */
  text-decoration: none;
  border-bottom: 2px solid #FFD700;
  padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease;
  align-self: flex-start; /* Align to the start of the flex container */
}

.page-news__read-more:hover {
  color: #0A192F; /* Dark blue on hover */
  border-color: #0A192F;
}

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

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

.page-news__faq-list {
  margin-top: 40px;
}

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

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

/* 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 dáng tiêu đề câu hỏi */
.page-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px; /* Increased font size for better readability */
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Ngăn chặn thẻ h3 chặn sự kiện nhấp */
  color: #0A192F; /* Dark blue for question text */
}

/* Chuyển đổi biểu tượng */
.page-news__faq-toggle {
  font-size: 28px; /* Increased font size for better visibility */
  font-weight: bold;
  line-height: 1;
  color: #FFD700; /* Gold for toggle icon */
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Ngăn chặn biểu tượng chặn sự kiện nhấp */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; /* Increased size */
  height: 32px; /* Increased size */
}

.page-news__faq-item.active .page-news__faq-toggle {
  color: #0A192F; /* Dark blue when active */
  transform: rotate(45deg); /* Rotate for 'x' effect */
}


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

.page-news__cta-content {
  max-width: 800px;
  margin: 0 auto;
}

.page-news__cta-content .page-news__section-title {
  color: #FFD700; /* Gold title on dark background */
  margin-bottom: 20px;
}

.page-news__cta-content p {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 30px;
  color: #f0f0f0;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .page-news__hero-content h1 {
    font-size: 42px;
  }
  .page-news__section-title {
    font-size: 32px;
  }
  .page-news__articles-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  .page-news__article-card img {
    height: 200px;
  }
}

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

  .page-news__hero-content h1 {
    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: 16px;
    width: 100% !important; /* Button responsive */
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-news__section-title {
    font-size: 28px;
    margin-bottom: 30px;
  }

  .page-news__latest-articles,
  .page-news__faq-section,
  .page-news__cta-section {
    padding: 40px 0;
  }

  .page-news__container {
    padding: 0 15px;
  }

  .page-news__articles-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-news__article-card img {
    
  }
  
  .page-news__article-content h3 {
    font-size: 20px;
  }

  .page-news__article-content p {
    font-size: 15px;
  }

  .page-news__read-more {
    font-size: 15px;
  }

  /* FAQ mobile */
  .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;
  }
  
  /* Ensure images do not overflow on mobile */
  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-news__section,
  .page-news__card,
  .page-news__container,
  .page-news__cta-content {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}