/* style/resources.css */

/* Variables for custom colors */
:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --register-color: #C30808;
  --login-color: #C30808;
  --background-color: #FFFFFF;
  --register-login-font-color: #FFFF00;
}

/* Base Styles */
.page-resources {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default dark text for light body background */
  background: var(--background-color, #FFFFFF); /* Explicitly set for clarity, though body is default white */
  padding-top: var(--header-offset, 120px); /* Fixed header spacing */
}

/* Color Contrast Safeguards */
.page-resources__dark-bg {
  background-color: var(--primary-color);
  color: var(--secondary-color); /* White text on dark green background */
}

.page-resources__light-bg {
  background-color: var(--background-color);
  color: #333333; /* Dark text on white background */
}

.page-resources__light-text {
  color: var(--secondary-color);
}

/* Hero Section */
.page-resources__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, var(--primary-color), #009944); /* Using primary color for a subtle gradient */
}

.page-resources__hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page-resources__hero-image {
  width: 100%;
  margin-bottom: 30px;
}

.page-resources__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  min-width: 200px; /* Enforce min image size */
  min-height: 200px; /* Enforce min image size */
}

.page-resources__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
}

.page-resources__hero-content h1 {
  font-size: 3em;
  margin-bottom: 20px;
  color: var(--secondary-color);
}

.page-resources__hero-content p {
  font-size: 1.2em;
  margin-bottom: 30px;
  color: #f0f0f0;
}

