/* style/news.css */

:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --text-dark: #333333;
  --text-light: #ffffff;
  --background-light: #f8f9fa;
  --border-color: #e0e0e0;
  --button-login: #EA7C07;
}

.page-news {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--background-light);
  padding-top: var(--header-offset, 120px); /* Ensure content is not hidden by fixed header */
}

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

/* Hero Banner Section */
.page-news__hero-banner {
  text-align: center;
  padding: 80px 20px;
  background-color: var(--primary-color);
  color: var(--text-light);
}

.page-news__main-title {
  font-size: 2.8em;
  margin-bottom: 20px;
  color: var(--text-light);
  line-height: 1.2;
}

.page-news__intro-description {
  font-size: 1.2em;
  max-width: 800px;
  margin: 0 auto 30px auto;
  color: var(--text-light);
}

.page-news__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--button-login); /* Using custom color for login/CTA */
  color: var(--text-light);
  text-decoration: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.3s ease;
  border: none;
  cursor: pointer;
}

.page-news__cta-button:hover {
  background-color: darken(var(--button-login), 10%);
  transform: translateY(-2px);
}

/* Section Titles */
.page-news__section-title {
  font-size: 2.2em;
  text-align: center;
  margin-bottom: 40px;
  color: var(--primary-color);
  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: var(--primary-color);
  border-radius: 2px;
}

/* Featured News Section */
.page-news__featured-news {
  padding: 60px 0;
  background-color: var(--secondary-color);
}

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

.page-news__news-card {
  background-color: var(--secondary-color);
  border-radius: 12px;
  box-shadow: 0 4px 20px 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__news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.page-news__card-image {
  width: 100%;
  height: 250px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
}

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

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

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

.page-news__card-title a:hover {
  color: var(--primary-color);
}

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

.page-news__read-more {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.page-news__read-more:hover {
  color: darken(var(--primary-color), 15%);
}

/* Latest Articles Section */
.page-news__latest-articles {
  padding: 60px 0;
  background-color: var(--background-light);
}

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

.page-news__article-item {
  background-color: var(--secondary-color);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
  display: flex;
  flex-direction: column;
}

.page-news__article-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.page-news__article-image {
  width: 100%;
  height: 200px; /* Consistent image height */
  object-fit: cover;
  display: block;
}

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

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

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

.page-news__article-title a:hover {
  color: var(--primary-color);
}

.page-news__article-date {
  font-size: 0.85em;
  color: #888;
  margin-bottom: 15px;
}

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

/* FAQ Section */
.page-news__faq-section {
  padding: 60px 0;
  background-color: var(--secondary-color);
}

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

.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  background: var(--secondary-color);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
}

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

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

.page-news__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: var(--primary-color);
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Prevent icon from blocking click event */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-news__faq-item.active .page-news__faq-toggle {
  transform: rotate(45deg); /* Or change to '-' */
  color: var(--text-dark);
}

.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-color: var(--background-light);
}

.page-news__faq-item.active .page-news__faq-answer {
  max-height: 2000px !important; /* Sufficiently large to ensure content is visible */
  padding: 20px 25px !important;
  opacity: 1;
}

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

.page-news__cta-section .page-news__section-title,
.page-news__cta-section .page-news__cta-description {
  color: var(--text-light);
}

.page-news__cta-section .page-news__section-title::after {
  background-color: var(--text-light);
}

.page-news__cta-description {
  font-size: 1.1em;
  max-width: 700px;
  margin: 0 auto 30px auto;
}

/* Responsive Design */
@media (max-width: 992px) {
  .page-news__main-title {
    font-size: 2.2em;
  }

  .page-news__section-title {
    font-size: 1.8em;
  }

  .page-news__card-image,
  .page-news__article-image {
    height: 200px;
  }
}

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

  .page-news__hero-banner {
    padding: 60px 15px;
  }

  .page-news__main-title {
    font-size: 1.8em;
  }

  .page-news__intro-description {
    font-size: 1em;
  }

  .page-news__cta-button {
    padding: 12px 25px;
    font-size: 1em;
    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: 1.5em;
    margin-bottom: 30px;
  }

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

  .page-news__card-grid,
  .page-news__article-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-news__news-card,
  .page-news__article-item {
    margin: 0 15px;
  }

  .page-news__card-image,
  .page-news__article-image {
    height: 180px;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-news__card-content,
  .page-news__article-content {
    padding: 15px;
  }

  .page-news__card-title,
  .page-news__article-title {
    font-size: 1.1em;
  }

  .page-news__card-excerpt,
  .page-news__article-excerpt {
    font-size: 0.85em;
  }

  .page-news__faq-question {
    padding: 15px 20px;
  }

  .page-news__faq-question h3 {
    font-size: 1em;
  }

  .page-news__faq-toggle {
    font-size: 20px;
    width: 24px;
    height: 24px;
  }

  .page-news__faq-answer {
    padding: 0 20px;
  }
  
  .page-news__faq-item.active .page-news__faq-answer {
    padding: 15px 20px !important;
  }

  .page-news__cta-section {
    padding: 50px 15px;
  }

  /* Ensure all images are responsive and do not overflow */
  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-news__section, .page-news__card, .page-news__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !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-buttons {
    display: flex;
    flex-direction: column;
  }
}