/* style/faq.css */

/* Base styles for the FAQ page */
.page-faq {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light background */
  background-color: #FFFFFF; /* Explicitly set body background for clarity */
  overflow-x: hidden; /* Prevent horizontal scroll on content */
}

/* Hero Section */
.page-faq__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  min-height: 500px; /* Ensure sufficient height */
  overflow: hidden;
  padding-top: var(--header-offset, 120px); /* Fixed header spacing */
}

.page-faq__hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9); /* Semi-transparent white background for text readability */
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-faq__hero-title {
  font-size: 2.8em;
  color: #017439; /* Brand color for title */
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-faq__hero-description {
  font-size: 1.1em;
  margin-bottom: 30px;
  color: #333333;
}

.page-faq__hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.page-faq__hero-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.page-faq__hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7); /* Slightly darken image for text contrast */
}

/* Common Section Styles */
.page-faq__content-section {
  padding: 60px 20px;
}

.page-faq__light-bg {
  background-color: #FFFFFF;
  color: #333333;
}

.page-faq__dark-bg {
  background-color: #017439; /* Primary brand color for dark sections */
  color: #FFFFFF; /* White text for contrast */
}

.page-faq__container {
  max-width: 1000px;
  margin: 0 auto;
}

.page-faq__section-title {
  font-size: 2.2em;
  text-align: center;
  margin-bottom: 40px;
  color: inherit; /* Inherit color from parent section (light/dark bg) */
}

/* FAQ List */
.page-faq__faq-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.page-faq__faq-item {
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  color: #333333; /* Ensure text is dark on light background */
}

.page-faq__dark-bg .page-faq__faq-item {
  background-color: rgba(255, 255, 255, 0.1); /* Semi-transparent white on dark bg */
  border-color: rgba(255, 255, 255, 0.2);
  color: #FFFFFF; /* White text on dark background */
}

.page-faq__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  font-weight: bold;
  font-size: 1.1em;
  cursor: pointer;
  background-color: transparent;
  transition: background-color 0.3s ease;
  color: inherit; /* Inherit color from parent item */
  list-style: none; /* Remove default marker for details summary */
}

.page-faq__faq-item[open] .page-faq__faq-question {
  background-color: #e6f7ee; /* Lighter green on open */
}

.page-faq__dark-bg .page-faq__faq-item[open] .page-faq__faq-question {
  background-color: rgba(255, 255, 255, 0.2); 
}

.page-faq__faq-qtext {
  flex-grow: 1;
}

.page-faq__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  margin-left: 15px;
  transition: transform 0.3s ease;
}

.page-faq__faq-item[open] .page-faq__faq-toggle {
  transform: rotate(45deg); /* Rotate plus to cross */
}

.page-faq__faq-answer {
  padding: 0 20px 20px;
  font-size: 1em;
  color: inherit; /* Inherit color from parent item */
}

.page-faq__faq-answer p {
  margin-bottom: 10px;
}

/* Buttons */
.page-faq__btn-primary,
.page-faq__btn-secondary,
.page-faq__inline-link {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  text-align: center;
  box-sizing: border-box; /* Ensure padding doesn't push width */
}

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

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

.page-faq__btn-secondary {
  background-color: #017439; /* Primary brand color */
  color: #FFFFFF;
  border: 2px solid #017439;
}

.page-faq__btn-secondary:hover {
  background-color: #005f2c;
  border-color: #005f2c;
}

.page-faq__inline-link {
  color: #017439; /* Brand color for inline links */
  text-decoration: underline;
  font-weight: normal;
  padding: 0;
  border: none;
  background: none;
}

.page-faq__inline-link:hover {
  color: #005f2c;
}

/* Call to Action Section */
.page-faq__cta-section {
  text-align: center;
  padding: 80px 20px;
  background-color: #017439; /* Dark background for CTA */
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
}

.page-faq__cta-content {
  position: relative;
  z-index: 1;
}

.page-faq__cta-title {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: #FFFFFF;
}

.page-faq__cta-description {
  font-size: 1.2em;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-faq__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.page-faq__cta-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2; /* Subtle background image */
  z-index: 0;
}

/* Content Images */
.page-faq__content-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  min-width: 200px; /* Enforce min size */
  min-height: 200px; /* Enforce min size */
}

/* Copyright Section */
.page-faq__copyright-section {
  text-align: center;
  padding: 20px;
  background-color: #f0f0f0;
  color: #666666;
  font-size: 0.9em;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .page-faq__hero-section {
    min-height: 400px;
    padding: 40px 15px;
    padding-top: var(--header-offset, 120px) !important; /* Ensure mobile header offset */
  }

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

  .page-faq__hero-description {
    font-size: 1em;
  }

  .page-faq__hero-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .page-faq__btn-primary,
  .page-faq__btn-secondary,
  .page-faq a[class*="button"],
  .page-faq a[class*="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;
  }
  
  .page-faq__cta-buttons {
    flex-direction: column;
    gap: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important;
  }

  .page-faq__section-title {
    font-size: 1.8em;
  }

  .page-faq__faq-question {
    font-size: 1em;
    padding: 15px;
  }

  .page-faq__faq-answer {
    padding: 0 15px 15px;
  }

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

  .page-faq__cta-description {
    font-size: 1em;
  }

  /* Mobile image responsiveness */
  .page-faq img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-faq__section,
  .page-faq__card,
  .page-faq__container,
  .page-faq__copyright-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Remove default details marker */
.page-faq__faq-item summary::-webkit-details-marker {
  display: none;
}
.page-faq__faq-item summary {
  list-style: none;
}

/* Ensure no images smaller than 200px */
.page-faq img:not(.page-faq__hero-image):not(.page-faq__cta-image) {
  min-width: 200px;
  min-height: 200px;
}

/* Contrast check: ensure text on hero content is readable */
.page-faq__hero-content p,
.page-faq__hero-content h1 {
  color: #333333; /* Dark text for readability on semi-transparent white */
}
.page-faq__hero-title {
  color: #017439; /* Brand color */
}