/* style/news.css */

/* General page styles */
.page-news {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Dark text for light body background */
  background-color: #ffffff; /* Explicitly define body background for contrast calculation */
}

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

/* Hero Section */
.page-news__hero-section {
  position: relative;
  display: flex;
  flex-direction: column; /* Image above text */
  align-items: center;
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  padding-bottom: 60px;
  overflow: hidden; /* Ensure content doesn't overflow */
  background-color: #017439; /* Dark background for the whole section */
}

.page-news__hero-image-wrapper {
  width: 100%;
  max-width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px; /* Space between image and text content */
}

.page-news__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.page-news__hero-content-wrapper {
  width: 100%;
  text-align: center;
  z-index: 1; /* Ensure text is above image if any overlap */
}

.page-news__main-title {
  font-size: clamp(2rem, 4vw, 3.5rem); /* Responsive font size for H1 */
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff; /* White text for dark background */
  margin-bottom: 20px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-news__description {
  font-size: 1.125rem;
  color: #f0f0f0; /* Slightly off-white for description */
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* CTA Buttons */
.page-news__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  width: 100%; /* Ensure container takes full width */
  max-width: 500px; /* Limit button group width */
  margin: 0 auto;
}

.page-news__btn-primary,
.page-news__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  text-align: center;
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Break long words */
}

.page-news__btn-primary {
  background-color: #017439; /* Main brand color */
  color: #ffffff;
  border: 2px solid #017439;
}

.page-news__btn-primary:hover {
  background-color: #005a2e; /* Darker green on hover */
  border-color: #005a2e;
}

.page-news__btn-secondary {
  background-color: #ffffff;
  color: #017439;
  border: 2px solid #017439;
}

.page-news__btn-secondary:hover {
  background-color: #f0f0f0;
  color: #005a2e;
  border-color: #005a2e;
}

.page-news__btn-primary--large {
  padding: 15px 30px;
  font-size: 1.1rem;
}

/* Latest Articles Section */
.page-news__latest-articles {
  padding: 80px 0;
  background-color: #ffffff; /* Light background for this section */
  color: #333333; /* Dark text for light background */
}

.page-news__section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 50px;
  color: #017439; /* Brand color for titles on light background */
}

.page-news__section-title--light {
  color: #ffffff; /* White title for dark background */
}

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

.page-news__article-card {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-news__article-card:hover {
  transform: translateY(-5px);
}

.page-news__article-image-wrapper {
  width: 100%;
  height: 200px; /* Fixed height for consistent card image appearance */
  overflow: hidden;
}

.page-news__article-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.page-news__article-date {
  font-size: 0.875rem;
  color: #666666;
  margin-bottom: 10px;
  display: block; /* Ensure time element is block for proper spacing */
}

.page-news__article-title {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 15px;
  flex-grow: 1; /* Allow title to take available space */
}

.page-news__article-title a {
  color: #017439; /* Brand color for article titles */
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-news__article-title a:hover {
  color: #005a2e;
}

.page-news__article-excerpt {
  font-size: 1rem;
  color: #555555;
  margin-bottom: 20px;
}

.page-news__read-more {
  display: inline-block;
  color: #017439;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.page-news__read-more:hover {
  color: #005a2e;
  text-decoration: underline;
}

.page-news__view-all-button-wrapper {
  text-align: center;
  margin-top: 30px;
}

/* Promotion CTA Section */
.page-news__promo-cta {
  background-color: #017439; /* Brand color dark background */
  padding: 80px 0;
  text-align: center;
  color: #ffffff; /* White text for dark background */
}

.page-news__description--light {
  color: #f0f0f0;
}

/* Benefits Section */
.page-news__benefits-section {
  padding: 80px 0;
  background-color: #f8f8f8; /* Light grey background */
  color: #333333;
}

.page-news__benefits-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  list-style: none;
  padding: 0;
  margin-bottom: 50px;
}

.page-news__benefit-item {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 30px;
  text-align: center;
}

.page-news__benefit-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #017439;
  margin-bottom: 15px;
}

.page-news__benefit-description {
  font-size: 0.95rem;
  color: #555555;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .page-news__container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-news__hero-section {
    padding-top: 10px !important; /* body handles --header-offset */
    padding-bottom: 40px;
  }

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

  .page-news__description {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .page-news__cta-buttons {
    flex-direction: column;
    gap: 10px;
    max-width: 100%;
  }

  .page-news__btn-primary,
  .page-news__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 15px !important;
    font-size: 0.95rem !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-news__latest-articles,
  .page-news__promo-cta,
  .page-news__benefits-section {
    padding: 40px 0;
  }

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

  .page-news__articles-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-news__article-card {
    margin-bottom: 20px;
  }

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

  .page-news__article-title {
    font-size: 1.2rem;
  }

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

  /* Image responsive rules for mobile */
  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-news__hero-image-wrapper,
  .page-news__article-image-wrapper,
  .page-news__container,
  .page-news__articles-grid,
  .page-news__benefits-list,
  .page-news__cta-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important; /* Prevent content overflow */
  }

  /* Specific padding for sections on mobile to prevent overflow */
  .page-news__hero-section,
  .page-news__latest-articles,
  .page-news__promo-cta,
  .page-news__benefits-section {
    padding-left: 0;
    padding-right: 0;
  }
}