/* static/deps/css/faq.css */
@import url('https://fonts.googleapis.com/css2?family=PT+Serif:wght@400;700&family=Open+Sans:wght@300;400;600&display=swap');

/* ==============
   FAQ STYLES
   ============== */

/* Внешний заголовок (вне рамки) */
.faq-heading {
  font-family: 'PT Serif', serif;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 800;
  color: #ffe0ac;
  text-align: center;
  margin: 0 0 1rem;
  line-height: 1.2;
  letter-spacing: 0.3px;
  text-shadow:
    0 3px 10px rgba(0,0,0,0.72),
    0 0 14px rgba(217,199,163,0.12);
}

.faq-heading::after {
  content: "";
  display: block;
  width: 132px;
  height: 3px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, #ccb58d, #e8d8b6, #ccb58d);
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

/* Корневая рамка аккордеона */
#faq-section,
.faq-box {
  border: 2px solid #4f463e;
  border-radius: 10px;
  background-image: url('/static/deps/images/seo-text-bg.avif');
  background-size: cover;
  background-position: center;
  color: #f3eade;
  padding: 1.5rem 0.75rem; /* меньше вертикальных и горизонтальных полей */
  text-align: center;
  box-sizing: border-box;
  position: relative; /* для оверлея */
}
/* Если не хотите фиксированную высоту — оставьте закомментированным */
/* min-height: 850px; */

/* Обёртка внутреннего контента */
#faq-section .faq-container {
  margin: 0 auto;
  padding: 1rem 0.5rem; /* компактнее внутренние поля */
  width: 100%;
  max-width: 820px; /* умеренно компактный контейнер */
  box-sizing: border-box;
  /* Добавим тёмную полупрозрачную панель, чтобы не просвечивал белый фон */
  background: rgba(18, 14, 10, 0.9);
  border-radius: 14px;
  border: 1px solid rgba(221, 198, 154, 0.22);
  box-shadow: inset 0 0 28px rgba(0,0,0,0.35), 0 2px 14px rgba(0,0,0,0.25);
  position: relative; /* поднять над оверлеем */
  z-index: 1;
}

/* удалён overlay ::before для упрощения и совместимости */
/* Вернули затемнение фона (не затрагивает текст и контейнер) */
#faq-section::before,
.faq-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.38);
  pointer-events: none;
  z-index: 0; /* под .faq-container */
}

/* Общие стили аккордеона */
#faq-section .accordion,
.faq-box .accordion {
  width: 100%;
  margin: 0 auto;
  text-align: center;
  display: block;
  /* Сбрасываем возможные bootstrap-фоны */
  background: transparent !important;
}

/* Каждый пункт */
#faq-section .accordion .accordion-item {
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  padding: 0.3rem 0; /* меньше вертикального отступа между пунктами */
  /* Сбрасываем белый фон bootstrap .accordion-item */
  background: transparent !important;
  border-left: none;
  border-right: none;
  border-top: none;
}

/* Кнопка заголовка */
#faq-section .accordion button {
  position: relative;
  display: block;
  margin: 0 auto;
  width: 100%;
  padding: 0.6rem 2rem 0.6rem 0.6rem; /* компактнее поля кнопки */
  color: rgba(243,234,222,0.98);
  font-size: 1.15rem; /* чуть крупнее как просили */
  font-weight: 600;
  border: none;
  background: transparent !important; /* перебиваем bootstrap */
  outline: none;
  cursor: pointer;
  font-family: 'PT Serif', serif;
  text-align: center;
  line-height: 1.55rem; /* пропорционально увеличили */
  letter-spacing: 0.2px;
  text-shadow:
    0 2px 6px rgba(0,0,0,0.65),
    0 0 6px rgba(217,199,163,0.04);
  transition: color .18s ease, transform .12s ease;
}

/* hover/focus */
#faq-section .accordion button:hover,
#faq-section .accordion button:focus {
  color: #d9c7a3;
  transform: translateY(-1px);
  text-shadow:
    0 3px 10px rgba(0,0,0,0.72),
    0 0 12px rgba(217,199,163,0.08);
}

