/* style/resources.css */
:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --text-dark: #333333;
  --text-light: #ffffff;
  --background-light: #ffffff;
  --background-dark: #017439;
  --button-register-login: #C30808;
  --button-register-login-text: #FFFF00;
  --border-color: #e0e0e0;
}

.page-resources {
  font-family: 'Arial', sans-serif;
  color: var(--text-dark); /* Default text color for light background */
  background: var(--background-light); /* Body background is light */
}

/* 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;
  padding-top: var(--header-offset, 120px); /* Ensure content is below fixed header */
  background: linear-gradient(135deg, var(--primary-color), var(--primary-color) 30%, #00a04a); /* Gradient with brand color */
  color: var(--text-light);
  overflow: hidden; /* Prevent image overflow */
}

.page-resources__hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1; /* Ensure content is above any potential background layers */
}

.page-resources__hero-image-main {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.page-resources__main-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
  color: var(--text-light);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-resources__intro-text {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 40px;
  color: var(--text-light);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.page-resources__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.page-resources__cta-button {
  display: inline-block;
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-resources__btn-primary {
  background: var(--button-register-login); /* Use specific register/login color */
  color: var(--button-register-login-text); /* Use specific register/login text color */
  border: 2px solid var(--button-register-login);
}

.page-resources__btn-primary:hover {
  background: #a30707; /* Darken on hover */
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

.page-resources__btn-secondary:hover {
  background: #c3e0ce; /* Lighten on hover */
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

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

.page-resources__section--guides {
  background: #f9f9f9;
}

.page-resources__section--faq {
  background: var(--background-dark); /* Dark background for FAQ */
  color: var(--text-light);
}

.page-resources__section--news {
  background: var(--background-light);
}

.page-resources__section--cta {
  background: linear-gradient(90deg, var(--primary-color), #00a04a);
  color: var(--text-light);
}

.page-resources__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.page-resources__section-title {
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.page-resources__section--faq .page-resources__section-title {
  color: var(--text-light);
}

.page-resources__section-description {
  font-size: 17px;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto 50px auto;
  color: var(--text-dark);
}

.page-resources__section-description--light {
  color: var(--text-light);
}

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

.page-resources__card {
  background: var(--background-light);
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-resources__card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.page-resources__card-image {
  width: 100%;
  height: 250px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
}

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

.page-resources__card-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 15px;
  line-height: 1.3;
}

.page-resources__card-title a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-resources__card-title a:hover {
  color: #005c2e;
}

.page-resources__card-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dark);
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-resources__card-link {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
  margin-top: auto; /* Push link to bottom */
}

.page-resources__card-link:hover {
  color: #005c2e;
  text-decoration: underline;
}

/* FAQ Styles */
.page-resources__faq-list {
  margin-top: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-resources__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--background-light);
  color: var(--text-dark); /* Ensure dark text on light background */
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.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 25px;
  opacity: 0;
  color: var(--text-dark);
  background: #fdfdfd; /* Slightly different background for answer */
}

.page-resources__faq-item.active .page-resources__faq-answer {
  max-height: 2000px !important; /* 🚨 Ensure it expands fully */
  padding: 20px 25px !important;
  opacity: 1;
  border-top: 1px solid var(--border-color);
}

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

.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: 18px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 from blocking click */
  color: var(--primary-color); /* FAQ question title color */
}

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

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

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

.page-resources__news-item {
  background: var(--background-light);
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-resources__news-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.page-resources__news-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

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

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

.page-resources__news-title a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-resources__news-title a:hover {
  color: #005c2e;
}

.page-resources__news-date {
  font-size: 14px;
  color: #888;
  margin-bottom: 15px;
}

.page-resources__news-excerpt {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dark);
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-resources__news-link {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
  margin-top: auto;
}

.page-resources__news-link:hover {
  color: #005c2e;
  text-decoration: underline;
}

.page-resources__view-all-news {
  margin-top: 50px;
}

/* CTA Banner Section */
.page-resources__cta-banner {
  padding: 60px 30px;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.page-resources__cta-title {
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-light);
}

.page-resources__cta-description {
  font-size: 18px;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto 40px auto;
  color: var(--text-light);
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-resources__main-title {
    font-size: 40px;
  }
  .page-resources__section-title {
    font-size: 32px;
  }
  .page-resources__cta-title {
    font-size: 32px;
  }
}

@media (max-width: 768px) {
  .page-resources__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Mobile header offset */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-resources__hero-image-main {
    border-radius: 4px;
    margin-bottom: 20px;
  }
  .page-resources__main-title {
    font-size: 32px;
    margin-bottom: 15px;
  }
  .page-resources__intro-text {
    font-size: 16px;
    margin-bottom: 30px;
  }
  .page-resources__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-resources__cta-button {
    padding: 12px 25px;
    font-size: 16px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  .page-resources__section {
    padding: 50px 15px;
  }
  .page-resources__section-title {
    font-size: 28px;
  }
  .page-resources__section-description {
    font-size: 15px;
    margin-bottom: 30px;
  }
  .page-resources__card-grid,
  .page-resources__news-grid {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 25px;
  }
  .page-resources__card-image,
  .page-resources__news-image {
    height: 180px;
  }
  .page-resources__card-content,
  .page-resources__news-content {
    padding: 20px;
  }
  .page-resources__card-title,
  .page-resources__news-title {
    font-size: 18px;
  }
  .page-resources__card-text,
  .page-resources__news-excerpt {
    font-size: 14px;
  }

  /* FAQ Mobile */
  .page-resources__faq-list {
    margin-top: 30px;
  }
  .page-resources__faq-item {
    border-radius: 5px;
  }
  .page-resources__faq-question {
    padding: 15px 20px;
    flex-wrap: wrap;
  }
  .page-resources__faq-question h3 {
    font-size: 16px;
    width: calc(100% - 40px);
  }
  .page-resources__faq-toggle {
    margin-left: 10px;
    width: 24px;
    height: 24px;
    font-size: 22px;
  }
  .page-resources__faq-item.active .page-resources__faq-answer {
    padding: 15px 20px !important;
  }
  .page-resources__faq-answer {
    padding: 0 20px;
  }

  /* CTA Banner Mobile */
  .page-resources__cta-banner {
    padding: 40px 20px;
  }
  .page-resources__cta-title {
    font-size: 28px;
  }
  .page-resources__cta-description {
    font-size: 16px;
    margin-bottom: 30px;
  }

  /* Ensure all images are responsive */
  .page-resources img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  .page-resources__section,
  .page-resources__card,
  .page-resources__container,
  .page-resources__cta-buttons,
  .page-resources__news-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

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