/* Styles for faq.hbs — the "پرسش‌های متداول" section.
   Ported from the legacy `components/custom/faqAccordion/FaqAccordion.vue` and
   the `components/custom/tab/Tabs.vue` it pulled in; the 1000 breakpoint and
   every size below are the legacy values. The centred title is the legacy home
   page's own override of the shared component (`.faq-section :deep(.title)`). */

.faq {
  display: flex;
  flex-direction: column;
}

.faq-title {
  margin-bottom: 24px;
  color: var(--gray-900);
  font-size: 21px;
  font-weight: 700;
  text-align: center;
}

/* The row scrolls rather than wraps on narrow screens: three Farsi labels do not
   fit side by side, and a wrapped tablist reads as two rows of controls. */
.faq-tabs {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

/* Centred at every width, which is what `/crypto-buy/` asks for. Only the narrow
   case actually changes: the media rule further down already centres the row
   from 1000px up, so this overrides the landing page's leading-edge start. */
.faq--centred-tabs .faq-tabs {
  justify-content: center;
}

/* `line-height: normal` is load-bearing: this app's reset gives buttons
   `font: inherit`, which would pull in the 1.6 body line-height and make the
   tabs taller than the ones on the site being matched. */
.faq-tab {
  flex-shrink: 0;
  min-width: 90px;
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background-color: var(--gray-0);
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  transition: 0.3s ease;
}

/* Driven by the ARIA state rather than a class: the attribute is the thing the
   island already has to keep correct, so there is no second source of truth. */
.faq-tab[aria-selected='true'] {
  border-color: var(--identity);
  background-color: var(--low-identity);
  color: var(--gray-900);
}

/* Without JavaScript the tabs cannot switch anything, so they are hidden and all
   three groups render stacked instead — ten questions a visitor can read beats
   three they can and six they cannot. `html.js` is set by an inline script in
   `head.hbs` before the first paint, so no scripted visitor sees this state.
   `!important` is the counterweight to the inline `style="display: none"` the
   server puts on the closed groups. */
html:not(.js) .faq-tabs {
  display: none;
}

html:not(.js) .faq-panel {
  display: block !important;
}

@media (min-width: 1000px) {
  .faq-title {
    font-size: 36px;
  }

  .faq-tabs {
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
  }

  .faq-tab {
    min-width: 105px;
    padding: 10px 16px;
  }
}
