/* FAQ Archive Styles */

/* Fix sticky sidebar — theme sets overflow-x:hidden on html/body which breaks position:sticky */
html.crjs,
body.post-type-archive-faq {
  overflow-x: clip !important;
}

/* Hero */
.faq-hero {
  min-height: 300px;
  position: relative;
  background-color: var(--primary);
  display: flex;
  align-content: center;
  justify-content: flex-start;
  overflow: hidden;
}

.faq-hero::before {
  content: '';
  width: 650px;
  height: 250px;
  background-repeat: repeat;
  background-size: cover;
  right: -32px;
  position: absolute;
  bottom: -97px;
  background-image: url(/wp-content/uploads/2021/12/dots-white.png);
  z-index: 0;
}

.faq-hero-inner {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  min-height: 300px;
  position: relative;
  z-index: 1;
}

.faq-hero h1 {
  color: #fff;
  text-transform: uppercase;
  margin-top: 15px;
  font-family: var(--font1);
}

.faq-hero .three-dots {
  width: 7px;
  height: 7px;
  background-color: white;
  display: inline-block;
  position: relative;
}

.faq-hero .three-dots:before,
.faq-hero .three-dots:after {
  content: '';
  width: 7px;
  height: 7px;
  background-color: white;
  display: inline-block;
  position: absolute;
}

.faq-hero .three-dots:before {
  left: 50px;
}

.faq-hero .three-dots:after {
  left: 100px;
}

/* Layout */
.faq-archive-container {
  padding-top: 60px;
  padding-bottom: 80px;
}

.faq-layout {
  display: flex;
  gap: 60px;
  align-items: flex-start;
}

/* Sidebar */
.faq-sidebar {
  width: 250px;
  flex-shrink: 0;
  position: sticky;
  top: 120px;
  align-self: flex-start;
}

.faq-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.faq-sidebar-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  text-decoration: none;
  color: #333;
  font-family: var(--font1);
  font-weight: 500;
  font-size: 15px;
  border-radius: 6px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.faq-sidebar-link:hover {
  background: #f5f5f5;
  color: var(--primary);
}

.faq-sidebar-link.active {
  background: #f0f0f0;
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.faq-sidebar-count {
  background: #e8e8e8;
  color: #666;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
}

.faq-sidebar-link.active .faq-sidebar-count {
  background: var(--primary);
  color: #fff;
}

/* Content */
.faq-content {
  flex: 1;
  min-width: 0;
}

/* Sections */
.faq-section {
  margin-bottom: 50px;
}

.faq-section:last-child {
  margin-bottom: 0;
}

.faq-section-title {
  font-family: var(--font1);
  font-size: 28px;
  color: var(--primary);
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

/* FAQ Items */
.faq-item {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.faq-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.faq-item.open {
  border-color: var(--primary);
}

/* Question Button */
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: #fff;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font1);
  font-size: 17px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  gap: 16px;
  transition: background 0.2s ease;
}

.faq-question:hover {
  background: #fafafa;
}

.faq-item.open .faq-question {
  background: var(--primary);
  color: #fff;
}

/* Toggle Icon */
.faq-toggle {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  position: relative;
}

.faq-toggle::before,
.faq-toggle::after {
  content: '';
  position: absolute;
  background: #666;
  transition: transform 0.3s ease, background 0.2s ease;
}

.faq-toggle::before {
  width: 16px;
  height: 2px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.faq-toggle::after {
  width: 2px;
  height: 16px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.faq-item.open .faq-toggle::before,
.faq-item.open .faq-toggle::after {
  background: #fff;
}

.faq-item.open .faq-toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

/* Answer */
.faq-answer {
  overflow: hidden;
  transition: max-height 0.35s ease;
  max-height: 0;
}

.faq-answer[hidden] {
  display: block;
  max-height: 0;
}

.faq-answer.open {
  max-height: 2000px;
}

.faq-answer-inner {
  padding: 16px 20px 18px;
  font-family: var(--font2);
  font-size: 16px;
  line-height: 1.5;
  color: #444;
  border-top: 1px solid #eee;
  background: #fff;
}

.faq-answer-inner p {
  font-size: 16px;
  line-height: 1.5;
}

.faq-answer-inner p:last-child {
  margin-bottom: 0;
}

/* Empty State */
.faq-empty {
  text-align: center;
  padding: 80px 20px;
  color: #888;
  font-size: 18px;
}

/* Mobile */
@media (max-width: 991px) {
  .faq-hero::before {
    display: none;
  }

  .faq-layout {
    flex-direction: column;
    gap: 0;
  }

  .faq-sidebar {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
  }

  .faq-sidebar-nav {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .faq-sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .faq-sidebar-link {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 20px;
    border-left: none;
    font-size: 14px;
    background: #f0f0f0;
  }

  .faq-sidebar-link.active {
    background: var(--primary);
    color: #fff;
    border-left-color: transparent;
  }

  .faq-sidebar-link.active .faq-sidebar-count {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
  }

  .faq-archive-container {
    padding-top: 30px;
    padding-bottom: 50px;
  }

  .faq-section-title {
    font-size: 22px;
  }

  .faq-question {
    font-size: 15px;
    padding: 14px 16px;
  }

  .faq-answer-inner {
    padding: 16px;
  }
}
