/* General styles for the news page, scoped with .page-news */
.page-news {
  font-family: 'Arial', sans-serif;
  color: #333333; /* Default text color for light background */
  background-color: #f8f8f8; /* Light background for the page content */
  line-height: 1.6;
}

/* Hero Section */
.page-news__hero-section {
  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); /* Ensures content is not hidden by fixed header */
  background: linear-gradient(135deg, #e0f2f7, #ffffff); /* Light gradient background */
}

.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%;
  margin-bottom: 30px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

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

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

.page-news__main-title {
  font-size: 3.2em;
  color: #26A9E0;
  margin-bottom: 20px;
  font-weight: 700;
  line-height: 1.2;
}

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

.page-news__cta-button {
  display: inline-block;
  padding: 16px 45px;
  background: #26A9E0; /* Primary color */
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 6px 15px rgba(38, 169, 224, 0.3);
}

.page-news__cta-button:hover {
  background: #1e87c2; /* Slightly darker primary */
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(38, 169, 224, 0.4);
}

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

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

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

/* Latest Articles Section */
.page-news__latest-articles {
  padding: 80px 0;
  background-color: #ffffff;
}

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

.page-news__article-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px 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__article-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px 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: 1.4em;
  color: #26A9E0;
  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: #1e87c2;
}

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

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

.page-news__read-more-btn {
  display: inline-block;
  padding: 10px 20px;
  background: #26A9E0;
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 0.9em;
  font-weight: bold;
  align-self: flex-start;
  transition: background-color 0.3s ease;
}

.page-news__read-more-btn:hover {
  background: #1e87c2;
}

.page-news__pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 50px;
}

.page-news__pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #e0e0e0;
  color: #555555;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.page-news__pagination-link:hover {
  background-color: #d0d0d0;
  color: #333333;
}

.page-news__pagination-link--active {
  background-color: #26A9E0;
  color: #ffffff;
}

.page-news__pagination-link--active:hover {
  background-color: #1e87c2;
}

/* Categories Section */
.page-news__categories {
  padding: 80px 0;
  background-color: #26A9E0; /* Primary color as background */
  color: #ffffff; /* White text for contrast */
}

.page-news__categories .page-news__section-title {
  color: #ffffff; /* White title on primary background */
}

.page-news__categories .page-news__section-description {
  color: #f0f0f0; /* Light grey text on primary background */
}

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

.page-news__category-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-align: center;
  padding: 25px;
  text-decoration: none;
  color: #333333;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.page-news__category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.page-news__category-card img {
  width: 100%;
  
  height: auto;
  margin-bottom: 15px;
  border-radius: 8px;
  object-fit: cover;
}

.page-news__category-card h3 {
  font-size: 1.3em;
  color: #26A9E0;
  margin-bottom: 10px;
  font-weight: 600;
}

.page-news__category-card p {
  font-size: 0.95em;
  color: #555555;
}

/* CTA Section */
.page-news__cta-section {
  padding: 80px 0;
  background-color: #f0faff; /* Very light blue background */
}

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

.page-news__btn-primary,
.page-news__btn-secondary {
  display: inline-block;
  padding: 16px 40px;
  text-decoration: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  transition: all 0.3s ease;
  max-width: 100%; /* Ensure buttons don't overflow */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  text-align: center;
}

.page-news__btn-primary {
  background: #26A9E0; /* Primary color */
  color: #ffffff;
  border: 2px solid #26A9E0;
  box-shadow: 0 6px 15px rgba(38, 169, 224, 0.3);
}

.page-news__btn-primary:hover {
  background: #1e87c2;
  border-color: #1e87c2;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(38, 169, 224, 0.4);
}

.page-news__btn-secondary {
  background: #ffffff;
  color: #26A9E0; /* Primary color for text */
  border: 2px solid #26A9E0;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.page-news__btn-secondary:hover {
  background: #e0f2f7;
  color: #1e87c2;
  border-color: #1e87c2;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-news__main-title {
    font-size: 2.8em;
  }
  .page-news__section-title {
    font-size: 2em;
  }
}

@media (max-width: 768px) {
  .page-news {
    font-size: 15px;
    line-height: 1.5;
  }

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

  .page-news__hero-image {
    margin-bottom: 20px;
    border-radius: 8px;
  }
  
  .page-news__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-news__main-title {
    font-size: 2.2em;
    margin-bottom: 15px;
  }

  .page-news__intro-description {
    font-size: 1em;
    margin-bottom: 20px;
  }

  .page-news__cta-button {
    padding: 12px 30px;
    font-size: 1em;
    max-width: 100% !important;
    width: 100% !important;
  }

  .page-news__container {
    padding: 30px 15px;
  }

  .page-news__section-title {
    font-size: 1.8em;
    margin-bottom: 15px;
  }

  .page-news__section-description {
    font-size: 1em;
    margin-bottom: 30px;
  }

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

  .page-news__article-card {
    border-radius: 8px;
  }

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

  .page-news__article-content {
    padding: 20px;
  }

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

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

  .page-news__category-card {
    padding: 20px;
    border-radius: 8px;
  }

  .page-news__category-card img {
    
  }

  .page-news__cta-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .page-news__btn-primary,
  .page-news__btn-secondary {
    padding: 14px 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;
    margin: 0 auto; /* Center buttons if flex-direction column */
  }
  
  /* Ensure all image containers are responsive */
  .page-news__section, /* Generic section class if used */
  .page-news__card, /* Generic card class if used */
  .page-news__container, 
  .page-news__hero-container,
  .page-news__article-card,
  .page-news__category-card,
  .page-news__cta-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Ensure all images within .page-news adhere to responsive rules */
.page-news img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Color Contrast Safeguards */
.page-news__dark-bg {
  background: #26A9E0;
  color: #ffffff;
}

.page-news__dark-bg .page-news__section-title,
.page-news__dark-bg .page-news__section-description,
.page-news__dark-bg .page-news__article-title a,
.page-news__dark-bg .page-news__category-card h3,
.page-news__dark-bg .page-news__category-card p {
  color: #ffffff;
}

.page-news__light-bg {
  background: #ffffff;
  color: #333333;
}

/* Ensure content area images are not smaller than 200px */
.page-news__article-card img, .page-news__category-card img {
  min-width: 200px;
  min-height: 200px;
}

@media (max-width: 768px) {
  .page-news__article-card img, .page-news__category-card img {
    min-width: unset;
    min-height: unset;
  }
}