/* 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: var(--background-color, #ffffff); /* Inherit from shared or default white */
  padding-top: var(--header-offset, 120px); /* Ensure content is below fixed header */
}

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

/* Hero Intro Section */
.page-faq__hero-intro {
  background: linear-gradient(135deg, #26A9E0, #FFFFFF); /* Brand color gradient */
  padding: 60px 0;
  text-align: center;
  color: #ffffff;
}

.page-faq__hero-intro .page-faq__container {
  max-width: 900px;
}

.page-faq__main-title {
  font-size: 42px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #ffffff;
  line-height: 1.2;
}

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

.page-faq__cta-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

/* Section Titles */
.page-faq__section-title {
  font-size: 32px;
  font-weight: bold;
  color: #26A9E0; /* Brand color for titles */
  text-align: center;
  margin-bottom: 40px;
  padding-top: 60px;
}

/* Text Blocks */
.page-faq__text-block {
  font-size: 16px;
  margin-bottom: 20px;
  text-align: justify;
}

/* Buttons */
.page-faq__btn-primary,
.page-faq__btn-secondary,
.page-faq__cta-button,
.page-faq__btn-small,
.page-faq__btn-large {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
  transition: all 0.3s ease;
  box-sizing: border-box;
  text-align: center;
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Allow long words to break */
}

.page-faq__btn-primary {
  background: #26A9E0; /* Primary brand color */
  color: #ffffff;
  border: 2px solid #26A9E0;
}

.page-faq__btn-primary:hover {
  background: #1e87b8;
  border-color: #1e87b8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

.page-faq__btn-secondary:hover {
  background: #f0f8ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.page-faq__btn-small {
  padding: 10px 20px;
  font-size: 16px;
}

.page-faq__btn-large {
  padding: 18px 40px;
  font-size: 20px;
}

/* Content Section */
.page-faq__content-section {
  padding: 80px 0;
  background: #f9f9f9;
}

.page-faq__content-section ul {
  list-style: disc;
  padding-left: 25px;
  margin-bottom: 20px;
}

.page-faq__content-section ol {
  list-style: decimal;
  padding-left: 25px;
  margin-bottom: 20px;
}

.page-faq__content-section li {
  margin-bottom: 10px;
}

.page-faq__content-section a {
  color: #26A9E0;
  text-decoration: underline;
}

.page-faq__content-section a:hover {
  color: #1e87b8;
}

/* FAQ List */
.page-faq__faq-list {
  margin-top: 30px;
}

/* FAQ Container Styles */
.page-faq__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* FAQ Default State - Answer Hidden */
.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 20px;
  opacity: 0;
  background: #fdfdfd;
}

/* FAQ Expanded State - Use !important and sufficiently large max-height */
.page-faq__faq-item.active .page-faq__faq-answer {
  max-height: 2000px !important; /* Ensure priority and sufficient height */
  padding: 20px !important;
  opacity: 1;
  background: #fdfdfd;
  border-radius: 0 0 8px 8px;
}

/* Question Styles */
.page-faq__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  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;
}

/* Question Title Styles */
.page-faq__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: #333333;
  pointer-events: none; /* Prevent h3 from blocking click event */
}

/* Toggle Icon */
.page-faq__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: #26A9E0; /* Brand 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 event */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

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

/* Image styles within FAQ answers */
.page-faq__faq-answer img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Expert Advice Section */
.page-faq__expert-advice {
  padding: 80px 0;
  background: #f0f0f0;
  text-align: center;
}

.page-faq__expert-advice .page-faq__section-title {
  color: #26A9E0;
}

.page-faq__expert-advice .page-faq__text-block {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  font-size: 17px;
  color: #555555;
}

.page-faq__expert-advice img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 40px auto 0;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* CTA Bottom Section */
.page-faq__cta-bottom {
  padding: 80px 0;
  background: #26A9E0; /* Brand color background */
  text-align: center;
  color: #ffffff;
}

.page-faq__cta-bottom .page-faq__section-title {
  color: #ffffff;
  padding-top: 0;
}

.page-faq__cta-bottom .page-faq__text-block {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  font-size: 18px;
  color: #f0f0f0;
  margin-bottom: 40px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-faq__main-title {
    font-size: 36px;
  }
  .page-faq__intro-description {
    font-size: 16px;
  }
  .page-faq__section-title {
    font-size: 28px;
  }
  .page-faq__faq-question h3 {
    font-size: 17px;
  }
}

@media (max-width: 768px) {
  .page-faq {
    padding-top: var(--header-offset, 120px) !important; /* Ensure content is below fixed header on mobile */
  }

  .page-faq__container {
    padding: 0 15px;
  }

  .page-faq__hero-intro {
    padding: 40px 0;
  }

  .page-faq__main-title {
    font-size: 30px;
    margin-bottom: 15px;
  }

  .page-faq__intro-description {
    font-size: 15px;
    margin-bottom: 20px;
  }

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

  .page-faq__btn-primary,
  .page-faq__btn-secondary,
  .page-faq__btn-large,
  .page-faq__btn-small {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  
  .page-faq__cta-group .page-faq__btn-primary,
  .page-faq__cta-group .page-faq__btn-secondary {
    margin: 0 auto; /* Center buttons when stacked */
  }

  .page-faq__section-title {
    font-size: 24px;
    margin-bottom: 30px;
    padding-top: 40px;
  }

  .page-faq__content-section,
  .page-faq__expert-advice,
  .page-faq__cta-bottom {
    padding: 50px 0;
  }

  .page-faq__faq-item {
    margin-bottom: 10px;
    border-radius: 6px;
  }

  .page-faq__faq-question {
    padding: 15px;
    border-radius: 6px;
  }

  .page-faq__faq-question h3 {
    font-size: 16px;
  }

  .page-faq__faq-toggle {
    font-size: 24px;
    width: 28px;
    height: 28px;
  }

  .page-faq__faq-item.active .page-faq__faq-answer {
    padding: 15px !important;
    border-radius: 0 0 6px 6px;
  }

  .page-faq__faq-answer img,
  .page-faq__expert-advice img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    margin: 15px auto;
    border-radius: 6px;
  }

  /* General image responsive styles for all images within .page-faq */
  .page-faq img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    box-sizing: border-box !important;
  }
  
  /* Ensure all content containers are constrained */
  .page-faq__section,
  .page-faq__card,
  .page-faq__container,
  .page-faq__cta-buttons,
  .page-faq__button-group,
  .page-faq__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    /* Adding padding to prevent content touching screen edges */
    padding-left: 15px; 
    padding-right: 15px;
  }
  
  /* Override for specific containers that might have 0 padding */
  .page-faq__hero-intro .page-faq__container,
  .page-faq__content-section .page-faq__container,
  .page-faq__expert-advice .page-faq__container,
  .page-faq__cta-bottom .page-faq__container {
    padding-left: 15px;
    padding-right: 15px;
  }
}