/* 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: #F5F7FA; /* Body background from custom palette */
}

/* Container for content width */
.page-faq__container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
}

/* Hero Section */
.page-faq__hero-section {
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
  color: #ffffff;
  padding: 60px 0;
  text-align: center;
  margin-top: 10px; /* Small top padding, assuming body has header offset */
}

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

.page-faq__description {
  font-size: 18px;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: #f0f0f0;
}

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

.page-faq__btn-primary,
.page-faq__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
  max-width: 100%; /* Ensure button respects container width */
  box-sizing: border-box;
}

.page-faq__btn-primary {
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
  color: #ffffff;
  border: none;
}

.page-faq__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

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

.page-faq__btn-secondary:hover {
  background: #f0f0f0;
  color: #c62828;
  transform: translateY(-2px);
}

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

.page-faq__section-title {
  font-size: 28px;
  font-weight: 700;
  color: #E53935;
  text-align: center;
  margin-bottom: 30px;
}

.page-faq__faq-items-wrapper {
  margin-top: 20px;
}

/* FAQ Item (using <details> + <summary>) */
details.page-faq__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid #E0E0E0;
  overflow: hidden;
  background: #ffffff;
  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; /* Remove default marker */
  transition: background-color 0.3s ease;
  color: #333333; /* Ensure contrast */
}

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: 17px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: #333333; /* Ensure contrast */
}

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

details.page-faq__faq-item .page-faq__faq-answer {
  padding: 0 20px 20px;
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
  color: #333333; /* Ensure contrast */
}

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

.page-faq__faq-answer ul,
.page-faq__faq-answer ol {
  margin-left: 20px;
  margin-bottom: 10px;
}

.page-faq__faq-answer li {
  margin-bottom: 5px;
}

.page-faq__link {
  color: #E53935;
  text-decoration: none;
  font-weight: 500;
}

.page-faq__link:hover {
  text-decoration: underline;
}

/* Contact Section */
.page-faq__contact-section {
  padding: 40px 0 60px;
  text-align: center;
  background: #F5F7FA;
}

/* Image responsiveness */
.page-faq img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .page-faq__hero-section {
    padding: 40px 0;
  }

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

  .page-faq__description {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .page-faq__cta-buttons {
    flex-direction: column;
    gap: 10px;
    max-width: 280px; /* Adjust for smaller screens */
    padding: 0 15px;
  }

  .page-faq__btn-primary,
  .page-faq__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 15px;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  
  .page-faq__faq-list-section,
  .page-faq__contact-section {
    padding: 30px 0;
  }

  .page-faq__section-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  details.page-faq__faq-item summary.page-faq__faq-question {
    padding: 15px;
  }

  .page-faq__faq-qtext {
    font-size: 15px;
    line-height: 1.4;
  }

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

  /* Force image and container responsiveness for mobile */
  .page-faq img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-faq__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  /* Sections themselves might have padding, so container padding should be adjusted */
  .page-faq__hero-section .page-faq__container,
  .page-faq__faq-list-section .page-faq__container,
  .page-faq__contact-section .page-faq__container {
    padding-left: 0;
    padding-right: 0;
  }
  details.page-faq__faq-item {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Ensure contrast for text on various backgrounds */
.page-faq p,
.page-faq li,
.page-faq__faq-answer {
  color: #333333; 
}

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

.page-faq__btn-primary {
  color: #ffffff; 
}

.page-faq__btn-secondary {
  color: #E53935;
}