/* =============================================
   faq.css — FAQ Accordion Component
   Riparazioni Ricci — Component Library
   ============================================= */

/* ── Section ── */
.faq-section {
  padding: clamp(4rem, 6vw, 6rem) 0;
  background: var(--color-background, #fff);
}

.faq-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
.faq-header {
  text-align: center;
  margin-bottom: 48px;
}

.faq-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.faq-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--color-foreground);
  line-height: 1.2;
}

/* ── Divider ── */
.faq-divider {
  height: 1px;
  margin: 24px 0;
  border: none;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.08) 30%, rgba(0,0,0,0.08) 70%, transparent);
}

/* ── Accordion Item ── */
.faq-item {
  background: var(--color-background, #fff);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.faq-item:hover {
  background: var(--surface-subtle);
  border-color: rgba(0,0,0,0.1);
}

.faq-item:hover .faq-chevron {
  color: var(--color-primary);
}

/* Active / open */
.faq-item[data-open="true"] {
  background: var(--color-background, #fff);
  border-color: rgba(37,99,235,0.15);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
}

.faq-item[data-open="true"]:hover {
  background: var(--color-background, #fff);
  border-color: rgba(37,99,235,0.15);
}

/* ── Question button ── */
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 52px;
  padding: 20px 24px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-foreground);
  line-height: 1.4;
  outline: none;
}

.faq-question:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
  border-radius: 10px;
}

/* ── Chevron ── */
.faq-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--slate-400);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), color 200ms ease;
}

.faq-item[data-open="true"] .faq-chevron {
  transform: rotate(180deg);
  color: var(--color-primary);
}

/* ── Answer panel — CSS grid height animation ── */
.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item[data-open="true"] .faq-panel {
  grid-template-rows: 1fr;
}

.faq-panel-inner {
  overflow: hidden;
}

.faq-answer {
  padding: 0 24px 20px 24px;
  font-size: 14px;
  color: var(--color-muted);
  line-height: 1.65;
  opacity: 0;
  transition: opacity 250ms ease 0ms;
}

.faq-item[data-open="true"] .faq-answer {
  opacity: 1;
  transition-delay: 100ms;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .faq-section {
    padding: clamp(2.5rem, 4vw, 4rem) 0;
  }
  .faq-container {
    padding: 0 12px;
  }
  .faq-question {
    padding: 14px 16px;
    font-size: 14px;
  }
  .faq-answer {
    padding: 0 16px 14px 16px;
    font-size: 13px;
  }
}

/* ── Reduced motion (FAQ-specific) ── */
@media (prefers-reduced-motion: reduce) {
  .faq-panel {
    transition: none;
  }
  .faq-answer {
    transition: none;
    opacity: 1;
  }
  .faq-chevron {
    transition: none;
  }
}
