/* ============================================================
   faq.css — categorized 2-column accordion
   - One grid per category, 1col mobile → 2col desktop
   - align-items: start so an open item never stretches its neighbor
   - Open state: orange accent + elevated surface, plus → × icon
   ============================================================ */

.faq {
  padding: var(--space-8) 0;
  background-color: var(--color-bg-alt);
  border-block: 1px solid var(--color-border);
}

/* Enable animating to/from intrinsic sizes (Chromium 129+) */
:root {
  interpolate-size: allow-keywords;
}

/* ------------------------------------------------------------
   Smooth open/close via ::details-content (Chromium 131+).
   Progressive enhancement: unsupported browsers ignore the
   pseudo-element and get the native instant toggle.
   The closed-state transition + allow-discrete content-visibility
   makes the CLOSE animation work too.
   ------------------------------------------------------------ */
.faq-item::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size var(--motion-med) var(--ease-out),
    content-visibility var(--motion-med) var(--ease-out) allow-discrete;
}

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

.faq-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  width: 100%;
}

/* Orange overline / eyebrow category label */
.faq-group__label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-hover);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.faq-group__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right,
      rgba(255, 122, 26, 0.4),
      transparent);
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  align-items: start;
}

@media (min-width: 64rem) {
  .faq-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ------------------------------------------------------------
   Accordion items
   ------------------------------------------------------------ */
.faq-item {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out);
}

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

/* Highlighted open state: orange border + left accent bar + elevated bg */
.faq-item[open] {
  background-color: var(--color-surface-2);
  border-color: rgba(255, 122, 26, 0.5);
  box-shadow: inset 3px 0 0 var(--color-accent),
    0 0 0 1px rgba(255, 122, 26, 0.15),
    0 8px 28px rgba(0, 0, 0, 0.35);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-md);
  transition: color var(--motion-fast) var(--ease-out);
}

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

.faq-item summary:hover {
  color: var(--color-accent-hover);
}

/* Plus icon that rotates into × when the item is open */
.faq-icon {
  position: relative;
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--color-accent);
  transition: transform var(--motion-med) var(--ease-out);
}

.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background-color: currentColor;
  transform: translate(-50%, -50%);
}

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

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

.faq-answer {
  padding: 0 var(--space-5) var(--space-4);
  color: var(--color-text-muted);
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity var(--motion-med) var(--ease-out) 60ms;
}

.faq-item[open] .faq-answer {
  opacity: 1;
}

/* Reduced motion: instant toggle (base.css also zeroes durations globally) */
@media (prefers-reduced-motion: reduce) {
  .faq-item::details-content {
    transition: none;
  }

  .faq-answer {
    opacity: 1;
    transition: none;
  }
}

/* ------------------------------------------------------------
   CTA card at the end of the section
   ------------------------------------------------------------ */
.faq-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  max-width: 38rem;
  margin: var(--space-7) auto 0;
  padding: var(--space-6);
  text-align: center;
  background-color: var(--color-surface-2);
  border: 1px solid rgba(255, 122, 26, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card),
    0 0 48px rgba(255, 122, 26, 0.1);
}

.faq-cta__title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.faq-cta__text {
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
