/* style/news.css */

/* Core Styles for the News Page */
.page-news {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-color, #333333); /* Default text color, adjusted by contrast logic */
  background-color: var(--secondary-color);
}

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

.page-news__section-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.3;
}

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

.page-news__section-description {
  font-size: 18px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 60px;
  color: #555555;
}

/* Hero Banner Section */
.page-news__hero-banner {
  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); /* Ensure space for fixed header */
  background: linear-gradient(135deg, #26A9E0, #a0d8f0); /* Light blue gradient */
  overflow: hidden;
}

.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%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  margin-bottom: 40px;
}

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

.page-news__hero-title {
  font-size: 48px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 20px;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.page-news__hero-description {
  font-size: 22px;
  color: #f0f0f0;
  max-width: 900px;
  margin: 0 auto 30px;
  line-height: 1.5;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

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

.page-news__cta-button {
  display: inline-block;
  padding: 16px 45px;
  text-decoration: none;
  border-radius: 8px;
  font-size: 19px;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 180px;
  text-align: center;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-news__btn-primary {
  background: #EA7C07; /* Login color */
  color: #ffffff;
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(234, 124, 7, 0.4);
}

.page-news__btn-primary:hover {
  background: #d66b05;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(234, 124, 7, 0.6);
}

.page-news__btn-secondary {
  background: #ffffff;
  color: #26A9E0;
  border: 2px solid #26A9E0;
  box-shadow: 0 4px 15px rgba(38, 169, 224, 0.2);
}

.page-news__btn-secondary:hover {
  background: #f0f8ff;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(38, 169, 224, 0.3);
}

/* Introduction Section */
.page-news__intro-section {
  padding: 80px 20px;
  background-color: #f8f8f8;
  color: #333333;
}

/* Articles Section */
.page-news__articles-section {
  padding: 80px 20px;
  background-color: #26A9E0;
  color: #ffffff;
}

.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 6px 20px 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(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.page-news__article-image {
  width: 100%;
  height: 220px; /* Fixed height for consistency */
  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: 22px;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.3;
}

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

.page-news__article-title a:hover {
  color: #EA7C07; /* Login color on hover */
}

.page-news__article-summary {
  font-size: 16px;
  color: #555555;
  margin-bottom: 15px;
  flex-grow: 1;
}

.page-news__article-date {
  font-size: 14px;
  color: #888888;
  margin-top: auto; /* Pushes date to the bottom */
  margin-bottom: 15px;
}

.page-news__read-more {
  display: inline-block;
  color: #26A9E0;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid #26A9E0;
  padding: 8px 15px;
  border-radius: 5px;
  transition: all 0.3s ease;
  align-self: flex-start;
}

.page-news__read-more:hover {
  background: #26A9E0;
  color: #ffffff;
}

/* FAQ Section */
.page-news__faq-section {
  padding: 80px 20px;
  background-color: #f0f9ff; /* Very light blue */
  color: #333333;
}

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

/* FAQ item styles */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  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: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: #333333;
  pointer-events: none; /* Prevent h3 from blocking click */
}

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

.page-news__faq-item.active .page-news__faq-toggle {
  color: #EA7C07; /* Orange when active */
  transform: rotate(45deg); /* Plus sign to X */
}

.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;
  color: #555555;
  font-size: 16px;
}

.page-news__faq-item.active .page-news__faq-answer {
  max-height: 2000px !important; /* Sufficiently large to contain content */
  padding: 20px 25px !important;
  opacity: 1;
  background: #e6f7ff; /* Lighter blue background for answer */
  border-radius: 0 0 8px 8px;
}

/* Call to Action Section */
.page-news__cta-section {
  padding: 80px 20px;
  background-color: #26A9E0;
  text-align: center;
  color: #ffffff;
}

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

.page-news__cta-title {
  font-size: 38px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 25px;
  line-height: 1.3;
}

.page-news__cta-description {
  font-size: 20px;
  color: #f0f0f0;
  margin-bottom: 40px;
  line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-news__hero-title {
    font-size: 40px;
  }
  .page-news__hero-description {
    font-size: 20px;
  }
  .page-news__section-title {
    font-size: 32px;
  }
  .page-news__cta-title {
    font-size: 34px;
  }
}

@media (max-width: 768px) {
  .page-news__container {
    padding: 30px 15px;
  }

  .page-news__hero-banner {
    padding-top: var(--header-offset, 120px) !important; /* Mobile padding-top */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-news__hero-image {
    border-radius: 8px;
    margin-bottom: 30px;
  }

  .page-news__hero-title {
    font-size: 30px;
    margin-bottom: 15px;
  }

  .page-news__hero-description {
    font-size: 17px;
    margin-bottom: 25px;
  }

  .page-news__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Ensure buttons have padding */
  }

  .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: 14px 20px;
    font-size: 17px;
  }

  .page-news__section-title {
    font-size: 28px;
    margin-bottom: 30px;
  }

  .page-news__section-description {
    font-size: 16px;
    margin-bottom: 40px;
  }

  .page-news__articles-section,
  .page-news__intro-section,
  .page-news__faq-section,
  .page-news__cta-section {
    padding: 50px 15px;
  }

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

  .page-news__article-image {
    height: 180px;
  }

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

  .page-news__article-summary {
    font-size: 15px;
  }

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

  .page-news__faq-question h3 {
    font-size: 16px;
  }

  .page-news__faq-toggle {
    font-size: 24px;
    width: 28px;
    height: 28px;
    margin-left: 15px;
  }

  .page-news__faq-answer {
    padding: 0 20px;
  }

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

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

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

  /* Image responsive rules */
  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-news__section,
  .page-news__card,
  .page-news__container,
  .page-news__articles-grid,
  .page-news__article-card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    /* No padding-left/right here to avoid double padding with page-news__container */
  }
}

@media (max-width: 480px) {
  .page-news__hero-title {
    font-size: 26px;
  }
  .page-news__hero-description {
    font-size: 16px;
  }
  .page-news__section-title {
    font-size: 24px;
  }
  .page-news__cta-title {
    font-size: 24px;
  }
}

/* Color Contrast Enforcement */
.page-news__dark-bg {
  background: #26A9E0; /* Primary brand color */
  color: #ffffff; /* White text for contrast */
}

.page-news__light-bg {
  background: #ffffff;
  color: #333333; /* Dark text for contrast */
}

.page-news__section-title--light {
  color: #ffffff; /* For titles on dark backgrounds */
}

/* Ensure text in content areas is readable */
.page-news p,
.page-news li,
.page-news__article-summary,
.page-news__article-date {
  color: #555555; /* Default dark grey for readability on light backgrounds */
}

/* Override for dark sections */
.page-news__dark-bg p,
.page-news__dark-bg li,
.page-news__dark-bg .page-news__article-summary,
.page-news__dark-bg .page-news__article-date {
  color: #f0f0f0; /* Lighter text on dark backgrounds */
}

/* Specific overrides for CTA section on dark background */
.page-news__cta-section p {
  color: #f0f0f0;
}

/* FAQ answer background color */
.page-news__faq-item.active .page-news__faq-answer {
  background: #e6f7ff; /* Very light blue */
}

/* No CSS filters on images */
.page-news img {
  filter: none; /* Ensure no filter is applied */
}