/* ============================================================
   FAQ ACCORDION — components/faq.css
   One look for every FAQ on the site (the homepage style).
   Each page keeps its own section shell and header; the list,
   items, question, +/× icon and answer live here.
   Behaviour (pages' JS): .faq-item.open + aria-expanded on the
   button. Collapsed answers are visibility:hidden, so they are out
   of the focus order and the accessibility tree.

   Markup:
   <div class="faq-list">
     <div class="faq-item">
       <h3 class="faq-q">
         <button class="faq-question" type="button" aria-expanded="false"
                 aria-controls="a1" id="q1">
           <span>Question</span><span class="faq-icon" aria-hidden="true"></span>
         </button>
       </h3>
       <div class="faq-answer" id="a1" role="region" aria-labelledby="q1">
         <div><p>Answer</p></div>
       </div>
     </div>
   </div>

   Dark sections: add .faq-list--dark to the list.
   ============================================================ */

.faq-list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--radius-xl);
}

.faq-item {
  position: relative;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background-color var(--transition);
}
.faq-item:last-child { border-bottom: 0; }

/* Accent bar on the open item */
.faq-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--primary);
  opacity: 0;
  transition: opacity var(--transition);
}
.faq-item.open::before { opacity: 1; }
.faq-item.open { background: rgba(255, 90, 31, 0.025); }

/* The question is a heading; the button keeps its own typography */
.faq-q { margin: 0; font: inherit; }

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  width: 100%;
  min-height: 64px;
  padding: 20px 24px;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  line-height: 1.45;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: color var(--transition);
}
.faq-question:hover { color: var(--primary-on-light); }
.faq-item.open .faq-question { color: var(--primary-on-light); font-weight: var(--fw-strong); }
.faq-question:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }

/* + that turns into × (drawn in CSS) */
.faq-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  color: var(--text-secondary);
  background: transparent;
  transition:
    transform 0.35s var(--ease-out),
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition);
}
/* Any old inline SVG icon is replaced by the CSS one */
.faq-icon svg { display: none; }
.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  border-radius: 2px;
  background: currentColor;
}
.faq-icon::after { transform: rotate(90deg); }
.faq-item.open .faq-icon {
  transform: rotate(45deg);
  background: var(--primary-solid);
  border-color: var(--primary-solid);
  color: #fff;
}

/* Answer: grid-rows animation */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.38s var(--ease-out), visibility 0s linear 0.38s;
}
.faq-item.open .faq-answer {
  grid-template-rows: 1fr;
  visibility: visible;
  transition-delay: 0s;
}
.faq-answer > div { overflow: hidden; }
.faq-answer p {
  margin: 0;
  padding: 0 24px 22px 27px;
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--text-secondary);
}
.faq-answer p + p { margin-top: -10px; }
.faq-answer a { color: var(--primary-on-light); text-decoration: underline; text-underline-offset: 3px; }

/* ── Dark sections ──
   Same surface language as the other dark cards (pricing, products):
   a faint white veil over --dark-bg, not an opaque brown step. */
.faq-list--dark {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.09);
}
.faq-list--dark .faq-item { border-bottom-color: rgba(255, 255, 255, 0.07); }
.faq-list--dark .faq-item.open { background: rgba(255, 90, 31, 0.06); }
.faq-list--dark .faq-question { color: var(--text-on-dark); }
.faq-list--dark .faq-question:hover,
.faq-list--dark .faq-item.open .faq-question { color: var(--primary-on-dark); }
.faq-list--dark .faq-question:focus-visible { outline-color: var(--primary-on-dark); }
.faq-list--dark .faq-icon { border-color: rgba(255, 255, 255, 0.24); color: var(--text-on-dark); }
.faq-list--dark .faq-item.open .faq-icon { border-color: var(--primary-solid); color: #fff; }
.faq-list--dark .faq-answer p { color: var(--text-muted-on-dark); }
.faq-list--dark .faq-answer a { color: var(--primary-on-dark); }

/* Link from a short FAQ to a longer one */
.faq-more { margin-top: var(--sp-3); text-align: center; }
.faq-more a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 15px;
  font-weight: var(--fw-medium);
  color: var(--primary-on-dark);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}
.faq-more a:hover { text-decoration-color: currentColor; }

@media (max-width: 560px) {
  .faq-question { padding: 18px 18px; gap: var(--sp-2); }
  .faq-answer p { padding: 0 18px 20px 21px; }
}

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