/* style/news.css */
/* 智能颜色对比度保障系统 */
/* Body背景色来自 shared.css (var(--background-color)), 假设为浅色，文字使用深色 */
.page-news {
  color: #333333; /* 默认深色文字 */
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: var(--background-color, #f8f8f8); /* 确保背景色回退 */
}

/* 确保标题颜色在不同背景下 có độ tương phản tốt */
.page-news h1,
.page-news h2,
.page-news h3 {
  color: #333333;
}

.page-news__dark-bg h1,
.page-news__dark-bg h2,
.page-news__dark-bg h3 {
  color: #ffffff;
}

/* 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); /* 固定页头与主体间距 */
  background: linear-gradient(135deg, #26A9E0, #34B7F1); /* 淡蓝色渐变 */
  color: #ffffff;
}

.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 20px rgba(0, 0, 0, 0.2);
}

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

.page-news__hero-title {
  font-size: 3.2em;
  margin-bottom: 15px;
  font-weight: bold;
  line-height: 1.2;
  color: #ffffff;
}

.page-news__hero-description {
  font-size: 1.2em;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: #f0f0f0;
}

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

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

/* Common Section Styles */
.page-news__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.page-news__section-title {
  font-size: 2.5em;
  text-align: center;
  margin-bottom: 20px;
  color: #26A9E0; /* Brand primary color */
}

.page-news__section-title--white {
  color: #ffffff;
}

.page-news__section-description {
  font-size: 1.1em;
  text-align: center;
  max-width: 900px;
  margin: 0 auto 50px auto;
  color: #555555;
}

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

.page-news__light-bg {
  background-color: #ffffff;
  color: #333333;
}

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

/* Latest Articles Section */
.page-news__latest-articles-section {
  padding: 80px 0;
}

.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 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: 220px; /* Fixed height for consistency */
  overflow: hidden;
}

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

.page-news__article-content {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-news__article-title {
  font-size: 1.4em;
  margin-top: 0;
  margin-bottom: 15px;
  line-height: 1.4;
}

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

.page-news__article-title a:hover {
  color: #26A9E0;
}

.page-news__article-excerpt {
  font-size: 1em;
  color: #666666;
  margin-bottom: 20px;
  flex-grow: 1;
}

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

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

/* Categories Section */
.page-news__categories-section {
  padding: 80px 0;
}

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

.page-news__category-card {
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  padding-bottom: 20px;
  text-decoration: none;
  color: #333333;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-news__category-card img {
  width: 100%;
  
  object-fit: cover;
  display: block;
  margin-bottom: 20px;
}

.page-news__category-title {
  font-size: 1.3em;
  margin: 0;
  color: #26A9E0;
}

/* All Articles Section */
.page-news__all-articles-section {
  padding: 80px 0;
}

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

.page-news__list-item {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: flex-start;
  padding: 20px;
  transition: box-shadow 0.3s ease;
}

.page-news__list-item:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.page-news__list-item-image {
  flex-shrink: 0;
  width: 200px;
  height: 150px;
  overflow: hidden;
  border-radius: 8px;
  margin-right: 25px;
}

.page-news__list-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.page-news__list-item-title {
  font-size: 1.3em;
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.4;
}

.page-news__list-item-title a {
  color: #333333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-news__list-item-title a:hover {
  color: #26A9E0;
}

.page-news__list-item-excerpt {
  font-size: 0.95em;
  color: #666666;
  margin-bottom: 15px;
}

.page-news__list-item-meta {
  font-size: 0.85em;
  color: #999999;
  margin-bottom: 15px;
}

.page-news__list-item-meta span {
  margin-right: 15px;
}

.page-news__list-item-meta a {
  color: #26A9E0;
  text-decoration: none;
}

.page-news__list-item-meta a:hover {
  text-decoration: underline;
}

.page-news__pagination {
  display: flex;
  justify-content: center;
  margin-top: 50px;
  gap: 10px;
}

.page-news__pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f0f0;
  color: #333333;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.page-news__pagination-link:hover {
  background: #e0e0e0;
}

.page-news__pagination-link--active {
  background: #26A9E0;
  color: #ffffff;
}

.page-news__pagination-link--active:hover {
  background: #1a7bb0;
}

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

.page-news__cta-button--large {
  padding: 18px 50px;
  font-size: 20px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-news__hero-title {
    font-size: 2.8em;
  }
  .page-news__section-title {
    font-size: 2em;
  }
  .page-news__article-image {
    height: 180px;
  }
  .page-news__list-item-image {
    width: 150px;
    height: 112px;
  }
  .page-news__list-item-content {
    padding-left: 0;
  }
}

@media (max-width: 768px) {
  /* 移动端必须重新设置padding-top，覆盖桌面端样式 */
  .page-news__hero-section {
    padding-top: var(--header-offset, 120px) !important;
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-news__hero-title {
    font-size: 2.2em;
  }
  .page-news__hero-description {
    font-size: 1em;
    margin-bottom: 20px;
  }
  .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__container {
    padding: 30px 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-news__section-title {
    font-size: 1.8em;
    margin-bottom: 15px;
  }
  .page-news__section-description {
    font-size: 0.95em;
    margin-bottom: 30px;
  }

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

  .page-news__article-card {
    margin-bottom: 20px;
  }
  .page-news__article-image {
    height: 180px;
  }
  .page-news__article-content {
    padding: 20px;
  }

  .page-news__categories-grid {
    grid-template-columns: 1fr;
  }
  .page-news__category-card {
    margin-bottom: 20px;
  }
  .page-news__category-card img {
    
  }

  .page-news__list-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
  }
  .page-news__list-item-image {
    width: 100%;
    height: 180px;
    margin-right: 0;
    margin-bottom: 15px;
  }
  .page-news__list-item-content {
    width: 100%;
  }
  .page-news__list-item-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
  }
  .page-news__list-item-meta span {
    margin-right: 0;
  }

  /* All images must adapt to mobile screen */
  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* All containers with images/buttons must adapt */
  .page-news__section,
  .page-news__card,
  .page-news__container,
  .page-news__articles-grid,
  .page-news__categories-grid,
  .page-news__articles-list {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* Buttons in mobile */
  .page-news__cta-button,
  .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__cta-buttons,
  .page-news__button-group,
  .page-news__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
  }
  .page-news__cta-section .page-news__cta-button {
    margin-top: 20px;
  }
}

@media (max-width: 480px) {
  .page-news__hero-title {
    font-size: 1.8em;
  }
  .page-news__section-title {
    font-size: 1.5em;
  }
  .page-news__article-title {
    font-size: 1.2em;
  }
  .page-news__category-title {
    font-size: 1.1em;
  }
  .page-news__list-item-title {
    font-size: 1.1em;
  }
  .page-news__pagination-link {
    width: 35px;
    height: 35px;
    font-size: 0.9em;
  }
}