/* style/faq.css */

/* General styles for the FAQ page, ensuring text contrast against the dark background */
.page-faq {
  background-color: var(--bg-color, #08160F); /* General background from custom palette */
  color: var(--text-main-color, #F2FFF6); /* Main text color from custom palette */
  font-family: Arial, sans-serif;
  line-height: 1.6;
  padding-bottom: 40px; /* Add some padding at the bottom */
}

/* Hero section for the FAQ page */
.page-faq__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column; /* Image above text */
  align-items: center;
  justify-content: center;
  padding: 60px 20px 40px; /* Adjust padding as needed, ensure small top padding */
  padding-top: 10px; /* Small top padding for hero section, body handles --header-offset */
  background-color: var(--deep-green-color, #0A4B2C); /* Use a darker green for hero background */
  overflow: hidden; /* Prevent image overflow */
}

.page-faq__hero-image {
  width: 100%;
  max-width: 1200px; /* Constrain hero image width */
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  margin-bottom: 30px; /* Space between image and content */
}

.page-faq__hero-content {
  max-width: 900px;
  text-align: center;
  z-index: 1;
  padding: 0 20px;
}

.page-faq__main-title {
  font-size: clamp(2.2rem, 4vw, 3.5rem); /* Responsive font size for H1 */
  font-weight: 700;
  color: var(--text-main-color, #F2FFF6);
  margin-bottom: 20px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-faq__description {
  font-size: 1.1rem;
  color: var(--text-secondary-color, #A7D9B8);
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

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

.page-faq__btn-primary,
.page-faq__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 30px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  min-width: 180px;
  box-sizing: border-box; /* Crucial for responsive buttons */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Allow long words to break */
  max-width: 100%; /* Ensure buttons don't overflow */
}

.page-faq__btn-primary {
  background: var(--button-gradient, linear-gradient(180deg, #2AD16F 0%, #13994A 100%));
  color: var(--text-main-color, #F2FFF6);
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-faq__btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
}

.page-faq__btn-secondary {
  background: transparent;
  color: var(--text-main-color, #F2FFF6);
  border: 2px solid var(--border-color, #2E7A4E);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.page-faq__btn-secondary:hover {
  background: rgba(46, 122, 78, 0.2); /* Light transparent background on hover using RGB from --border-color */
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* FAQ List Section */
.page-faq__section {
  padding: 50px 0;
}

.page-faq__container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.page-faq__section-title {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  color: var(--text-main-color, #F2FFF6);
  text-align: center;
  margin-bottom: 40px;
  font-weight: 700;
  line-height: 1.3;
}

.page-faq__faq-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.page-faq__faq-item {
  background-color: var(--card-bg-color, #11271B); /* Card background from custom palette */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color, #2E7A4E);
}

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

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

.page-faq__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main-color, #F2FFF6);
  cursor: pointer;
  background-color: var(--card-bg-color, #11271B);
  border-bottom: 1px solid var(--divider-color, #1E3A2A);
  transition: background-color 0.3s ease;
}

.page-faq__faq-question:hover {
  background-color: rgba(17, 39, 27, 0.8); /* Use RGB from --card-bg-color for hover */
}

.page-faq__faq-qtext {
  flex-grow: 1;
  margin-right: 15px;
}

.page-faq__faq-toggle {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--glow-color, #57E38D); /* Use glow color for toggle */
  width: 24px;
  text-align: center;
}

.page-faq__faq-answer {
  padding: 0 25px 20px;
  font-size: 1rem;
  color: var(--text-secondary-color, #A7D9B8);
  line-height: 1.7;
  max-height: 0; /* Default for JS-driven hide, also for native transition */
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

/* Style for native <details> open state */
.page-faq__faq-item[open] .page-faq__faq-answer {
  max-height: 2000px; /* Sufficiently large value */
  padding-top: 15px;
}

/* Style for JS-driven active state (fallback/enhancement) */
.page-faq__faq-item.active .page-faq__faq-answer {
  max-height: 2000px !important; /* Sufficiently large value */
  padding-top: 15px;
}

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

.page-faq__faq-answer p:last-child {
  margin-bottom: 0;
}

.page-faq__faq-answer a {
  color: var(--gold-color, #F2C14E); /* Use gold color for links in answers */
  text-decoration: underline;
}

.page-faq__faq-answer a:hover {
  text-decoration: none;
  color: var(--glow-color, #57E38D);
}

.page-faq__content-image {
  width: 100%;
  max-width: 100%; /* Ensure images fit within their containers */
  height: auto;
  display: block;
  margin-top: 20px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  filter: none; /* Ensure no CSS filters are applied */
}

/* Call to Action Section at the bottom */
.page-faq__cta-section {
  background-color: var(--deep-green-color, #0A4B2C); /* Deep green for CTA background */
  padding: 40px;
  border-radius: 10px;
  text-align: center;
  margin-top: 50px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color, #2E7A4E);
}

.page-faq__cta-title {
  font-size: clamp(1.6rem, 2.5vw, 2.5rem);
  color: var(--text-main-color, #F2FFF6);
  margin-bottom: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.page-faq__cta-description {
  font-size: 1.1rem;
  color: var(--text-secondary-color, #A7D9B8);
  margin-bottom: 30px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .page-faq__hero-content {
    padding: 0 15px;
  }
}

@media (max-width: 768px) {
  .page-faq__hero-section {
    padding: 40px 15px 30px;
    padding-top: 10px !important; /* Small top padding for hero section, body handles --header-offset */
  }

  .page-faq__main-title {
    font-size: clamp(1.8rem, 8vw, 2.5rem); /* More aggressive clamp for mobile H1 */
  }

  .page-faq__description {
    font-size: 1rem;
    margin-bottom: 25px;
  }

  .page-faq__cta-buttons {
    flex-direction: column; /* Stack buttons vertically on mobile */
    gap: 15px;
    padding: 0 15px; /* Add padding to buttons container */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  .page-faq__btn-primary,
  .page-faq__btn-secondary {
    width: 100% !important; /* Full width buttons */
    max-width: 100% !important;
    padding: 12px 20px !important;
    font-size: 0.95rem !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
  }

  .page-faq__section {
    padding: 30px 0;
  }

  .page-faq__container {
    padding: 0 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .page-faq__section-title {
    font-size: clamp(1.5rem, 7vw, 2.2rem);
    margin-bottom: 30px;
  }

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

  .page-faq__faq-answer {
    padding: 0 20px 15px;
    font-size: 0.95rem;
  }

  /* Mobile image responsiveness */
  .page-faq img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    filter: none !important; /* Ensure no CSS filters are applied */
  }

  .page-faq__hero-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  .page-faq__content-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* Ensure all containers for images and buttons are also responsive */
  .page-faq__section,
  .page-faq__card,
  .page-faq__container,
  .page-faq__cta-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important;
  }

  .page-faq__cta-section {
    padding: 30px 20px;
  }

  .page-faq__cta-title {
    font-size: clamp(1.4rem, 6vw, 2rem);
  }
}

/* Custom CSS variables for colors */
:root {
  --primary-color: #11A84E;
  --secondary-color: #22C768;

  --button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  --card-bg-color: #11271B;
  --bg-color: #08160F;
  --text-main-color: #F2FFF6;
  --text-secondary-color: #A7D9B8;
  --border-color: #2E7A4E;
  --glow-color: #57E38D;
  --gold-color: #F2C14E;
  --divider-color: #1E3A2A;
  --deep-green-color: #0A4B2C;
}