.faq {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 40px;
  margin-top: 160px;
  padding-bottom: 20px;
}

.faq__title {
  font-family: var(--font-heading);
  font-size: 48px;
  font-variation-settings:
    "wdth" 100,
    "wght" 500;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.faq__heading {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 16px;
  width: min(100%, 622px);
  text-align: center;
}

.faq--research .faq__heading {
  width: min(100%, 700px);
}

.faq__subtitle {
  width: 100%;
  color: var(--color-text-secondary);
  font-size: 20px;
  line-height: 1.2;
}

.faq__list {
  display: flex;
  width: 100%;
  max-width: 1062px;
  flex-direction: column;
  gap: 16px;
}

.faq__item {
  padding: 24px 32px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  background: rgb(255 255 255 / 60%);
  box-shadow: var(--shadow-block);
  transition:
    background-color 180ms ease,
    border-color 180ms ease;
}

.faq__item.is-open {
  border-color: #ece5ff;
  background: var(--color-white);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  background: transparent;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.faq__question span {
  min-width: 0;
}

.faq__question img {
  width: 20px;
  height: 10px;
  flex: 0 0 auto;
  transition: transform 180ms ease;
}

.faq__item.is-open .faq__question img {
  transform: rotate(180deg);
}

.faq__question:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 5px;
}

.faq__answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 240ms ease;
}

.faq__item.is-open .faq__answer {
  grid-template-rows: 1fr;
}

.faq__answer-inner {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.faq__divider {
  width: 100%;
  height: 1px;
  flex: 0 0 1px;
  margin-top: 16px;
  background: var(--color-element);
}

.faq__answer-content,
.faq__answer-content p {
  color: var(--color-text-secondary);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.faq__answer-content > :first-child {
  margin-top: 0;
}

.faq__answer-content > :last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .faq {
    gap: 32px;
    margin-top: 80px;
  }

  .faq__title {
    font-size: 36px;
  }

  .faq__subtitle {
    font-size: 16px;
  }

  .faq__item {
    padding: 20px 12px;
  }

  .faq__question {
    gap: 12px;
    font-size: 16px;
  }

  .faq__question img {
    width: 10px;
    height: 5px;
  }

  .faq__answer-content,
  .faq__answer-content p {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq__item,
  .faq__question img,
  .faq__answer {
    transition: none;
  }
}
