/* =========================================================
   BURSTY UI KIT — FAQ
========================================================= */

.faq-section {
  padding-block: var(--space-20);
  background: transparent;
  color: var(--text);
  overflow: hidden;
}

.faq-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-10);
}

.faq-header .caption {
  margin-bottom: var(--space-2);
}

.faq-title {
  margin: 0 0 var(--space-3);
  color: var(--text);
}

.faq-subtitle {
  max-width: 620px;
  margin: var(--space-4) 0 0;
  text-align: center;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  max-width: 820px;
  margin-inline: auto;
}

/* Карточка FAQ */

.faq-item {
  position: relative;
  padding: 0 !important;
  overflow: hidden;
  background: var(--surface);
  border-color: var(--border);
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.2s ease,
    background 0.2s ease;
}

.faq-item:hover {
  border-color: var(--border-strong);
}

.faq-item.is-open {
  border-color: var(--accent-alpha-40);
  box-shadow: var(--shadow-md);
}

.faq-item.is-open:hover {
  transform: none;
}

/* Кнопка вопроса */

.faq-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  min-height: 76px;
  padding: var(--space-5) var(--space-6);

  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

@media (hover: hover) {
    .faq-trigger:hover {
    background: var(--bg-soft);
    }
}

.faq-trigger:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--accent-alpha-20);
}

.faq-question {
  flex: 1;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text);
}

.faq-item.is-open .faq-question {
  color: var(--accent);
}

/* Иконка плюс / крестик */

.faq-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--text-secondary);
}

.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 16px;
  height: 2px;
  border-radius: var(--radius-full);
  background: currentColor;
  transition:
    transform 0.25s ease,
    background 0.2s ease;
}

.faq-icon::before {
  transform: translate(-50%, -50%);
}

.faq-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.faq-trigger:hover .faq-icon,
.faq-item.is-open .faq-icon {
  color: var(--accent);
}

.faq-item.is-open .faq-icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

/* Ответ */

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transform: translateY(-6px);

  transition:
    grid-template-rows 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease,
    visibility 0.35s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-item.is-open .faq-answer {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.faq-answer-content {
  min-height: 0;
  overflow: hidden;
  padding: 0 var(--space-6);

  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);

  transition:
    padding 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.25s ease;
}

.faq-item.is-open .faq-answer-content {
  padding-bottom: var(--space-6);
}

@media (max-width: 768px) {
  .faq-answer-content {
    padding-inline: var(--space-4);
  }

  .faq-item.is-open .faq-answer-content {
    padding-bottom: var(--space-4);
  }
}

.faq-answer-content p {
  margin: 0 0 var(--space-3);
  color: inherit;
}

.faq-answer-content p:last-child {
  margin-bottom: 0;
}

.faq-answer-content ul,
.faq-answer-content ol {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-6);
}

.faq-answer-content li + li {
  margin-top: var(--space-2);
}

.faq-answer-content a {
  color: var(--accent);
}

/* =========================================================
   FAQ — плавные переходы
========================================================= */

.faq-item {
  will-change: transform, box-shadow;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    background-color 0.35s ease;
}

.faq-item.is-open {
  border-color: var(--accent-alpha-40);
  box-shadow: var(--shadow-md);
}

@media (hover: hover) {
    .faq-item.is-open:hover {
        transform: translateY(-2px);
    }
}

/* Кнопка вопроса */

.faq-trigger {
  transition:
    background-color 0.35s ease,
    color 0.35s ease;
}

@media (hover: hover) {
    .faq-trigger:hover {
        background: var(--bg-soft);
    }
}

.faq-question {
  transition:
    color 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-item.is-open .faq-question {
  color: var(--accent);
}

/* Плавная иконка */

.faq-icon::before,
.faq-icon::after {
  transition:
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.35s ease,
    opacity 0.35s ease;
}

.faq-item.is-open .faq-icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

/* Панель ответа */

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);

  transition:
    grid-template-rows 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.4s ease,
    visibility 0.55s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-answer-content {
  min-height: 0;
  overflow: hidden;
  padding: 0 var(--space-6);

  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);

  transition:
    padding 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.35s ease;
}

/* Убираем стандартную задержку у карточек,
   так как она задаётся классами .delay-* из UI Kit */

.faq-section .reveal {
  transition-property:
    opacity,
    transform,
    filter;
}

/* Мобильная версия */

@media (max-width: 768px) {
  .faq-answer-content {
    padding-inline: var(--space-4);
  }
}

/* Уважение к настройке уменьшения движения */

@media (prefers-reduced-motion: reduce) {
  .faq-item,
  .faq-trigger,
  .faq-question,
  .faq-icon::before,
  .faq-icon::after,
  .faq-answer,
  .faq-answer-content {
    transition: none;
  }
}