/* 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 background */
  background-color: #ffffff; /* Explicitly set for clarity, aligns with default body */
  padding-top: var(--header-offset, 120px); /* Ensure content is below fixed header */
}

/* Section padding */
.page-news__section-padding {
  padding: 60px 20px;
}

/* Container for content width */
.page-news__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px; /* Inner padding for responsiveness */
}

/* Section titles and subtitles */
.page-news__section-title {
  font-size: 36px;
  color: #017439; /* Primary brand color for titles */
  text-align: center;
  margin-bottom: 15px;
  font-weight: bold;
}

.page-news__section-subtitle {
  font-size: 18px;
  color: #555555;
  text-align: center;
  margin-bottom: 40px;
}

/* Color contrast adjustments for sections */
.page-news__light-bg {
  background-color: #ffffff;
  color: #333333;
}

.page-news__dark-bg {
  background-color: #017439;
  color: #ffffff; /* White text for dark primary background */
}

/* 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;
  background: linear-gradient(135deg, #017439, #3498db); /* Example gradient, can be adjusted */
  overflow: hidden; /* Prevent content 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%;
}

.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;
  min-width: 200px; /* Minimum image size */
  min-height: 200px; /* Minimum image size */
}

.page-news__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  color: #ffffff; /* White text for hero content */
}

.page-news__hero-content h1 {
  font-size: 48px;
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-news__hero-description {
  font-size: 20px;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-news__hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  width: 100%; /* Ensure container takes full width */
}

.page-news__cta-button {
  display: inline-block;
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  max-width: 100%; /* Ensure button fits container */
  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-register {
  background: #C30808; /* Custom color for register */
  color: #FFFF00; /* Custom font color for register */
  border: 2px solid transparent;
}

.page-news__btn-register:hover {
  background: #a30606;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-news__btn-download {
  background: #017439; /* Primary color for download */
  color: #ffffff; /* White text for download */
  border: 2px solid transparent;
}

.page-news__btn-download:hover {
  background: #005a2e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Latest Articles Section */
.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: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-news__article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.page-news__article-card img {
  width: 100%;
  height: 225px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
  min-width: 200px; /* Minimum image size */
  min-height: 200px; /* Minimum image size */
}

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

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

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

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

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

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

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

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

/* Featured Articles Section */
.page-news__featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

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

.page-news__featured-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.page-news__featured-card img {
  width: 40%;
  height: auto;
  object-fit: cover;
  display: block;
  min-width: 200px; /* Minimum image size */
  min-height: 200px; /* Minimum image size */
}

.page-news__featured-content {
  width: 60%;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.page-news__featured-title {
  font-size: 28px;
  margin-bottom: 15px;
  line-height: 1.3;
}

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

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

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

.page-news__featured-excerpt {
  font-size: 17px;
  color: #555555;
  margin-bottom: 25px;
}

/* Categories Section */
.page-news__categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.page-news__category-card {
  display: block;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 25px;
  text-align: center;
  text-decoration: none;
  color: #333333;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.page-news__category-card:hover {
  background-color: #f0f0f0;
  border-color: #d0d0d0;
  transform: translateY(-3px);
}

.page-news__category-title {
  font-size: 24px;
  color: #017439;
  margin-bottom: 10px;
}

.page-news__category-description {
  font-size: 15px;
  color: #555555;
}

/* CTA Section */
.page-news__cta-section {
  text-align: center;
  background-color: #017439; /* Primary brand color for dark background */
  color: #ffffff; /* White text */
}

.page-news__cta-content {
  padding: 40px 15px; /* Adjust padding for content inside CTA */
}

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

.page-news__cta-content .page-news__section-subtitle {
  color: #f0f0f0; /* Light grey subtitle for dark background */
  margin-bottom: 40px;
}

.page-news__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Allow buttons to wrap */
  width: 100%; /* Ensure container takes full width */
}

/* Primary and Secondary buttons */
.page-news__btn-primary {
  background: #C30808; /* Custom color for register */
  color: #FFFF00; /* Custom font color for register */
  border: 2px solid transparent;
}

.page-news__btn-primary:hover {
  background: #a30606;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-news__btn-secondary {
  background: #ffffff;
  color: #017439; /* Use brand color for text */
  border: 2px solid #017439;
}

.page-news__btn-secondary:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .page-news {
    font-size: 16px;
    line-height: 1.6;
    padding-top: var(--header-offset, 120px) !important; /* Ensure content is below fixed header on mobile */
  }

  .page-news__section-padding {
    padding: 40px 15px;
  }

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

  .page-news__section-subtitle {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .page-news__hero-section {
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 40px;
  }

  .page-news__hero-content h1 {
    font-size: 36px;
  }

  .page-news__hero-description {
    font-size: 18px;
  }

  .page-news__hero-buttons,
  .page-news__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    padding: 0 15px; /* Add padding to button container */
  }

  .page-news__cta-button {
    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__articles-grid,
  .page-news__categories-grid {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 20px;
  }

  .page-news__article-card img,
  .page-news__featured-card img {
    height: 200px; /* Adjust height for mobile */
    min-width: 200px !important;
    min-height: 200px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

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

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

  .page-news__featured-card {
    flex-direction: column; /* Stack image and content vertically */
  }

  .page-news__featured-card img,
  .page-news__featured-content {
    width: 100%; /* Full width for stacked elements */
  }

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

  .page-news__featured-title {
    font-size: 24px;
  }

  /* Image responsive rules for all images within .page-news */
  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    box-sizing: border-box !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;
  }

  .page-news__cta-content {
    padding: 30px 15px;
  }
}