/*
 * ProSocial Agency - FAQ
 * 07-faq.css
 * Deferred tier. Front page, service pages, and anywhere the part runs.
 *
 * Ported from the Hibiscus FAQ. Bordered cards in a narrow column,
 * plus icon rotating to a minus, answer height animated.
 *
 * The answer uses max-height rather than height because height cannot
 * animate from auto. 500px covers every answer we write; a longer one
 * would clip, so keep answers to four sentences.
 */

.faq-section {
  background: var(--color-bg-base);
  padding-block: var(--section-pad-y);
}

.faq-section--alt { background: var(--color-bg-alt); }

.faq-section__header {
  max-width: 780px;
  margin-inline: auto;
  margin-bottom: var(--space-10);
  text-align: center;
}

.faq-section__eyebrow {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-action);
  margin-bottom: var(--space-4);
}

.faq-section__heading {
  font-family: var(--font-heading);
  font-size: var(--text-section);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
  max-width: 100%;
}

.faq-section__intro {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-body);
  line-height: var(--leading-normal);
  margin-top: var(--space-4);
  max-width: 60ch;
  margin-inline: auto;
}

/* -------- List -------- */

.faq-list {
  max-width: 780px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq-item {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow   var(--duration-base) var(--ease-out),
    transform    var(--duration-base) var(--ease-out);
}

/* Lift on hover. Immediate and physical, triggered by the reader
   rather than by scroll position. */
.faq-item:hover {
  border-color: var(--color-border-action);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(19, 30, 54, 0.07);
}

.faq-item.is-open {
  border-color: var(--color-border-action);
  box-shadow: var(--shadow-sm);
}

/* -------- Trigger -------- */

.faq-item__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-5) var(--space-6);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.faq-item__trigger:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.faq-item__question {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
  line-height: var(--leading-snug);
  flex: 1;
}

/* -------- Icon -------- */

.faq-item__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-action-wash);
  border: 1px solid var(--color-border-action);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background     var(--duration-base) var(--ease-out),
              border-color   var(--duration-base) var(--ease-out);
}

.faq-item__icon svg {
  width: 12px;
  height: 12px;
  stroke: var(--color-action);
  transition: transform var(--duration-base) var(--ease-bounce);
}

.faq-item.is-open .faq-item__icon {
  background: var(--color-action);
  border-color: var(--color-action);
}

/* Plus turns into a minus. */
.faq-item.is-open .faq-item__icon svg {
  stroke: var(--color-action-text);
  transform: rotate(45deg);
}

/* -------- Answer -------- */

.faq-item__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-slow) var(--ease-out);
}

.faq-item.is-open .faq-item__answer { max-height: 500px; }

.faq-item__answer p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-body);
  line-height: var(--leading-normal);
  border-top: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-6) var(--space-6);
  margin: 0;
  /* none, not 100%. The answer container collapses to zero height when
     closed, so a percentage resolves against a collapsed box and the
     text wraps far tighter than the card. */
  max-width: none;
}

.faq-item__answer p + p { padding-top: 0; border-top: none; }

/* -------- Footer -------- */

.faq-section__foot {
  max-width: 780px;
  margin-inline: auto;
  margin-top: var(--space-10);
  text-align: center;
}

.faq-section__foot p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin: 0 auto var(--space-5);
  max-width: 52ch;
}

/* -------- Responsive -------- */

@media (max-width: 767px) {
  .faq-item__trigger  { padding: var(--space-4) var(--space-5); gap: var(--space-4); }
  .faq-item__question { font-size: var(--text-base); }
  .faq-item__answer p { padding: var(--space-3) var(--space-5) var(--space-5); }
  .faq-item.is-open .faq-item__answer { max-height: 700px; }
}

@media (prefers-reduced-motion: reduce) {
  .faq-item:hover { transform: none; }

  .faq-item,
  .faq-item__icon,
  .faq-item__icon svg,
  .faq-item__answer { transition: none; }
}