/* style/faq.css */

/* Core Styles */
.page-faq {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light backgrounds */
  background-color: var(--secondary-color, #FFFFFF);
}

/* Color Contrast Fixes based on body background (white) */
.page-faq__dark-bg {
  background-color: var(--primary-color, #017439);
  color: #ffffff;
}

.page-faq__light-bg {
  background-color: var(--secondary-color, #FFFFFF);
  color: #333333;
}

/* Container */
.page-faq__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Section Titles */
.page-faq__section-title {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary-color, #017439);
  text-align: center;
  margin-bottom: 40px;
  padding-top: 20px;
}

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

/* Text Blocks */
.page-faq__text-block {
  font-size: 18px;
  margin-bottom: 20px;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Images in content */
.page-faq__image-content {
  width: 100%;
  height: auto;
  max-width: 800px;
  display: block;
  margin: 30px auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 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;
  padding-top: var(--header-offset, 120px); /* Fixed header offset */
  background: linear-gradient(135deg, var(--primary-color, #017439), #1a9657);
  color: #ffffff;
  overflow: hidden; /* Ensure image doesn't overflow */
}

.page-faq__hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.page-faq__hero-image {
  width: 100%;
  margin-bottom: 30px;
  max-width: 800px; /* Limit hero image width within the content */
}

.page-faq__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.page-faq__hero-content {
  text-align: center;
  width: 100%;
}

.page-faq__main-heading {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
  color: #FFFF00; /* Register/Login font color */
}

.page-faq__hero-description {
  font-size: 20px;
  margin-bottom: 30px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* CTA Buttons */
.page-faq__cta-button {
  display: inline-block;
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  margin: 10px 15px;
  transition: all 0.3s ease;
  box-sizing: border-box;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
}

.page-faq__btn-primary {
  background: var(--primary-color, #017439);
  color: #FFFF00; /* Register/Login font color */
  border: 2px solid var(--primary-color, #017439);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-faq__btn-primary:hover {
  background: #005a2e;
  border-color: #005a2e;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.page-faq__btn-secondary {
  background: #C30808; /* Register/Login color */
  color: #FFFF00; /* Register/Login font color */
  border: 2px solid #C30808;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-faq__btn-secondary:hover {
  background: #9d0606;
  border-color: #9d0606;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Intro Section */
.page-faq__intro-section {
  padding: 80px 0;
  text-align: center;
  background-color: var(--secondary-color, #FFFFFF);
}

/* FAQ List Section */
.page-faq__faq-list-section {
  padding: 80px 0;
  background-color: #f8f8f8;
}

.page-faq__faq-list-section .page-faq__container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* FAQ Item Styles */
.page-faq__faq-item {
  margin-bottom: 15px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  background: #fff;
}

.page-faq__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

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

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

.page-faq__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--primary-color, #017439);
  pointer-events: none; /* Prevent h3 from blocking click event */
}

.page-faq__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: #666;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 20px;
  pointer-events: none; /* Prevent icon from blocking click event */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.page-faq__faq-item.active .page-faq__faq-toggle {
  color: var(--primary-color, #017439);
  transform: rotate(45deg); /* Rotate for 'x' effect, or just change text to '−' */
}

.page-faq__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;
  background: #f9f9f9;
}

.page-faq__faq-item.active .page-faq__faq-answer {
  max-height: 2000px !important; /* Ensure enough height for content */
  padding: 20px 25px !important;
  opacity: 1;
  border-radius: 0 0 10px 10px;
}

.page-faq__faq-answer p {
  margin-bottom: 15px;
  font-size: 16px;
  color: #555555;
  text-align: left;
}

.page-faq__faq-answer .page-faq__btn-primary {
  margin-top: 15px;
  display: inline-block;
}

/* Contact CTA Section */
.page-faq__contact-cta-section {
  padding: 80px 0;
  text-align: center;
  background-color: var(--primary-color, #017439);
  color: #ffffff;
}

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

.page-faq__contact-cta-section .page-faq__text-block {
  color: #e0e0e0;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-faq__main-heading {
    font-size: 40px;
  }
  .page-faq__hero-description {
    font-size: 18px;
  }
  .page-faq__section-title {
    font-size: 28px;
  }
  .page-faq__text-block {
    font-size: 16px;
  }
  .page-faq__hero-image {
    max-width: 600px;
  }
  .page-faq__image-content {
    max-width: 600px;
  }
}

@media (max-width: 768px) {
  .page-faq {
    font-size: 16px;
    line-height: 1.6;
  }
  .page-faq__hero-section {
    padding-top: var(--header-offset, 120px) !important;
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-faq__hero-image {
    margin-bottom: 20px;
  }
  .page-faq__hero-image img {
    border-radius: 8px;
  }
  .page-faq__main-heading {
    font-size: 32px;
    margin-bottom: 15px;
  }
  .page-faq__hero-description {
    font-size: 16px;
    margin-bottom: 20px;
  }
  .page-faq__cta-button {
    padding: 12px 25px;
    font-size: 16px;
    margin: 8px 0;
    width: 100% !important; /* Ensure full width */
    max-width: 100% !important;
  }
  .page-faq__hero-content .page-faq__cta-button {
    display: block;
  }
  .page-faq__section-title {
    font-size: 24px;
    margin-bottom: 30px;
  }
  .page-faq__intro-section, .page-faq__faq-list-section, .page-faq__contact-cta-section {
    padding: 50px 0;
  }
  .page-faq__container {
    padding: 0 15px;
  }
  .page-faq__text-block {
    font-size: 15px;
  }
  .page-faq__faq-question {
    padding: 15px 20px;
  }
  .page-faq__faq-question h3 {
    font-size: 16px;
  }
  .page-faq__faq-toggle {
    font-size: 24px;
    width: 28px;
    height: 28px;
    margin-left: 15px;
  }
  .page-faq__faq-answer {
    padding: 0 20px;
  }
  .page-faq__faq-item.active .page-faq__faq-answer {
    padding: 15px 20px !important;
  }
  .page-faq__faq-answer p {
    font-size: 15px;
  }
  /* Mobile image responsiveness */
  .page-faq img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-faq__section, .page-faq__card, .page-faq__container, .page-faq__hero-container, .page-faq__hero-content {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  /* Button group handling for mobile */
  .page-faq__hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .page-faq__cta-button {
    margin: 0 !important;
  }
}

@media (max-width: 480px) {
  .page-faq__main-heading {
    font-size: 28px;
  }
  .page-faq__hero-description {
    font-size: 15px;
  }
  .page-faq__section-title {
    font-size: 22px;
  }
  .page-faq__faq-question h3 {
    font-size: 15px;
  }
  .page-faq__faq-toggle {
    font-size: 22px;
    width: 26px;
    height: 26px;
  }
}