/* style/news.css */
/* 
  Global styles for .page-news scope
  Body background is white, so default text color should be dark.
*/
.page-news {
  font-family: 'Arial', sans-serif;
  color: #333333; /* Dark text for light background */
  line-height: 1.6;
  background-color: var(--secondary-color); /* Matches body background from shared.css */
}

.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 */
  text-align: center;
  margin-bottom: 20px;
  padding-top: 40px;
}

.page-news__section-description {
  font-size: 18px;
  color: #555555;
  text-align: center;
  margin-bottom: 40px;
  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;
  /* 顶部间距以公用片段约定为准，使用 var(--header-offset)，避免被固定页头盖住 */
  padding-top: var(--header-offset, 120px); 
  background: linear-gradient(135deg, #e0f2f7, #ffffff); /* Light gradient for hero background */
}

.page-news__hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

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

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

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

.page-news__hero-content h1 {
  font-size: 48px;
  color: #26A9E0; /* Primary brand color */
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-news__hero-description {
  font-size: 20px;
  color: #555555;
  margin-bottom: 30px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

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

.page-news__cta-button:hover {
  background: #d46c06;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* Latest Articles Grid */
.page-news__latest-articles {
  padding: 60px 0;
  background-color: #f8fcfd; /* Very light blue background */
}

.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: 10px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.page-news__article-image {
  width: 100%;
  height: 220px; /* Fixed height for consistent card appearance */
  overflow: hidden;
}

.page-news__article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  min-width: 200px; /* Min size requirement */
  min-height: 200px; /* Min size requirement */
}

.page-news__article-card:hover .page-news__article-image 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: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

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

.page-news__article-title a:hover {
  color: #1a7eb3; /* Slightly darker on hover */
}

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

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

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

.page-news__read-more-btn:hover {
  background: #1e87bb;
}

/* Featured Articles List */
.page-news__featured-articles {
  padding: 60px 0;
  background-color: #26A9E0; /* Darker background from brand color */
  color: #ffffff; /* White text for dark background */
}

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

.page-news__featured-articles .page-news__section-description {
  color: #e0e0e0;
}

.page-news__articles-list {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.page-news__list-item {
  display: flex;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.1); /* Slightly transparent white background */
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease;
}

.page-news__list-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.page-news__list-image {
  flex-shrink: 0;
  width: 200px; /* Fixed width for list image */
  height: 120px; /* Fixed height */
  margin-right: 25px;
  border-radius: 6px;
  overflow: hidden;
}

.page-news__list-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-width: 200px; /* Min size requirement */
  min-height: 200px; /* Min size requirement */
}

.page-news__list-content {
  flex-grow: 1;
}

.page-news__list-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.page-news__list-title a {
  color: #ffffff; /* White text for titles on dark background */
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-news__list-title a:hover {
  color: #f0f0f0;
}

.page-news__list-meta {
  font-size: 13px;
  color: #cccccc;
  margin-bottom: 10px;
}

.page-news__list-summary {
  font-size: 15px;
  color: #e0e0e0;
}

.page-news__button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 50px;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 17px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-sizing: border-box; /* Crucial for responsive buttons */
    max-width: 100%; /* Crucial for responsive buttons */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
    text-align: center;
}

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

.page-news__btn-primary:hover {
    background: #d46c06;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

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

.page-news__btn-secondary:hover {
    background: #e0f2f7;
    color: #1e87bb;
    border-color: #1e87bb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}


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

.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, opacity 0.4s ease;
  padding: 0 15px;
  opacity: 0;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.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: 16px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* 防止h3标签阻止点击事件 */
  color: #333333; /* Dark text for question */
}

/* 切换图标 */
.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: #333;
  transform: rotate(45deg); /* Rotate for 'x' effect */
}


/* Responsive Design */
@media (max-width: 1024px) {
  .page-news__hero-content h1 {
    font-size: 40px;
  }
  .page-news__hero-description {
    font-size: 18px;
  }
  .page-news__section-title {
    font-size: 32px;
  }
  .page-news__articles-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  .page-news__list-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .page-news__list-image {
    width: 100%;
    height: 180px;
    margin-right: 0;
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .page-news__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Mobile specific padding-top */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-news__hero-content h1 {
    font-size: 32px;
  }
  .page-news__hero-description {
    font-size: 16px;
  }
  .page-news__cta-button {
    padding: 12px 30px;
    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: 28px;
    padding-top: 30px;
  }
  .page-news__section-description {
    font-size: 16px;
    margin-bottom: 30px;
  }

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

  .page-news__articles-grid {
    grid-template-columns: 1fr;
  }
  
  .page-news__article-image {
    height: 180px;
  }

  .page-news__list-item {
    padding: 20px;
  }
  .page-news__list-image {
    height: 150px;
  }
  .page-news__list-title {
    font-size: 18px;
  }
  .page-news__list-summary {
    font-size: 14px;
  }

  /* Mobile image responsiveness (global for .page-news img) */
  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  
  /* All containers with images/buttons */
  .page-news__section,
  .page-news__card,
  .page-news__container,
  .page-news__articles-grid,
  .page-news__articles-list,
  .page-news__button-group {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* Buttons responsive */
  .page-news__btn-primary,
  .page-news__btn-secondary,
  .page-news a[class*="button"],
  .page-news a[class*="btn"] {
    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__button-group {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
  }

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