/* style/news.css */

/* Custom properties for colors from the prompt */
:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-color: #EA7C07;
  --background-color: #FFFFFF; /* Assuming body background is light */
  --text-color-dark: #333333;
  --text-color-light: #ffffff;
}

/* Base styles for the news page content */
.page-news {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color-dark); /* Default text color for light background */
  background-color: var(--background-color); /* Matches body background */
}

/* 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); /* Ensures content is not hidden by fixed header */
  background: linear-gradient(135deg, var(--primary-color) 0%, #aed6f1 100%); /* Light blue gradient */
  color: var(--text-color-light); /* Light text on dark/gradient background */
  overflow: hidden; /* Prevent content overflow */
}

.page-news__hero-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.page-news__hero-title {
  font-size: 2.8em;
  margin-bottom: 20px;
  font-weight: bold;
  line-height: 1.2;
  color: var(--text-color-light); /* Ensure high contrast */
  text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.page-news__hero-description {
  font-size: 1.2em;
  margin-bottom: 30px;
  color: var(--text-color-light); /* Ensure high contrast */
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* General Container for content sections */
.page-news__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

/* Section Titles */
.page-news__section-title {
  font-size: 2.2em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 40px;
  color: var(--primary-color);
}

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

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

.page-news__article-card {
  background: var(--secondary-color);
  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-image {
  width: 100%;
  height: 220px; /* Fixed height for consistent card appearance */
  object-fit: cover;
  display: block;
}

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

.page-news__article-title {
  font-size: 1.4em;
  margin-bottom: 15px;
  line-height: 1.3;
  font-weight: 600;
}

.page-news__article-title a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.page-news__article-excerpt {
  font-size: 1em;
  color: var(--text-color-dark);
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-news__read-more-button {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary-color);
  color: var(--text-color-light);
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  align-self: flex-start;
  transition: background-color 0.3s ease;
}

.page-news__read-more-button:hover {
  background: #1a7bb5;
}

/* CTA Section */
.page-news__cta-section {
  padding: 80px 20px;
  text-align: center;
  background: var(--primary-color);
  color: var(--text-color-light);
}

.page-news__cta-title {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: var(--text-color-light);
}

.page-news__cta-description {
  font-size: 1.1em;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-news__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  max-width: 600px;
  margin: 0 auto;
}

.page-news__btn-primary,
.page-news__btn-secondary {
  display: inline-block;
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 180px; /* Ensure buttons have a decent minimum width */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-news__btn-primary {
  background: var(--login-color); /* Using login color for primary action */
  color: var(--text-color-light);
  border: 2px solid var(--login-color);
}

.page-news__btn-primary:hover {
  background: #c76606; /* Slightly darker login color */
  border-color: #c76606;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-news__btn-secondary {
  background: var(--secondary-color);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.page-news__btn-secondary:hover {
  background: #e0f2f7; /* Lighter primary color for hover */
  border-color: #1a7bb5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Trending Topics Section */
.page-news__trending-topics {
  padding: 60px 0;
}

.page-news__topics-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.page-news__topics-list li {
  background: #f0f8ff; /* Light blue background for list items */
  border: 1px solid var(--primary-color);
  border-radius: 5px;
  padding: 10px 20px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.page-news__topics-list li:hover {
  background: var(--primary-color);
  border-color: #1a7bb5;
}

.page-news__topics-list li a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.page-news__topics-list li:hover a {
  color: var(--text-color-light);
}


/* FAQ Section */
.page-news__faq-section {
  padding: 60px 0;
}

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

/* FAQ容器样式 */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 8px; /* Slightly larger border-radius */
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* FAQ default state - answer hidden */
.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 20px; /* Adjust padding for consistency */
  opacity: 0;
  color: var(--text-color-dark);
}

/* FAQ expanded state - 🚨 Use !important and sufficiently large max-height */
.page-news__faq-item.active .page-news__faq-answer {
  max-height: 2000px !important; /* 🚨 Using !important for priority, value large enough for any content */
  padding: 20px !important; /* Adjust padding for consistency */
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
}

/* Question style */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--secondary-color);
  border: 1px solid #e0e0e0;
  border-radius: 8px; /* Slightly larger border-radius */
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-news__faq-item.active .page-news__faq-question {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background-color: #f5f5f5; /* Slightly darker when active */
}

.page-news__faq-question:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

.page-news__faq-question:active {
  background: #eeeeee;
}

/* Question title style */
.page-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 1.1em;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 from blocking click events */
  color: var(--primary-color);
}