/* Иконка справа */
#faq-section .accordion button .icon {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  width: 20px; /* меньшая иконка */
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(243,234,222,0.12);
  color: rgba(243,234,222,0.95);
  background: rgba(0,0,0,0.12);
  box-shadow: 0 4px 12px rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
  font-size: 10px;
}

/* горизонтальная и вертикальная черты в иконке */
#faq-section .accordion button .icon::before {
  content: "";
  display: block;
  width: 10px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
#faq-section .accordion button .icon::after {
  content: "";
  display: block;
  width: 2px;
  height: 10px;
  background: currentColor;
  border-radius: 1px;
  position: absolute;
}

/* Открытое состояние */
#faq-section .accordion .accordion-item button[aria-expanded='true'] {
  color: #ccb58d;
  text-shadow:
    0 4px 14px rgba(0,0,0,0.72),
    0 0 18px rgba(217,199,163,0.10);
}
#faq-section .accordion .accordion-item button[aria-expanded='true'] .icon {
  background: rgba(204,181,141,0.06);
  border-color: rgba(204,181,141,0.95);
  color: rgba(204,181,141,0.95);
  box-shadow: 0 6px 20px rgba(204,181,141,0.06);
}
/* скрываем вертикальную черту при открытом состоянии */
#faq-section .accordion .accordion-item button[aria-expanded='true'] .icon::after {
  width: 0;
}

/* Контент аккордеона */
#faq-section .accordion .accordion-content {
  /* убираем transition на max-height — будем анимировать height через JS */
  transition: opacity 220ms ease;
  will-change: height, opacity;
  overflow: hidden; /* важно: скрываем переполнение для плавной анимации */
  max-height: none; /* оставляем 'none' только в CSS, а JS будет управлять height в px */
  height: 0;        /* начальное состояние — закрыто (JS синхронизирует) */
  opacity: 0;
  background: transparent !important; /* перебиваем белые подложки */
  border: 0;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

/* Когда открыт (в JS мы тоже управляем max-height) */
#faq-section .accordion .accordion-item button[aria-expanded='true'] + .accordion-content {
  opacity: 1;
  margin-top: 0.4rem; /* меньше отступов вокруг контента */
  padding-top: 0.5rem;
}
/* max-height управляется через JS для точного измерения */

/* Параграфы */
#faq-section .accordion .accordion-content p {
  font-family: 'Open Sans', sans-serif;
  margin: 0.4rem auto 0.7rem; /* компактнее вертикальные отступы */
  font-size: 1.08rem; /* на 1-2 шага крупнее */
  font-weight: 300;
  color: rgba(243,234,222,0.95);
  line-height: 1.7; /* немного больше межстрочный */
  max-width: 72ch; /* немного шире для крупных шрифтов */
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6), 0 0 6px rgba(0,0,0,0.12);
}

/* fallback / совместимость */
.accordion {
  font-size: 1.05rem;
  font-family: 'Open Sans', sans-serif;
  color: rgba(243,234,222,0.9);
  background-color: transparent;
  border: none;
  margin: 0.4rem 0; /* меньше общий вертикальный отступ */
  cursor: pointer;
  padding: 8px 14px;
  width: 100%;
  text-align: center;
  outline: none;
  transition: color .18s ease, background .12s ease;
}

/* Активное состояние для старого .accordion */
.accordion.active, .accordion:hover {
  color: #d9c7a3;
}

/* Фокус */
#faq-section .accordion button:focus,
#faq-section .accordion button:focus-visible {
  outline: 3px solid rgba(204,181,141,0.12);
  outline-offset: 3px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
}

/* Адаптив */
@media (max-width: 768px) {
  #faq-section .faq-container { padding: 0.75rem; }
  #faq-section .accordion button { font-size: 0.98rem; padding-right: 2rem; line-height: 1.5; }
  #faq-section .accordion button .icon { width: 18px; height: 18px; right: 0.4rem; }
  #faq-section .accordion .accordion-content p { font-size: 0.92rem; line-height: 1.6; max-width: 40ch; }
}
