/* style/news.css */

/* --- Base Styles & Layout --- */
.page-news {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333333; /* Default dark text for light body background */
  background-color: var(--secondary-color); /* Assumes shared.css sets body background to --secondary-color (#FFFFFF) */
}

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

.page-news__section-title {
  font-size: 36px;
  font-weight: 700;
  color: #017439; /* Primary color for titles */
  text-align: center;
  margin-bottom: 40px;
  padding-top: 40px;
}

/* --- 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: 10px; /* Small top padding, body handles --header-offset */
  background-color: #f8f8f8; /* Light background for hero section */
}

.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%; /* Ensure it takes full width within max-width */
}

.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;
  border-radius: 12px; /* Consistent with container */
}

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

.page-news__main-title {
  font-size: clamp(2.5rem, 4vw, 3.5rem); /* Using clamp for responsive font size, not fixed large value */
  font-weight: 800;
  color: #017439; /* Primary color */
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-news__description {
  font-size: 18px;
  color: #555555;
  margin-bottom: 30px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.page-news__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: #C30808; /* Custom color for register/login */
  color: #FFFF00; /* Custom font color for register/login */
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 10px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(195, 8, 8, 0.3);
}

.page-news__cta-button:hover {
  background: #a00606;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(195, 8, 8, 0.4);
}

/* --- Articles Section --- */
.page-news__articles-section {
  padding: 80px 0;
  background-color: var(--secondary-color); /* Light background */
}

.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: 12px;
  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(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

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

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

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

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

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

.page-news__article-title a:hover {
  color: #005f2e; /* Slightly darker primary on hover */
}

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

.page-news__article-summary {
  font-size: 16px;
  color: #555555;
  margin-bottom: 20px;
  flex-grow: 1; /* Pushes button to bottom */
}

.page-news__read-more-btn {
  display: inline-block;
  padding: 10px 20px;
  background: #017439; /* Primary color */
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.3s ease;
  align-self: flex-start;
}

.page-news__read-more-btn:hover {
  background: #005f2e;
}

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

.page-news__view-all-btn {
  display: inline-block;
  padding: 12px 30px;
  background: #017439; /* Primary color */
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.page-news__view-all-btn:hover {
  background: #005f2e;
  transform: translateY(-2px);
}

/* --- CTA Section --- */
.page-news__cta-section {
  padding: 80px 0;
  background-color: #017439; /* Dark background */
  color: #ffffff; /* Light text */
  text-align: center;
}

.page-news__cta-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.page-news__cta-content {
  flex: 1;
  min-width: 300px;
  max-width: 600px;
  text-align: left;
}

.page-news__cta-title {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 20px;
  line-height: 1.3;
}

.page-news__cta-description {
  font-size: 18px;
  color: #f0f0f0;
  margin-bottom: 30px;
}

.page-news__cta-image {
  flex-shrink: 0;
  width: 500px; /* Example fixed width */
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

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

/* --- FAQ Section --- */
.page-news__faq-section {
  padding: 80px 0;
  background-color: #f9f9f9; /* Light background */
}

.page-news__faq-list {
  max-width: 800px;
  margin: 0 auto;
}

details.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
details.page-news__faq-item summary.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  list-style: none; /* Hide default marker */
  transition: background-color 0.3s ease;
}
details.page-news__faq-item summary.page-news__faq-question::-webkit-details-marker {
  display: none; /* Hide default marker for Webkit browsers */
}
details.page-news__faq-item summary.page-news__faq-question:hover {
  background: #f5f5f5;
}
.page-news__faq-qtext {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: #333333;
}
.page-news__faq-toggle {
  font-size: 28px; /* Larger icon */
  font-weight: bold;
  color: #017439; /* Primary color for toggle icon */
  flex-shrink: 0;
  margin-left: 15px;
  width: 32px; /* Ensure sufficient touch area */
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
details.page-news__faq-item .page-news__faq-answer {
  padding: 0 20px 20px;
  background: #fdfdfd;
  border-radius: 0 0 8px 8px;
  color: #555555;
  font-size: 16px;
}
details.page-news__faq-item .page-news__faq-answer p {
  margin-bottom: 10px;
}
details.page-news__faq-item .page-news__faq-answer a {
  color: #017439;
  text-decoration: underline;
}

/* --- Responsive Styles --- */
@media (max-width: 1024px) {
  .page-news__hero-image {
    margin-bottom: 20px;
  }
  .page-news__main-title {
    font-size: clamp(2rem, 3.5vw, 3rem);
  }
  .page-news__description {
    font-size: 17px;
  }
  .page-news__section-title {
    font-size: 30px;
  }
  .page-news__cta-flex {
    flex-direction: column;
  }
  .page-news__cta-content {
    text-align: center;
    margin-bottom: 30px;
  }
  .page-news__cta-image {
    width: 80%;
  }
}

@media (max-width: 768px) {
  .page-news {
    font-size: 16px;
    line-height: 1.6;
  }
  .page-news__container {
    padding: 0 15px !important; /* Important for mobile overflow */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Hero Section */
  .page-news__hero-section {
    padding: 40px 15px;
    padding-top: 10px !important; /* Small top padding for mobile */
  }
  .page-news__hero-image {
    border-radius: 8px;
  }
  .page-news__hero-image img {
    border-radius: 8px;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-news__main-title {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
    margin-bottom: 15px;
  }
  .page-news__description {
    font-size: 16px;
    margin-bottom: 25px;
  }
  .page-news__cta-button {
    padding: 12px 30px;
    font-size: 16px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Articles Section */
  .page-news__articles-section {
    padding: 50px 0;
  }
  .page-news__section-title {
    font-size: 26px;
    margin-bottom: 30px;
    padding-top: 20px;
  }
  .page-news__articles-grid {
    gap: 20px;
  }
  .page-news__article-image-wrapper {
    height: 180px; /* Adjust height for smaller screens */
  }
  .page-news__article-image-wrapper img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-news__article-content {
    padding: 20px;
  }
  .page-news__article-title {
    font-size: 18px;
  }
  .page-news__article-summary {
    font-size: 15px;
  }
  .page-news__read-more-btn {
    padding: 8px 15px;
    font-size: 14px;
  }
  .page-news__view-all-btn {
    padding: 10px 25px;
    font-size: 16px;
  }

  /* CTA Section */
  .page-news__cta-section {
    padding: 50px 15px;
  }
  .page-news__cta-title {
    font-size: 24px;
    margin-bottom: 15px;
  }
  .page-news__cta-description {
    font-size: 16px;
    margin-bottom: 25px;
  }
  .page-news__cta-image {
    width: 100%;
    margin-top: 30px;
  }
  .page-news__cta-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* FAQ Section */
  .page-news__faq-section {
    padding: 50px 15px;
  }
  details.page-news__faq-item summary.page-news__faq-question {
    padding: 15px;
  }
  .page-news__faq-qtext {
    font-size: 16px;
  }
  .page-news__faq-toggle {
    font-size: 24px;
    width: 28px;
    height: 28px;
  }
  details.page-news__faq-item .page-news__faq-answer {
    padding: 0 15px 15px;
    font-size: 15px;
  }
}

/* Ensure all images and containers are responsive and prevent overflow */
.page-news img {
  max-width: 100%;
  height: auto;
  display: block;
}

.page-news__section,
.page-news__card,
.page-news__container,
.page-news__articles-grid,
.page-news__cta-flex,
.page-news__faq-list {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden; /* Prevent content overflow */
}

/* Mobile specific overrides for images and containers to prevent overflow */
@media (max-width: 768px) {
  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-news__section,
  .page-news__card,
  .page-news__container,
  .page-news__articles-grid,
  .page-news__cta-flex,
  .page-news__faq-list {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Ensure buttons also adapt */
  .page-news__cta-button,
  .page-news__read-more-btn,
  .page-news__view-all-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;
  }
  
  /* If multiple buttons in a row, make them stack or wrap */
  .page-news__button-group { 
    display: flex;
    flex-direction: column !important;
    gap: 15px;
  }
}