/* The FAQ page of transcrib.si — the parts of it that the common style does
 * not have: the tools of the search, the list of the questions and the card
 * of a single question.
 *
 * The tokens, the colours and the radius come from assets/style.css. This
 * file only adds the layout of the FAQ page, so the page looks like the rest
 * of the site and nothing else has to change.
 */

/* ----------------------------------------------------------------- tools */

.faq-tools {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
  background: var(--bg-raised);
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
}

.faq-tools__search {
  max-width: 640px;
}

.faq-tools__topics {
  display: grid;
  gap: var(--space-2);
}

.faq-tools__label {
  font-size: var(--fs-300);
  font-weight: 600;
  color: var(--text-muted);
}

.faq-tools__topics .chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* The topic chips are buttons, not the labels of the common style. */
.chip {
  cursor: pointer;
  font-family: inherit;
  line-height: 1.5;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.chip:hover {
  border-color: var(--brand);
  color: var(--text);
}

.chip.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-strong);
  font-weight: 600;
}

.chip__count {
  display: inline-block;
  min-width: 1.4em;
  margin-left: 0.35em;
  padding: 0 0.35em;
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--text-muted);
  font-size: var(--fs-200);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.chip.is-active .chip__count {
  background: var(--bg-raised);
  color: var(--brand-strong);
}

.faq-tools__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: var(--border-w) solid var(--line);
}

.faq-tools__count {
  font-size: var(--fs-300);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ list */

.faq-list {
  display: grid;
  gap: var(--space-4);
}

.faq-card {
  padding: var(--space-5);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.faq-card[hidden] {
  display: none;
}

.faq-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.faq-card__q {
  margin: 0;
  font-size: var(--fs-500);
  font-weight: 650;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}

.faq-card__topic {
  flex: none;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: var(--fs-200);
  white-space: nowrap;
}

.faq-card__a {
  margin: 0 0 var(--space-4);
  color: var(--text);
  line-height: var(--lh-body);
}

.faq-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: var(--border-w) solid var(--line);
}

.faq-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

.faq-card__link {
  font-size: var(--fs-300);
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.faq-card__link:hover {
  border-bottom-color: currentColor;
}

.faq-card__source {
  margin: var(--space-3) 0 0;
  font-size: var(--fs-200);
  color: var(--text-muted);
  word-break: break-word;
}

.faq-card__source code {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

/* A question that was opened by its own link. */
.faq-card.is-hit {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

@media (max-width: 640px) {
  .faq-tools {
    padding: var(--space-4);
  }

  .faq-card {
    padding: var(--space-4);
  }

  .faq-card__foot {
    flex-direction: column;
    align-items: flex-start;
  }
}
