/*
 * 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: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
  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;
  font-weight: 400;
  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: 14px;
  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);
}

/* ─── Section-list items (direct children of section labels) ────────────── */
/* These items sit at the same visual indent as top-level items,            */
/* NOT at the sub-list indent (36px). Only the expandable sub-pages within  */
/* a section use the deeper indent.                                          */
.faq-nav__section-list > .faq-nav__item > a {
  padding-left: 20px;
  font-size: 14px;
  color: var(--faq-text-nav);
}

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

.faq-nav__section-list > .faq-nav__item > a.is-active,
.faq-nav__section-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);
  font-weight: 500;
}

/* Expandable buttons within a section list also at standard indent */
.faq-nav__section-list > .faq-nav__item--expandable > .faq-nav__expand-btn {
  padding-left: 20px;
}

/* ─── 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;
  }
}

/* ─── Mobile sidebar footer links (Privacy Policy, Terms, Risk Disclosure) ── */
.faq-nav__mobile-footer {
  display: none; /* hidden on desktop — shown only inside mobile overlay */
  padding: 16px 0 24px;
  border-top: 1px solid var(--faq-border);
  margin-top: 8px;
}

@media (max-width: 768px) {
  .faq-nav__mobile-footer {
    display: block;
  }
}

.faq-nav__mobile-footer-links {
  list-style: none;
  margin: 0;
  padding: 0 16px;
}

.faq-nav__mobile-footer-links li {
  margin: 0;
  padding: 0;
}

.faq-nav__mobile-footer-links a {
  display: block;
  padding: 8px 0;
  font-size: 12px;
  color: var(--faq-text-muted) !important;
  text-decoration: none !important;
  transition: color 0.12s ease;
}

.faq-nav__mobile-footer-links a:hover,
.faq-nav__mobile-footer-links a:focus-visible {
  color: var(--faq-accent) !important;
}

/* ─── Home button (back to main site) ────────────────────────────────────── */
.faq-nav__home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 20px 16px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--faq-accent);
  background: transparent;
  border: 1.5px solid var(--faq-accent);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  line-height: 1.3;
}

.faq-nav__home-btn:hover {
  background-color: var(--faq-accent);
  color: #ffffff;
}

.faq-nav__home-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
