/*
 * Блок «Часто задаваемые вопросы» на страницах услуг (2026-10-15, changes/2026-10-15-service-faq/).
 * Разметка — template-parts/service-faq.php, подключение — inc/service-faq.php (только где блок есть, ver = filemtime).
 * Вид — как FAQ на главной (.forwho-*: белые карточки 24px, заголовок 48/36/32px, оранжевый активный вопрос,
 * серый круг с плюсом), но на всю ширину и без картинки.
 */

.faq {
  margin-top: 100px;
  interpolate-size: allow-keywords; /* плавное открытие до height:auto (где поддерживается); наследуется только внутри блока */
}

.faq-title {
  font-size: 48px;
  font-weight: 600;
  line-height: 58.51px;
  text-align: left;
  color: var(--color-green);
}

.faq-items {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background-color: var(--color-white);
  border-radius: 24px;
  overflow: hidden;
  scroll-margin-top: 16px;
  transition: box-shadow .15s ease-in-out;
}

.faq-item:hover,
.faq-item[open] {
  box-shadow: 0 6px 20px 0 rgba(29, 29, 31, .07);
}

.faq-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  list-style: none;
  cursor: pointer;
  color: var(--color-text);
  border-radius: 24px;
  transition: color .15s ease-in-out;
  -webkit-tap-highlight-color: transparent;
}

.faq-item-header::-webkit-details-marker {
  display: none;
}

.faq-item-header:hover,
.faq-item[open] > .faq-item-header {
  color: var(--color-orange);
}

.faq-item-header:focus {
  outline: none;
}

.faq-item-header:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: -4px;
}

.faq-item-question {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  color: inherit;
}

/* плюс в сером круге; открытый вопрос — крестик */
.faq-item-header::after {
  content: "";
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--color-green);
  background:
    linear-gradient(currentColor, currentColor) center / 18px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 18px no-repeat,
    var(--color-lightgrey);
  transition: transform .3s ease, color .15s ease-in-out;
}

.faq-item-header:hover::after,
.faq-item[open] > .faq-item-header::after {
  color: var(--color-orange);
}

.faq-item[open] > .faq-item-header::after {
  transform: rotate(45deg);
}

.faq-item-content {
  padding: 0 24px 24px;
  max-width: 1000px;
}

.faq-item-content p {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  text-align: left;
  color: rgba(35, 38, 47, .8);
}

.faq-item-content p + p {
  margin-top: 12px;
}

.faq-item-content strong,
.faq-item-content b {
  margin: 0; /* в style.css у strong глобально margin 0 5px */
  font-weight: 700;
  color: var(--color-text);
}

.faq-item-content a {
  color: var(--color-orange);
  text-decoration: underline;
}

/* Плавное открытие/закрытие: только в браузерах с ::details-content (отдельные правила — остальные их пропустят) */
.faq-item::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size .3s ease, content-visibility .3s allow-discrete;
}

.faq-item[open]::details-content {
  block-size: auto;
}

@media (prefers-reduced-motion: reduce) {
  .faq-item,
  .faq-item-header,
  .faq-item-header::after {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-item::details-content {
    transition: none;
  }
}

@media (max-width: 780px) {
  .faq-title {
    font-size: 36px;
    line-height: 120%;
  }

  .faq-items {
    margin-top: 32px;
    gap: 8px;
  }

  .faq-item,
  .faq-item-header {
    border-radius: 16px;
  }

  .faq-item-header {
    gap: 16px;
    padding: 18px 16px;
  }

  .faq-item-question {
    font-size: 18px;
  }

  .faq-item-header::after {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    background-size: 14px 2px, 2px 14px;
  }

  .faq-item-content {
    padding: 0 16px 18px;
  }

  .faq-item-content p {
    font-size: 15px;
  }
}

@media (max-width: 520px) {
  .faq-title {
    font-size: 32px;
  }
}
