/* style/news.css */

/* Base Styles for the News Page */
.page-news {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light backgrounds */
  background-color: #f8f8f8; /* A light background for the news page */
}

/* Header offset to prevent content being hidden by fixed header */
.page-news__hero-section {
  padding-top: var(--header-offset, 120px); /* Desktop default */
}

/* Hero Section */
.page-news__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 60px; /* Adjust padding-bottom as needed */
  background: linear-gradient(135deg, #26A9E0, #FFFFFF); /* Fading brand color to white */
  overflow: hidden; /* Ensure image doesn't overflow */
}

.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%;
  padding: 0 20px;
  box-sizing: border-box;
}

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

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

.page-news__hero-title {
  font-size: 3.2em;
  color: #000000; /* Darker color for contrast on fading background */
  margin-bottom: 20px;
  line-height: 1.2;
  font-weight: 700;
}

.page-news__hero-description {
  font-size: 1.2em;
  color: #333333;
  max-width: 800px;
  margin: 0 auto 30px auto;
}

.page-news__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: #26A9E0; /* Primary brand color */
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
  max-width: 100%; /* Ensure button responsiveness */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-news__cta-button:hover {
  background: #1e87c0; /* Slightly darker primary color */
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* General Section Styles */
.page-news__section {
  padding: 60px 0;
  background-color: #ffffff; /* Default section background */
  border-bottom: 1px solid #eeeeee;
}

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

.page-news__section-title {
  font-size: 2.5em;
  color: #26A9E0; /* Primary brand color for titles */
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
}

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

/* Latest Articles Grid */
.page-news__articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.page-news__article-card {
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  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.12);
}

.page-news__article-image {
  width: 100%;
  height: 250px; /* Fixed height for consistency */
  overflow: hidden;
}

.page-news__article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.page-news__article-card:hover .page-news__article-image img {
  transform: scale(1.05);
}

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

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

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

.page-news__article-title a:hover {
  color: #1e87c0;
  text-decoration: underline;
}

.page-news__article-meta {
  font-size: 0.9em;
  color: #777777;
  margin-bottom: 15px;
}

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

