/* ============================================
   FAQ Page — "Knowledge Base"
   Two-pane categorized layout: sticky topic sidebar (with scroll-spy) +
   grouped accordion sections. Collapses to sticky topic chips on mobile.
   ============================================ */

/* ---- Layout shell ---- */
.faq-shell {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 8px var(--content-pad) 96px;
  display: grid;
  grid-template-columns: 256px 1fr;
  gap: 56px;
  align-items: start;
}

/* ---- Sidebar ---- */
.faq-side {
  position: sticky;
  top: 92px;
}

.faq-side-h {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--gray-400);
  margin: 0 0 14px 14px;
}

.faq-navlink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--gray-600);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.faq-navlink:hover { background: var(--white); color: var(--gray-900); }

.faq-navlink.active {
  background: var(--white);
  color: var(--gray-900);
  border-color: var(--gray-200);
  box-shadow: 0 4px 14px rgba(10, 22, 40, 0.05);
}

.faq-navlink svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--blue); }
.faq-navlink.active svg { color: var(--green-brand); }

.faq-navlink-label { flex: 1; }

.faq-navlink-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-400);
  background: var(--gray-100);
  border-radius: 20px;
  padding: 1px 9px;
}
.faq-navlink.active .faq-navlink-count { background: var(--green-light); color: var(--green); }

/* ---- Content sections ---- */
.faq-section {
  margin-top: 56px;
  scroll-margin-top: 92px;
}
.faq-section:first-child { margin-top: 8px; }

.faq-sec-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

.faq-sec-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--blue-light);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.faq-sec-ico svg { width: 22px; height: 22px; }

.faq-sec-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.faq-sec-blurb {
  color: var(--gray-500);
  font-size: 14.5px;
  margin: 0 0 20px 56px;
}

/* ---- Accordion item ---- */
.faq-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.faq-item[open] {
  border-color: var(--blue);
  box-shadow: 0 10px 30px rgba(21, 101, 192, 0.08);
}

.faq-question {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  cursor: pointer;
  list-style: none;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::marker { content: ''; }
.faq-question:hover { background: var(--gray-50); }

.faq-question-text { flex: 1; }

.faq-question-icon {
  margin-left: auto;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: transform 0.3s ease, background 0.2s ease, color 0.2s ease;
}
.faq-question-icon svg { width: 14px; height: 14px; }
.faq-item[open] .faq-question-icon {
  transform: rotate(180deg);
  background: var(--green-light);
  color: var(--green-brand);
}

.faq-answer {
  padding: 4px 22px 24px;
  border-top: 1px solid var(--gray-100);
}

.faq-answer-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--gray-700);
  padding-top: 16px;
}
/* Emphasis pops in the brand (hero) green */
.faq-answer-text strong { color: var(--green-brand); font-weight: 700; }

/* ---- Mobile topic chips (hidden on desktop) ---- */
.faq-chips { display: none; }

/* ---- Empty / error ---- */
.faq-empty,
.faq-error {
  text-align: center;
  padding: 80px 20px;
  color: var(--gray-500);
  font-size: 16px;
}
.faq-error {
  color: #C62828;
  background: #FFEBEE;
  border-radius: var(--radius);
  max-width: 600px;
  margin: 40px auto;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .faq-shell { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  .faq-side { display: none; }

  .faq-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 14px var(--content-pad);
    position: sticky;
    top: 64px;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--gray-200);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .faq-chips::-webkit-scrollbar { display: none; }

  .faq-chip {
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-600);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    padding: 8px 14px;
    text-decoration: none;
  }
  .faq-chip.active { background: var(--gray-900); color: var(--white); border-color: var(--gray-900); }

  .faq-section { scroll-margin-top: 116px; }
}

@media (max-width: 640px) {
  .faq-sec-blurb { margin-left: 0; }
  .faq-sec-title { font-size: 21px; }
  .faq-question { padding: 18px 18px; font-size: 15.5px; }
  .faq-answer { padding: 4px 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .faq-navlink,
  .faq-item,
  .faq-question-icon { transition: none; }
}
