/* ============================================================================
   faq.css — FAQ page styling (links/faq.html + user/faq.html)

   The Phoenix theme already ships the FAQ layout rules for the classes used
   by the template design (faq-title-box, faq-category-tab, faq-subcategory-tab,
   faq-subcategory-content, faq-list). This file only adapts them to
   Palladium's own hero/container — no per-template inline styles.
   ========================================================================= */

/* The theme positions .faq-title-box for a 208px banner image; Palladium's
   hero is taller, so the search card is centred inside it instead of offset. */
.faq-hero .faq-title-box,
.faq-member-search {
  top: 0;
  width: 100%;
  max-width: 46rem;
}

/* Category sidebar: the theme's inline 90% width in the template is replaced
   by a full-width card list (SADD §7.1 — no inline style attributes). */
.faq-subcategory-tab {
  width: 100%;
}

.faq-subcategory-tab .category-icon {
  display: inline-block;
}

/* FAQ entries: the bullet icon is styled by the theme (.faq-list li .fa-circle);
   entries keep the template's generous vertical rhythm, with the optional
   call-to-action button sitting right under the answer. */
.faq-list li .faq-list-cta {
  margin-top: 0.75rem;
}

/* Empty state shown by faq.js when the search matches nothing in a category. */
.faq-search-empty {
  margin-top: 2rem;
  font-size: 0.875rem;
}

.faq-page-content {
  min-width: 0;
}

.faq-page .faq-subcategory-content {
  min-width: 0;
}

/* Keep the Phoenix offcanvas interaction on phones, but restore the sidebar
   to normal grid flow once the FAQ has two columns.

   Mobile layout: the offcanvas becomes a flex column.
   ┌─────────────────────────┐
   │ .faq-category-tab       │  ← fixed header (flex-shrink: 0), never scrolls
   │  Popular | All          │
   ├─────────────────────────┤
   │ .faq-subcategory-tab    │  ← scrollable region (flex: 1, overflow-y: auto)
   │  [Registering]          │
   │  [Membership req…]      │
   │  [What members can do]  │
   └─────────────────────────┘
   The two regions never overlap because they are siblings in a flex column. */
@media (max-width: 767.98px) {
  .faq-page .faq-sidebar,
  .faq-sidebar#faq-offcanvas,
  #faq-offcanvas.faq-sidebar {
    top: var(--phoenix-navbar-top-height) !important;
    width: min(100%, 22rem) !important;
    height: calc(100dvh - var(--phoenix-navbar-top-height)) !important;
    z-index: 1045 !important;

    /* Flex column: category tab on top, cards scroll below */
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;        /* the sidebar itself does NOT scroll */
    padding: 0 !important;
  }

  /* ── Fixed header: category filter tabs ─────────────────────────────── */
  .faq-page .faq-sidebar .faq-category-tab,
  #faq-offcanvas .faq-category-tab {
    position: static !important;        /* NOT sticky — it's a flex header */
    top: auto !important;
    flex-shrink: 0 !important;
    z-index: 2 !important;
    background-color: var(--phoenix-body-bg) !important;
    padding: 0.75rem 1rem 0 !important;
    border-bottom: 1px solid var(--phoenix-border-color-translucent) !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    width: 100% !important;
  }

  /* ── Scrollable region: subcategory cards ───────────────────────────── */
  .faq-page .faq-sidebar .faq-subcategory-tab,
  #faq-offcanvas .faq-subcategory-tab {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 1.25rem 1rem 1.5rem 1rem !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    display: block !important;
  }

  .faq-page .faq-sidebar .faq-subcategory-tab .nav-item,
  #faq-offcanvas .faq-subcategory-tab .nav-item {
    margin-bottom: 1rem !important;
  }

  .faq-page .faq-title-box,
  .faq-title-box {
    padding: 1.5rem 1.25rem;
  }

  .faq-page .faq-subcategory-content,
  .faq-subcategory-content {
    position: static;
    margin-top: 0;
  }
}

@media (min-width: 768px) {
  .faq-page .faq-sidebar,
  .faq-sidebar#faq-offcanvas,
  #faq-offcanvas.faq-sidebar {
    position: static !important;
    visibility: visible !important;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
    overflow: visible !important;
    padding: 0 !important;
    display: block !important;
  }

  .faq-page .faq-sidebar .faq-category-tab,
  #faq-offcanvas .faq-category-tab {
    position: sticky !important;
    top: var(--phoenix-navbar-top-height) !important;
    z-index: 1020 !important;
  }

  .faq-page .faq-sidebar .faq-subcategory-tab,
  #faq-offcanvas .faq-subcategory-tab {
    overflow-y: visible !important;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .faq-member-search {
    max-width: 42rem;
  }
}

@media (min-width: 1200px) {
  .faq-member-search {
    max-width: 46rem;
  }
}