.page-news__read-more-button {
  display: inline-block;
  padding: 10px 20px;
  background: #26A9E0;
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 0.95em;
  font-weight: bold;
  transition: background 0.3s ease;
  align-self: flex-start; /* Align to the start of the flex container */
  max-width: 100%; /* Ensure button responsiveness */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

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

/* News Categories */
.page-news__news-categories {
  background-color: #26A9E0; /* Primary brand color background */
  color: #ffffff; /* White text for dark background */
  padding: 50px 0;
}

.page-news__news-categories .page-news__section-title,
.page-news__news-categories .page-news__section-description {
  color: #ffffff; /* Ensure white text for titles/descriptions on dark background */
}

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

.page-news__category-item {
  display: block;
  background: rgba(255, 255, 255, 0.15); /* Slightly transparent white */
  color: #ffffff;
  text-align: center;
  padding: 20px 15px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.1em;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-news__category-item:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* All Articles List */
.page-news__all-articles {
  background-color: #f8f8f8; /* Light background for contrast */
  padding-bottom: 30px;
}

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

.page-news__list-item {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

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

.page-news__list-image {
  width: 250px; /* Fixed width for list image */
  height: 180px; /* Fixed height */
  flex-shrink: 0;
  overflow: hidden;
}

.page-news__list-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.page-news__list-item:hover .page-news__list-image img {
  transform: scale(1.05);
}

.page-news__list-content {
  padding: 20px 25px;
  flex-grow: 1;
}

.page-news__list-title {
  font-size: 1.3em;
  margin-bottom: 8px;
  font-weight: 600;
}

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

.page-news__list-title a:hover {
  color: #1e87c0;
  text-decoration: underline;
}

.page-news__list-meta {
  font-size: 0.85em;
  color: #777777;
  margin-bottom: 12px;
}

.page-news__list-excerpt {
  font-size: 0.95em;
  color: #555555;
}

.page-news__read-more-link {
  display: inline-flex;
  align-items: center;
  color: #26A9E0;
  text-decoration: none;
  font-weight: 600;
  margin-top: 15px;
  transition: color 0.3s ease;
}

.page-news__read-more-link:hover {
  color: #1e87c0;
}

.page-news__read-more-link span {
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.page-news__read-more-link:hover span {
  transform: translateX(3px);
}

.page-news__load-more-container {
  text-align: center;
  margin-top: 40px;
}

.page-news__load-more-button {
  display: inline-block;
  padding: 12px 30px;
  background: #f0f0f0;
  color: #26A9E0;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1em;
  font-weight: bold;
  border: 1px solid #cccccc;
  transition: background 0.3s ease, border-color 0.3s ease;
  max-width: 100%; /* Ensure button responsiveness */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-news__load-more-button:hover {
  background: #e0e0e0;
  border-color: #aaaaaa;
}

/* FAQ Section */
.page-news__faq-section {
  background-color: #f8f8f8; /* Light background for FAQ */
  padding-bottom: 60px;
}

.page-news__faq-list {
  margin-top: 30px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* FAQ container style */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 8px 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.3s ease;
  padding: 0 15px;
  opacity: 0;
  background: #f9f9f9;
}

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

/* Question style */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  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;
}

/* 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;
  color: #333333;
  pointer-events: none; /* Prevent h3 tag from blocking click events */
}

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

.page-news__faq-item.active .page-news__faq-toggle {
  color: #26A9E0; /* Brand color when active */
  transform: rotate(45deg); /* Rotate for 'x' effect */
}

/* CTA Banner Section */
.page-news__cta-banner {
  background: linear-gradient(90deg, #26A9E0, #1e87c0); /* Gradient with brand color */
  color: #ffffff;
  text-align: center;
  padding: 80px 0;
}

.page-news__cta-banner .page-news__section-title,
.page-news__cta-banner .page-news__section-description {
  color: #ffffff;
}

.page-news__cta-banner .page-news__cta-button {
  margin: 15px 10px;
  background: #EA7C07; /* Specific color for Login/Register CTA */
  border-radius: 50px;
  padding: 18px 45px;
  font-size: 1.2em;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

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

.page-news__cta-button--secondary {
    background: #ffffff;
    color: #EA7C07;
    border: 2px solid #EA7C07;
}

.page-news__cta-button--secondary:hover {
    background: #f0f0f0;
    color: #d46f07;
    border-color: #d46f07;
}

/* Dark background section for contrast */
.page-news__dark-section {
  background-color: #26A9E0;
  color: #ffffff;
}

.page-news__dark-section .page-news__section-title,
.page-news__dark-section .page-news__section-description {
  color: #ffffff;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-news__hero-title {
    font-size: 2.8em;
  }
  .page-news__section-title {
    font-size: 2em;
  }
  .page-news__list-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-news__list-image {
    width: 100%;
    height: 200px;
  }
  .page-news__list-content {
    padding-top: 15px;
  }
}

@media (max-width: 768px) {
  /* Mobile Header Offset */
  .page-news__hero-section {
    padding-top: var(--header-offset, 120px) !important;
    padding-bottom: 40px;
  }
  
  .page-news__hero-container,
  .page-news__container {
    padding: 0 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-news__hero-title {
    font-size: 2.2em;
    margin-bottom: 15px;
  }
  .page-news__hero-description {
    font-size: 1em;
    margin-bottom: 25px;
  }
  .page-news__cta-button {
    padding: 12px 25px;
    font-size: 1em;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    margin-top: 10px;
  }
  
  .page-news__cta-banner .page-news__cta-button {
    padding: 15px 30px;
    font-size: 1.1em;
    margin: 10px 0; /* Stack buttons vertically */
  }

  .page-news__section {
    padding: 40px 0;
  }
  .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; /* Single column for articles */
    gap: 25px;
  }
  
  .page-news__article-image {
    height: 200px;
  }

  .page-news__categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Adjust for smaller screens */
    gap: 15px;
  }
  .page-news__category-item {
    padding: 15px 10px;
    font-size: 0.9em;
  }

  .page-news__list-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-news__list-image {
    width: 100%;
    height: 180px;
  }
  .page-news__list-content {
    padding: 15px;
  }
  .page-news__list-title {
    font-size: 1.1em;
  }
  .page-news__list-excerpt {
    font-size: 0.9em;
  }
  
  .page-news__load-more-button {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* FAQ mobile styles */
  .page-news__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  
  .page-news__faq-question h3 {
    font-size: 1em;
    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;
  }

  /* Mobile image responsiveness for all images */
  .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;
  }
  
  /* Buttons mobile responsiveness */
  .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; /* Ensure multiple buttons wrap */
    gap: 10px;
  }
}

/* Color Contrast Enforcement - Example for dark/light sections */
.page-news__dark-bg {
  color: #ffffff; /* Deep background with light text */
  background: #26A9E0;
}

.page-news__light-bg {
  color: #333333; /* Light background with dark text */
  background: #ffffff;
}

/* Specific color rules from prompt */
.page-news__cta-button {
  background: #26A9E0; /* Primary color by default */
}
.page-news__cta-banner .page-news__cta-button {
  background: #EA7C07; /* Login/Register specific color */
}
.page-news__cta-banner .page-news__cta-button--secondary {
  background: #FFFFFF; /* White background for secondary button */
  color: #EA7C07; /* Login/Register specific color text */
  border: 2px solid #EA7C07;
}

/* No CSS filters to change image colors */
.page-news img {
  filter: none; /* Ensure no filters are applied */
}