/* style/resources.css */

/* Custom CSS Variables for this page */
:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --text-color-dark: #333333;
  --text-color-light: #ffffff;
  --background-light: #f5f5f5; /* A slightly off-white for sections */
  --register-bg: #C30808;
  --login-bg: #C30808;
  --register-login-text: #FFFF00;
}

/* Base styles for the page content */
.page-resources {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color-dark); /* Default text color for light backgrounds */
  background: var(--secondary-color); /* Body background from shared.css is likely white/light */
  padding-top: var(--header-offset, 120px); /* Ensure content is not hidden by fixed header */
}

/* Sections styling */
.page-resources__section {
  padding: 60px 20px;
  text-align: center;
}

.page-resources__light-bg {
  background-color: var(--background-light);
  color: var(--text-color-dark);
}

.page-resources__dark-section {
  background-color: var(--primary-color);
  color: var(--text-color-light); /* Light text for dark background */
}

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

.page-resources__section-title {
  font-size: 36px;
  margin-bottom: 20px;
  color: inherit; /* Inherit color from parent section (dark or light) */
  font-weight: bold;
}

.page-resources__sub-title {
  font-size: 24px;
  margin-top: 30px;
  margin-bottom: 15px;
  color: inherit;
  font-weight: 600;
}

.page-resources__text-block {
  margin-bottom: 20px;
  font-size: 17px;
}

.page-resources__text-block p {
  margin-bottom: 15px;
}

/* 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-color: var(--primary-color); /* Hero section has primary color background */
  color: var(--text-color-light); /* Light text for hero */
}

.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;
}

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

.page-resources__hero-title {
  font-size: 48px;
  margin-bottom: 15px;
  color: var(--text-color-light);
}

.page-resources__hero-description {
  font-size: 20px;
  margin-bottom: 30px;
  color: var(--text-color-light);
}

/* CTA Buttons */
.page-resources__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--register-bg); /* Use specific color for register/login buttons */
  color: var(--register-login-text); /* Use specific font color */
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 30px;
  transition: all 0.3s ease;
  max-width: 100%; /* Ensure button fits on mobile */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-resources__cta-button:hover {
  background: #a30707; /* Darken on hover */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-resources__link-button {
  display: inline-block;
  padding: 10px 25px;
  background: var(--primary-color);
  color: var(--text-color-light);
  text-decoration: none;
  border-radius: 5px;
  font-size: 16px;
  margin-top: 20px;
  transition: all 0.3s ease;
  max-width: 100%; /* Ensure button fits on mobile */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-resources__link-button:hover {
  background: #015e2e;
  transform: translateY(-1px);
}


/* Image with Text Block */
.page-resources__image-text-block {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-top: 40px;
  margin-bottom: 40px;
  text-align: left;
}

.page-resources__image-text-block--reverse {
  flex-direction: row-reverse;
}

.page-resources__image-wrapper {
  flex: 1;
  min-width: 200px; /* Minimum size for content images */
}

.page-resources__image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  min-width: 200px; /* Minimum size for content images */
  min-height: 200px; /* Minimum size for content images */
}

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

.page-resources__text-content h3 {
  margin-top: 0;
  color: var(--text-color-dark);
}

/* FAQ Section */
.page-resources__faq-list {
  max-width: 900px;
  margin: 40px auto 0 auto;
  text-align: left;
}

/* FAQ container style */
.page-resources__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* FAQ default state - answer 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;
  background-color: var(--background-light); /* Light background for answers */
  color: var(--text-color-dark);
}

/* FAQ expanded state - 🚨 Use!important and sufficiently large max-height */
.page-resources__faq-item.active .page-resources__faq-answer {
  max-height: 2000px !important; /* 🚨 Use!important ensure priority, value large enough to accommodate any content */
  padding: 20px 15px !important;
  opacity: 1;
  border-radius: 0 0 5px 5px;
}

/* Question style */
.page-resources__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--secondary-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;
  color: var(--text-color-dark);
}

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

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

/* Question title style */
.page-resources__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px; /* Slightly larger for better readability */
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 from blocking click events */
  color: inherit;
}

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

.page-resources__faq-item.active .page-resources__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Rotate to form 'X' or '-' */
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-resources__hero-title {
    font-size: 40px;
  }
  .page-resources__hero-description {
    font-size: 18px;
  }
  .page-resources__section-title {
    font-size: 30px;
  }
  .page-resources__sub-title {
    font-size: 22px;
  }
}

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

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

  .page-resources__hero-section {
    padding-top: var(--header-offset, 120px) !important;
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-resources__hero-title {
    font-size: 32px;
  }

  .page-resources__hero-description {
    font-size: 16px;
  }

  .page-resources__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;
    margin-left: auto;
    margin-right: auto;
  }

  .page-resources__link-button {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    margin-left: auto;
    margin-right: auto;
  }

  .page-resources__section-title {
    font-size: 26px;
  }

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

  .page-resources__image-text-block {
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
  }

  .page-resources__image-text-block--reverse {
    flex-direction: column; /* Revert to column for mobile */
  }

  .page-resources__image-wrapper {
    width: 100%;
    min-width: unset;
  }

  .page-resources__image-wrapper img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-width: 200px; /* Enforce min-width even on mobile for content images */
    min-height: 200px; /* Enforce min-height even on mobile for content images */
  }

  /* FAQ mobile styles */
  .page-resources__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  
  .page-resources__faq-question h3 {
    font-size: 16px;
    width: calc(100% - 40px);
  }
  
  .page-resources__faq-toggle {
    margin-left: 10px;
    width: 28px;
    height: 28px;
    font-size: 24px;
  }
  
  .page-resources__faq-answer {
    padding: 0 15px;
  }
  
  .page-resources__faq-item.active .page-resources__faq-answer {
    padding: 15px !important;
  }

  /* Ensure all content containers are responsive */
  .page-resources__container,
  .page-resources__hero-container,
  .page-resources__hero-content,
  .page-resources__image-text-block,
  .page-resources__text-content,
  .page-resources__faq-list {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-resources__container {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Global image styling to prevent filter usage */
.page-resources img {
  filter: none !important; /* Absolutely prevent any filter usage */
}