/*
 * FAQ Help Centre — Sidebar Navigation
 * Requires: theme-variables.css, layout.css
 *
 * Structure expected in .faq-sidebar:
 *
 *   <nav class="faq-nav">
 *     <div class="faq-nav__site-title">
 *       <a href="/">BTC Breakout — Help Centre</a>
 *     </div>
 *     <ul class="faq-nav__list">
 *       <li class="faq-nav__section-label">GETTING STARTED</li>
 *       <li class="faq-nav__item"><a href="...">Page title</a></li>
 *       <li class="faq-nav__item faq-nav__item--expandable">
 *         <button class="faq-nav__expand-btn">
 *           Parent page
 *           <svg class="faq-nav__chevron">...</svg>
 *         </button>
 *         <ul class="faq-nav__sub-list">
 *           <li class="faq-nav__item"><a href="...">Sub-page</a></li>
 *         </ul>
 *       </li>
 *     </ul>
 *   </nav>
 */

/* ─── Site title ─────────────────────────────────────────────────────────── */
.faq-nav__site-title {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--faq-border);
  margin-bottom: 16px;
}

.faq-nav__site-title a {
  font-size: 15px;
  font-weight: 700;
  color: var(--faq-accent);
  text-decoration: none;
  line-height: 1.3;
  display: block;
}

.faq-nav__site-title a:hover {
  opacity: 0.85;
}

/* ─── Nav list ───────────────────────────────────────────────────────────── */
.faq-nav__list,
.faq-nav__sub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ─── Section labels (GETTING STARTED, TECHNICALS) ───────────────────────── */
.faq-nav__section-label {
  padding: 16px 20px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faq-text-nav-section);
}

.faq-nav__section-label:first-child {
  padding-top: 4px;
}

/* ─── Nav item (link) ────────────────────────────────────────────────────── */
.faq-nav__item {
  position: relative;
}

.faq-nav__item > a {
  display: block;
  padding: 7px 20px;
  font-size: 14px;
  color: var(--faq-text-nav);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
  line-height: 1.4;
}

.faq-nav__item > a:hover {
  color: var(--faq-text-primary);
  background-color: var(--faq-nav-active-bg);
}

.faq-nav__item > a.is-active,
.faq-nav__item > a[aria-current="page"] {
  color: var(--faq-accent);
  background-color: var(--faq-nav-active-bg);
  border-left-color: var(--faq-nav-active-border);
  font-weight: 500;
}

/* ─── Expandable parent item ─────────────────────────────────────────────── */
.faq-nav__expand-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 20px;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--faq-text-nav);
  text-align: left;
  transition: color 0.12s ease, background-color 0.12s ease;
  line-height: 1.4;
}

.faq-nav__expand-btn:hover {
  color: var(--faq-text-primary);
  background-color: var(--faq-nav-active-bg);
}

/* When a child page is active, highlight the parent too */
.faq-nav__item--expandable.has-active-child > .faq-nav__expand-btn {
  color: var(--faq-accent);
  border-left-color: var(--faq-nav-active-border);
}

.faq-nav__chevron {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--faq-text-muted);
  transition: transform 0.2s ease;
}

.faq-nav__expand-btn[aria-expanded="true"] .faq-nav__chevron {
  transform: rotate(180deg);
}

/* ─── Sub-list (child pages) ─────────────────────────────────────────────── */
.faq-nav__sub-list {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.2s ease;
}

.faq-nav__sub-list.is-open {
  max-height: 600px;
}

.faq-nav__sub-list .faq-nav__item > a {
  padding-left: 36px;
  font-size: 13px;
  color: var(--faq-text-muted);
}

.faq-nav__sub-list .faq-nav__item > a:hover {
  color: var(--faq-text-primary);
}

.faq-nav__sub-list .faq-nav__item > a.is-active,
.faq-nav__sub-list .faq-nav__item > a[aria-current="page"] {
  color: var(--faq-accent);
  background-color: var(--faq-nav-active-bg);
  border-left-color: var(--faq-nav-active-border);
}

/* ─── Mobile close button (inside sidebar) ───────────────────────────────── */
.faq-nav__close-btn {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--faq-text-muted);
  padding: 6px;
  border-radius: 6px;
}

.faq-nav__close-btn:hover {
  color: var(--faq-text-primary);
  background-color: var(--faq-border);
}

@media (max-width: 768px) {
  .faq-nav__close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