/* Buttons */
.page-resources__cta-group {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.page-resources__btn-primary,
.page-resources__btn-secondary {
  display: inline-block;
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-sizing: border-box; /* Ensure padding doesn't expand button width */
  max-width: 100%; /* Ensure button doesn't overflow */
  white-space: normal; /* Allow text wrap */
  word-wrap: break-word; /* Allow text wrap */
}

.page-resources__btn-primary {
  background: var(--register-color);
  color: var(--register-login-font-color);
  border: 2px solid var(--register-color);
}

.page-resources__btn-primary:hover {
  background: #a30606; /* Darken register color */
  border-color: #a30606;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Specific style for buttons on dark backgrounds like hero section */
.page-resources__hero-section .page-resources__btn-primary {
  background: var(--register-color);
  color: var(--register-login-font-color);
  border: 2px solid var(--register-color);
}

.page-resources__hero-section .page-resources__btn-secondary {
  background: transparent;
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
}

.page-resources__btn-secondary {
  background: transparent;
  color: var(--primary-color); /* Primary color text on light background */
  border: 2px solid var(--primary-color); /* Primary color border on light background */
}

.page-resources__btn-secondary:hover {
  background: rgba(1, 116, 57, 0.1); /* Lighten primary color */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-resources__read-more-link {
  display: inline-block;
  margin-top: 15px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.page-resources__read-more-link:hover {
  color: #005f2e; /* Darken primary color */
  text-decoration: underline;
}

/* General Section Styles */
.page-resources__section {
  padding: 80px 20px;
  text-align: center;
}

.page-resources__content-area {
  max-width: 1200px;
  margin: 0 auto;
}

.page-resources__section-title {
  font-size: 2.5em;
  margin-bottom: 40px;
  color: var(--primary-color);
}

.page-resources__section-title.page-resources__light-text {
  color: var(--secondary-color);
}

/* Grid Layouts */
.page-resources__grid,
.page-resources__news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

/* Cards */
.page-resources__card,
.page-resources__news-card {
  background: var(--background-color);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 25px;
  text-align: left;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  min-width: 200px; /* Ensure card content is not too small */
}

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

.page-resources__card img,
.page-resources__news-card img {
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 4px;
  margin-bottom: 20px;
  object-fit: cover;
  min-width: 200px; /* Enforce min image size */
  min-height: 200px; /* Enforce min image size */
}

.page-resources__card-title,
.page-resources__news-title {
  font-size: 1.5em;
  margin-bottom: 15px;
  line-height: 1.3;
  flex-grow: 1; /* Allow title to take available space */
}

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

.page-resources__card-title a:hover,
.page-resources__news-title a:hover {
  color: var(--primary-color);
}

.page-resources__card p,
.page-resources__news-card p {
  font-size: 0.95em;
  color: #666666;
  margin-bottom: 15px;
}

/* Text with Image Layout */
.page-resources__text-with-image {
  display: flex;
  align-items: center;
  gap: 50px;
  text-align: left;
  margin-top: 40px;
}

.page-resources__text-with-image--reverse {
  flex-direction: row-reverse;
}

.page-resources__text-block {
  flex: 1;
}

.page-resources__image-block {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.page-resources__image-block img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  min-width: 200px; /* Enforce min image size */
  min-height: 200px; /* Enforce min image size */
}

.page-resources__sub-title {
  font-size: 1.8em;
  margin-top: 30px;
  margin-bottom: 15px;
  color: var(--secondary-color); /* For dark sections */
}

.page-resources__text-block p {
  margin-bottom: 20px;
  font-size: 1.05em;
}

/* FAQ Section */
.page-resources__faq-list {
  margin-top: 40px;
  text-align: left;
}

.page-resources__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

.page-resources__faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.4s ease;
  padding: 0 15px;
  opacity: 0;
}

.page-resources__faq-item.active .page-resources__faq-answer {
  max-height: 2000px !important; /* Ensure content can fully expand */
  padding: 20px 15px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

.page-resources__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--background-color);
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-resources__faq-question:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

.page-resources__faq-question:active {
  background: #eeeeee;
}

.page-resources__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 from blocking click event */
  color: #333333;
}

.page-resources__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #666;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Prevent icon from blocking click event */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-resources__faq-item.active .page-resources__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Optional: rotate for 'x' effect */
}


/* Final CTA */
.page-resources__final-cta {
  padding: 100px 20px;
}

.page-resources__center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page-resources__final-cta .page-resources__section-title {
  margin-bottom: 20px;
}

.page-resources__final-cta p {
  font-size: 1.2em;
  max-width: 800px;
  margin-bottom: 40px;
  line-height: 1.7;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-resources__hero-content h1 {
    font-size: 2.5em;
  }

  .page-resources__section-title {
    font-size: 2em;
  }

  .page-resources__text-with-image {
    flex-direction: column;
    gap: 30px;
  }

  .page-resources__text-with-image--reverse {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .page-resources {
    font-size: 16px;
    line-height: 1.6;
    padding-top: var(--header-offset, 120px) !important; /* Ensure mobile header offset */
  }

  /* Images responsive for mobile */
  .page-resources img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-width: 200px !important; /* Enforce min image size */
    min-height: 200px !important; /* Enforce min image size */
  }
  
  /* Image containers responsive for mobile */
  .page-resources__section,
  .page-resources__card,
  .page-resources__container,
  .page-resources__text-with-image,
  .page-resources__text-block,
  .page-resources__image-block,
  .page-resources__faq-list,
  .page-resources__news-grid,
  .page-resources__grid,
  .page-resources__hero-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden; /* Prevent horizontal scroll */
  }

  /* Hero Section Mobile */
  .page-resources__hero-section {
    padding-top: var(--header-offset, 120px) !important;
    padding-bottom: 40px;
  }
  
  .page-resources__hero-content h1 {
    font-size: 2em;
  }

  .page-resources__hero-content p {
    font-size: 1em;
  }

  /* Buttons responsive for mobile */
  .page-resources__cta-group {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
  }

  .page-resources__btn-primary,
  .page-resources__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    padding: 12px 20px;
    font-size: 16px;
  }
  
  /* Section titles */
  .page-resources__section-title {
    font-size: 1.8em;
    margin-bottom: 30px;
  }

  .page-resources__sub-title {
    font-size: 1.5em;
  }

  /* Cards responsive for mobile */
  .page-resources__grid,
  .page-resources__news-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .page-resources__card,
  .page-resources__news-card {
    padding: 20px;
  }

  .page-resources__card-title,
  .page-resources__news-title {
    font-size: 1.3em;
  }
  
  /* FAQ Mobile */
  .page-resources__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  
  .page-resources__faq-question h3 {
    font-size: 15px;
    margin-bottom: 0;
    width: calc(100% - 40px);
  }
  
  .page-resources__faq-toggle {
    margin-left: 10px;
    width: 24px;
    height: 24px;
    font-size: 20px;
  }
  
  .page-resources__faq-answer {
    padding: 0 15px;
  }
  
  .page-resources__faq-item.active .page-resources__faq-answer {
    padding: 15px !important;
  }
  
  .page-resources__final-cta {
    padding: 60px 15px;
  }
  
  .page-resources__final-cta p {
    font-size: 1em;
  }
}

/* Ensure content area does not cause horizontal scroll */
.page-resources__content-area {
  overflow-x: hidden;
}