.faq {
  padding-bottom: 56px;
  --faq-rule: rgba(246, 249, 255, .1);
  --faq-ease: cubic-bezier(.22, .75, .25, 1);
}

.faq-list {
  display: grid;
  gap: 8px;
  margin-top: 32px;
}

/* The outer shell clips the square-edged header and paints the single shared hover border. */
.faq-category {
  --card-surface: linear-gradient(var(--panel), var(--panel));
  --border: var(--faq-rule);
  min-width: 0;
  overflow: hidden;
  --faq-radius: 16px;
  border-radius: var(--faq-radius);
}

.faq :is(summary, button) {
  appearance: none;
  width: 100%;
  border: 0;
  margin: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }
.faq :is(summary, button):focus-visible {
  outline: 2px solid var(--white);
  outline-offset: -3px;
}

.faq-heading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 7px 7px 15px;
  border-radius: 0;
  background: linear-gradient(-38.39deg, #312b2c, #10162e);
  font: 700 20px/normal Oswald, sans-serif;
  text-transform: uppercase;
}

.faq .faq-heading:focus-visible {
  outline: none;
}
.faq-heading:focus-visible::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 2px;
  border: 2px solid var(--white);
  border-radius: calc(var(--faq-radius) - 3px);
}
.faq-heading[aria-expanded="true"]:focus-visible::after,
.faq-category[open] > .faq-heading:focus-visible::after {
  border-bottom-left-radius: 2px;
  border-bottom-right-radius: 2px;
}

.faq-count {
  position: relative;
  flex: none;
  padding: 34px 12px 6px;
  border-radius: 8px;
  background: rgba(253, 173, 30, .1);
  color: #fdad1e;
  font: 600 12px/normal Inter, sans-serif;
  text-align: center;
  text-transform: none;
}

.faq-count::before,
.faq-count::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background-color: currentColor;
  transform: translate(-50%, -50%);
}

.faq-count::after {
  transform: translate(-50%, -50%) rotate(90deg);
  transition: transform 260ms var(--faq-ease);
}

.faq-heading[aria-expanded="true"] .faq-count::after,
.faq-category[open] > summary .faq-count::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 320ms var(--faq-ease), opacity 200ms ease;
}

.faq-topic > .faq-panel { transition-duration: 240ms, 180ms; }
.faq [aria-expanded="true"] + .faq-panel {
  grid-template-rows: 1fr;
  opacity: 1;
}

.faq-clip {
  min-height: 0;
  overflow: hidden;
  overflow: clip;
}

.faq-topics { padding: 4px 15px; }
.faq-topic + .faq-topic { border-top: 1px solid var(--faq-rule); }

.faq-topic > :is(summary, button) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 8px;
  min-height: 48px;
  padding: 12px 0;
  background: transparent;
  font: 400 14px/20px Inter, sans-serif;
}

/* This is an in-flow flex item, so wrapping the question cannot hide or move it into the answer. */
.faq-topic > :is(summary, button)::after {
  content: "";
  flex: 0 0 24px;
  height: 24px;
  background: center / 24px 24px no-repeat url("assets/faq/up.svg");
  opacity: .72;
  transition: transform 240ms var(--faq-ease), opacity 180ms ease;
}

.faq-topic > button[aria-expanded="true"]::after,
.faq-topic[open] > summary::after {
  opacity: 1;
  transform: rotate(180deg);
}

.faq-topic p {
  padding: 3px 32px 12px 0;
  color: rgba(246, 249, 255, .6);
  font: 400 12px/18px Inter, sans-serif;
}

.faq-topic p a { text-decoration: underline; }

.faq-topic p a:focus-visible {
  outline-width: 2px;
  outline-offset: 1px;
}

@media (max-width: 767px) {
  .faq { padding-bottom: 40px; }
  .faq-list { margin-top: 24px; }
  .faq-category { --faq-radius: 12px; }
  .faq-heading {
    background: linear-gradient(-69.06deg, #312b2c, #10162e);
    font-size: 16px;
  }
  .faq-count {
    width: 64px;
    padding-top: 30px;
    font-size: 10px;
    line-height: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-panel, .faq-count::after, .faq-topic > :is(summary, button)::after { transition: none; }
}
