/* style/news.css */

/* Custom CSS variables */
:root {
  --primary-color: #1A202C;
  --secondary-color: #FFD700;
  --text-dark: #333333;
  --text-light: #ffffff;
  --bg-light: #f9f9f9;
  --bg-dark: #1A202C;
  --border-color: #e0e0e0;
  --header-offset: 120px; /* Default desktop offset */
}

/* Page base styles - assuming body has a light background from shared.css */
.page-news {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-dark); /* Dark text for light body background */
  background-color: #ffffff; /* Explicitly set for content area */
  padding-top: var(--header-offset); /* Ensure content is below fixed header */
}

/* Hero Section */
.page-news__hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  background: var(--primary-color);
  color: var(--text-light);
  gap: 40px;
  position: relative;
  overflow: hidden;
}

.page-news__hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.3));
  z-index: 1;
}

.page-news__hero-content {
  max-width: 900px;
  margin: 0 auto;
  z-index: 2;
}

.page-news__main-title {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 20px;
  color: var(--secondary-color);
  line-height: 1.2;
}

.page-news__description {
  font-size: 18px;
  margin-bottom: 30px;
  color: #f0f0f0;
}

.page-news__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.page-news__cta-button {
  display: inline-block;
  padding: 15px 35px;
  background: var(--secondary-color);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.page-news__cta-button:hover {
  background: #e6c200; /* Slightly darker gold */
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-news__cta-button--secondary {
  background: transparent;
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
}

.page-news__cta-button--secondary:hover {
  background: var(--secondary-color);
  color: var(--primary-color);
}

.page-news__hero-image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

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


/* Articles Section */
.page-news__articles-section {
  padding: 80px 20px;
  background: var(--bg-light);
}

.page-news__articles-container {
  max-width: 1200px;
  margin: 0 auto;
}

.page-news__section-title {
  font-size: 36px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.page-news__section-description {
  font-size: 18px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 50px auto;
  color: var(--text-dark);
}

.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;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  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-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-news__article-image {
  width: 100%;
  height: 220px; /* Fixed height for consistency */
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}

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

.page-news__article-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--primary-color);
  line-height: 1.3;
}

.page-news__article-excerpt {
  font-size: 16px;
  color: #666666;
  margin-bottom: 15px;
  flex-grow: 1; /* Allow excerpt to take available space */
}

.page-news__article-date {
  font-size: 14px;
  color: #999999;
  font-style: italic;
}

/* Pagination */
.page-news__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 60px;
  gap: 10px;
}

.page-news__pagination-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.page-news__pagination-item:hover {
  background: var(--secondary-color);
  color: var(--primary-color);
  border-color: var(--secondary-color);
}

.page-news__pagination-item--active {
  background: var(--secondary-color);
  color: var(--primary-color);
  border-color: var(--secondary-color);
  pointer-events: none; /* Disable click on active page */
}

/* CTA Banner Section */
.page-news__cta-banner {
  padding: 80px 20px;
  background: var(--bg-dark); /* Dark background */
  color: var(--text-light); /* Light text */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
  text-align: center;
}

.page-news__cta-banner-content {
  max-width: 600px;
}

.page-news__cta-banner-title {
  font-size: 40px;
  font-weight: bold;
  margin-bottom: 20px;
  color: var(--secondary-color);
}

.page-news__cta-banner-description {
  font-size: 18px;
  margin-bottom: 30px;
  color: #f0f0f0;
}

.page-news__cta-banner-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--secondary-color);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 8px;
  font-size: 20px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.page-news__cta-banner-button:hover {
  background: #e6c200;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.page-news__cta-banner-image-container {
  max-width: 500px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.page-news__cta-banner-image {
  width: 100%;
  height: auto;
  display: block;
}


/* FAQ Section */
.page-news__faq-section {
  padding: 80px 20px;
  background: var(--bg-light);
}

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

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

/* FAQ容器样式 */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 10px;
  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;
  background: #fdfdfd;
  color: #555555;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-news__faq-item.active .page-news__faq-answer {
  max-height: 2000px !important; /* 🚨 使用!important确保优先级，值足够大以容纳任何内容 */
  padding: 20px 25px !important;
  opacity: 1;
  background: #fdfdfd;
  border-radius: 0 0 10px 10px;
}

/* 问题样式 */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
  color: var(--primary-color);
}

.page-news__faq-item.active .page-news__faq-question {
  border-radius: 10px 10px 0 0;
  border-bottom-color: transparent;
}

.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;
  font-weight: 700;
  line-height: 1.5;
  pointer-events: none; /* 防止h3标签阻止点击事件 */
}

/* 切换图标 */
.page-news__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: var(--secondary-color);
  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: 32px;
  height: 32px;
}

.page-news__faq-item.active .page-news__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Rotate for 'X' effect, or simply change to '-' */
}


/* Responsive Design */
@media (max-width: 1024px) {
  .page-news__main-title {
    font-size: 42px;
  }
  .page-news__description {
    font-size: 17px;
  }
  .page-news__section-title {
    font-size: 32px;
  }
  .page-news__cta-banner-title {
    font-size: 34px;
  }
  .page-news__cta-banner-image-container {
    max-width: 400px;
  }
}

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

  /* Ensure all content sections are responsive */
  .page-news__hero-section,
  .page-news__articles-section,
  .page-news__cta-banner,
  .page-news__faq-section {
    padding: 50px 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .page-news__hero-content {
    padding: 0 10px;
  }

  .page-news__main-title {
    font-size: 32px;
    margin-bottom: 15px;
  }

  .page-news__description {
    font-size: 15px;
    margin-bottom: 25px;
  }

  .page-news__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    width: 100%;
    max-width: 300px; /* Limit button width */
    margin: 0 auto;
  }

  .page-news__cta-button,
  .page-news__cta-banner-button {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding: 12px 25px !important;
    font-size: 16px !important;
  }

  .page-news__hero-image,
  .page-news__article-image,
  .page-news__cta-banner-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  .page-news__articles-grid {
    grid-template-columns: 1fr; /* Single column layout */
  }

  .page-news__article-image {
    height: 180px; /* Smaller image height for mobile */
  }

  .page-news__article-title {
    font-size: 18px;
  }

  .page-news__article-excerpt {
    font-size: 14px;
  }

  .page-news__pagination {
    margin-top: 40px;
    gap: 8px;
  }

  .page-news__pagination-item {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .page-news__cta-banner {
    flex-direction: column;
    gap: 30px;
  }

  .page-news__cta-banner-title {
    font-size: 28px;
  }

  .page-news__cta-banner-description {
    font-size: 16px;
  }

  .page-news__cta-banner-image-container {
    max-width: 100%;
  }

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

/* Ensure all images and containers prevent overflow on mobile */
@media (max-width: 768px) {
  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-news__section,
  .page-news__card,
  .page-news__container,
  .page-news__hero-image-container,
  .page-news__cta-banner-image-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important;
  }
  
  .page-news__hero-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .page-news__hero-content {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}