/* style/news.css */

/* Base styles for the news page, ensuring text contrast with default light body background */
.page-news {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Dark text for light background */
  background-color: #ffffff; /* Explicitly set for clarity, though body is default white */
}

/* Hero Section */
.page-news__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column; /* Image on top, content below */
  align-items: center;
  padding: 10px 0 60px 0; /* Small top padding, larger bottom padding */
  text-align: center;
  overflow: hidden; /* Ensure no overflow */
}

.page-news__hero-image-wrapper {
  width: 100%;
  max-width: 1920px; /* Max width for large screens */
  margin-bottom: 30px; /* Space between image and content */
}

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

.page-news__hero-content {
  max-width: 900px;
  padding: 0 20px;
  box-sizing: border-box;
}

.page-news__main-title {
  font-size: clamp(2.2rem, 4vw, 3.2rem); /* Responsive font size for H1 */
  font-weight: 700;
  line-height: 1.2;
  color: #26A9E0; /* Brand color for H1 */
  margin-bottom: 20px;
}

.page-news__description {
  font-size: 1.1rem;
  margin-bottom: 30px;
  color: #555555;
}

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

.page-news__btn-primary,
.page-news__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text breaking */
  box-sizing: border-box;
  max-width: 100%; /* Ensure button doesn't overflow */
}

.page-news__btn-primary {
  background-color: #26A9E0;
  color: #ffffff;
  border: 2px solid #26A9E0;
}

.page-news__btn-primary:hover {
  background-color: #1f8ec4;
  border-color: #1f8ec4;
}

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

.page-news__btn-secondary:hover {
  background-color: #f0f8ff;
  color: #26A9E0;
  border-color: #1f8ec4;
}

/* Latest Articles Section */
.page-news__latest-articles {
  padding: 60px 0;
  background-color: #f8f9fa; /* Light background for this section */
}

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

.page-news__section-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  color: #26A9E0;
  text-align: center;
  margin-bottom: 40px;
}

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

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

.page-news__article-card {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  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 6px 20px rgba(0, 0, 0, 0.1);
}

.page-news__article-image-wrapper {
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  position: relative;
  overflow: hidden;
}

.page-news__article-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-news__article-content {
  padding: 20px;
  flex-grow: 1; /* Allows content to fill available space */
  display: flex;
  flex-direction: column;
}

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

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

.page-news__article-title a:hover {
  color: #26A9E0;
}

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

.page-news__article-excerpt {
  font-size: 1rem;
  color: #555555;
  margin-bottom: 20px;
  flex-grow: 1; /* Allows excerpt to push read more button to bottom */
}

.page-news__read-more {
  display: inline-block;
  color: #26A9E0;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
  align-self: flex-start; /* Aligns to the start of the flex container */
}

.page-news__read-more:hover {
  text-decoration: underline;
  color: #1f8ec4;
}

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

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

.page-news__description--white {
  color: #ffffff;
  max-width: 800px;
  margin: 0 auto 40px auto;
}

.page-news__btn-primary--white {
  background-color: #ffffff;
  color: #26A9E0;
  border-color: #ffffff;
}

.page-news__btn-primary--white:hover {
  background-color: #f0f8ff;
  color: #26A9E0;
  border-color: #f0f8ff;
}

/* Responsive styles */
@media (max-width: 992px) {
  .page-news__hero-section {
    padding-bottom: 40px;
  }

  .page-news__main-title {
    font-size: clamp(2rem, 5vw, 2.8rem);
  }

  .page-news__description {
    font-size: 1rem;
  }

  .page-news__latest-articles {
    padding: 40px 0;
  }

  .page-news__section-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    margin-bottom: 30px;
  }

  .page-news__cta-section {
    padding: 60px 20px;
  }
}

@media (max-width: 768px) {
  .page-news__hero-section {
    padding-top: 10px !important; /* Small top padding, body handles header offset */
    padding-bottom: 30px;
  }

  .page-news__hero-content {
    padding: 0 15px;
  }

  .page-news__main-title {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
  }

  .page-news__description {
    font-size: 0.95rem;
  }

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

  .page-news__btn-primary,
  .page-news__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 20px;
    font-size: 1rem;
  }

  .page-news__latest-articles {
    padding: 30px 0;
  }

  .page-news__container {
    padding: 0 15px !important; /* Add padding to container on mobile */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important; /* Prevent horizontal scroll */
  }

  .page-news__section-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: 25px;
  }

  .page-news__article-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }

  .page-news__article-image-wrapper {
    padding-bottom: 66.66%; /* Adjust aspect ratio for better mobile viewing if needed, e.g., 3:2 */
  }

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

  .page-news__article-excerpt {
    font-size: 0.9rem;
  }

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

  .page-news img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* Ensure all containers with images also adapt */
  .page-news__hero-image-wrapper,
  .page-news__article-image-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
}

/* Ensure no filter on images */
.page-news img {
  filter: none !important;
}