/* Base styles for the FAQ page */
.page-faq {
  font-family: 'Arial', sans-serif;
  color: #333333; /* Default dark text for light body background */
  background-color: #FFFFFF; /* Explicitly set for clarity */
  line-height: 1.6;
  padding-bottom: 40px;
}

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

/* Hero Section */
.page-faq__hero-section {
  position: relative;
  background-color: #017439; /* Primary color for hero background */
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  padding-bottom: 40px;
  color: #ffffff;
  display: flex;
  flex-direction: column; /* Ensure image is above text */
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden; /* For images */
}

.page-faq__hero-image-container {
  width: 100%;
  max-height: 400px; /* Limit hero image height */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

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

.page-faq__hero-content {
  max-width: 900px;
  padding: 0 15px;
  z-index: 1; /* Ensure text is above any potential background elements */
}

.page-faq__main-title {
  font-size: 38px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 15px;
  color: #FFFFFF;
  line-height: 1.2;
}

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

/* CTA Buttons */
.page-faq__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 30px;
  width: 100%;
  max-width: 400px; /* Limit button group width */
  margin-left: auto;
  margin-right: auto;
}

.page-faq__btn-primary,
.page-faq__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  flex-grow: 1;
  max-width: 200px; /* Max width for individual buttons */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-faq__btn-primary {
  background-color: #C30808; /* Register/Login color */
  color: #FFFF00; /* Register/Login font color */
  border: 2px solid #C30808;
}

.page-faq__btn-primary:hover {
  background-color: #a00606;
  border-color: #a00606;
}

.page-faq__btn-secondary {
  background-color: transparent;
  color: #FFFFFF;
  border: 2px solid #FFFFFF;
}

.page-faq__btn-secondary:hover {
  background-color: #FFFFFF;
  color: #017439;
}

/* Content Sections */
.page-faq__content-section {
  padding: 60px 0;
  background-color: #FFFFFF;
}

.page-faq__dark-section {
  background-color: #017439;
  color: #ffffff;
}

.page-faq__dark-section .page-faq__section-title {
  color: #ffffff;
}

.page-faq__dark-section .page-faq__description,
.page-faq__dark-section p {
  color: #f0f0f0;
}

.page-faq__section-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  color: #017439;
}

/* FAQ List */
.page-faq__faq-list {
  max-width: 900px;
  margin: 0 auto;
}

details.page-faq__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

details.page-faq__faq-item summary.page-faq__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;
  font-size: 18px;
  font-weight: 600;
  color: #333333;
}
details.page-faq__faq-item summary.page-faq__faq-question::-webkit-details-marker {
  display: none; /* Hide default marker for Webkit browsers */
}
details.page-faq__faq-item summary.page-faq__faq-question:hover {
  background: #f5f5f5;
}

.page-faq__faq-qtext {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: #333333; /* Ensure contrast on white background */
}

details.page-faq__faq-item.page-faq__dark-section summary.page-faq__faq-question {
  background-color: #017439;
  color: #ffffff;
}
details.page-faq__faq-item.page-faq__dark-section summary.page-faq__faq-question:hover {
  background-color: #00602e;
}
details.page-faq__faq-item.page-faq__dark-section .page-faq__faq-qtext {
  color: #ffffff;
}
details.page-faq__faq-item.page-faq__dark-section .page-faq__faq-toggle {
  color: #ffffff;
}


.page-faq__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  color: #666; /* Default color for toggle */
  flex-shrink: 0;
  margin-left: 15px;
  width: 28px;
  text-align: center;
}

details.page-faq__faq-item[open] .page-faq__faq-toggle {
  color: #017439; /* Color when open */
}

details.page-faq__faq-item .page-faq__faq-answer {
  padding: 0 20px 20px;
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
  color: #555555;
  font-size: 16px;
}

details.page-faq__faq-item.page-faq__dark-section .page-faq__faq-answer {
  background: #00602e;
  color: #e0e0e0;
}


/* Image and Text Section */
.page-faq__image-text-section {
  padding: 60px 0;
}

.page-faq__image-text-wrapper {
  display: flex;
  align-items: center;
  gap: 40px;
}

.page-faq__image-text-section.page-faq__reverse-layout .page-faq__image-text-wrapper {
  flex-direction: row-reverse;
}

.page-faq__image-text-section .page-faq__text-content {
  flex: 1;
}

.page-faq__image-text-section .page-faq__image-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.page-faq__image-text-section .page-faq__image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  display: block;
}

/* Contact CTA Section */
.page-faq__contact-cta {
  background-color: #f5f5f5;
  padding: 80px 0;
  text-align: center;
}

.page-faq__contact-cta .page-faq__section-title {
  color: #017439;
  margin-bottom: 20px;
}

.page-faq__contact-description {
  font-size: 18px;
  max-width: 800px;
  margin: 0 auto 40px;
  color: #555555;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 1024px) {
  .page-faq__main-title {
    font-size: 32px;
  }
  .page-faq__section-title {
    font-size: 28px;
  }
  .page-faq__description,
  .page-faq__faq-qtext,
  .page-faq__faq-answer p,
  .page-faq__contact-description {
    font-size: 16px;
  }
  .page-faq__btn-primary,
  .page-faq__btn-secondary {
    padding: 12px 24px;
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  /* 1. Top Section / Hero Section */
  .page-faq__hero-section {
    padding-top: 10px; /* Ensure small top padding */
    padding-bottom: 30px;
  }
  .page-faq__hero-image-container {
    max-height: 250px;
    margin-bottom: 15px;
  }
  .page-faq__hero-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-faq__main-title {
    font-size: 28px;
  }
  .page-faq__description {
    font-size: 15px;
  }

  /* 2. Dual-column modules (image-text-section) */
  .page-faq__image-text-wrapper {
    flex-direction: column;
    gap: 30px;
  }
  .page-faq__image-text-section.page-faq__reverse-layout .page-faq__image-text-wrapper {
    flex-direction: column; /* Consistent column layout on mobile */
  }
  .page-faq__image-text-section .page-faq__image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* 3. General images and containers */
  .page-faq img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  .page-faq__container,
  .page-faq__content-section,
  .page-faq__image-text-section,
  .page-faq__contact-cta {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-faq__content-section,
  .page-faq__image-text-section,
  .page-faq__contact-cta {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  /* 4. Buttons */
  .page-faq__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    max-width: 100%;
    padding: 0 15px;
  }
  .page-faq__btn-primary,
  .page-faq__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    padding: 12px 15px !important;
    font-size: 16px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
  }

  /* FAQ specific mobile styles */
  details.page-faq__faq-item summary.page-faq__faq-question {
    padding: 15px;
    font-size: 16px;
  }
  .page-faq__faq-qtext {
    font-size: 16px;
  }
  .page-faq__faq-toggle {
    font-size: 20px;
    width: 24px;
    margin-left: 10px;
  }
  details.page-faq__faq-item .page-faq__faq-answer {
    padding: 0 15px 15px;
  }
  .page-faq__faq-answer p {
    font-size: 15px;
  }
  .page-faq__section-title {
    font-size: 24px;
    margin-bottom: 30px;
  }
  .page-faq__contact-description {
    font-size: 15px;
  }
}