/* ═══ FAQ — accordéon cartes, animation fluide ═══ */

.faq-section {
  padding: 28px 6vw 96px;
  background: color-mix(in srgb, var(--cream) 75%, transparent);
}

.faq-section-head {
  text-align: center;
  max-width: min(920px, 100%);
  margin: 0 auto 28px;
}

/* Tag + titre sur 2 lignes : le h2 global (jusqu’à 6rem) forçait « QUESTIONS » / « FRÉQUENTES » sur 2 lignes */
.faq-section .section-tag {
  margin-bottom: 8px;
}

.faq-section h2 {
  font-size: clamp(1.55rem, 3.2vw + 0.65rem, 2.75rem);
  line-height: 1.05;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  text-wrap: balance;
}

.faq-section .section-sub {
  margin: 0 auto;
}

.faq-panel {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  position: relative;
  background: var(--cream);
  border: 1px solid rgba(26, 18, 8, 0.1);
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 4px 18px rgba(26, 18, 8, 0.06);
  overflow: hidden;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.25s ease;
}

.faq-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, var(--orange), var(--orange-light));
  opacity: 0;
  transform: scaleY(0.4);
  transform-origin: center top;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.faq-item:hover {
  border-color: rgba(254, 115, 20, 0.22);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 8px 28px rgba(26, 18, 8, 0.07);
}

.faq-item.open {
  border-color: rgba(254, 115, 20, 0.32);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 12px 36px rgba(254, 115, 20, 0.1);
}

.faq-item.open::before {
  opacity: 1;
  transform: scaleY(1);
}

.faq-q {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px 18px;
  width: 100%;
  padding: 20px 22px;
  border: none;
  background: transparent;
  font: inherit;
  text-align: left;
  color: var(--dark);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.faq-q:hover,
.faq-q:focus-visible {
  color: var(--orange);
  outline: none;
}

.faq-q:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(254, 115, 20, 0.35);
  border-radius: 18px;
}

.faq-q-index {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  line-height: 1;
  color: rgba(254, 115, 20, 0.88);
  min-width: 2.4rem;
  transition: color 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.faq-item.open .faq-q-index {
  color: var(--orange);
  transform: scale(1.04);
}

.faq-q-text {
  font-weight: 600;
  font-size: 1.03rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.faq-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--orange-glow);
  color: var(--orange);
  flex-shrink: 0;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.25s ease,
    color 0.25s ease;
}

.faq-q:hover .faq-chevron,
.faq-q:focus-visible .faq-chevron {
  background: rgba(254, 115, 20, 0.18);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  background: rgba(254, 115, 20, 0.22);
}

/* Ouverture fluide : max-height évite le bug grid 0fr/1fr (ligne à hauteur 0 selon les moteurs) */
.faq-a-outer {
  display: block;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-item.open .faq-a-outer {
  max-height: 32rem;
}

.faq-a-inner {
  min-height: 0;
}

.faq-a {
  padding: 0 22px 22px calc(22px + 2.4rem + 18px);
  margin: 0;
  border-top: 1px solid rgba(26, 18, 8, 0.08);
  background: rgba(255, 255, 255, 0.35);
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.72;
}

.faq-item:not(.open) .faq-a {
  border-top-color: transparent;
  padding-top: 0;
}

@media (max-width: 520px) {
  .faq-section {
    padding: 22px 5vw 72px;
  }

  .faq-section-head {
    margin-bottom: 22px;
  }

  .faq-section h2 {
    font-size: clamp(1.45rem, 5.5vw + 0.35rem, 2.1rem);
  }

  .faq-q {
    padding: 16px 16px;
    gap: 12px 14px;
  }

  .faq-q-index {
    font-size: 1.15rem;
    min-width: 2rem;
  }

  .faq-q-text {
    font-size: 0.95rem;
  }

  .faq-chevron {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .faq-a {
    padding: 0 16px 18px calc(16px + 2rem + 14px);
    font-size: 0.92rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-a-outer {
    transition-duration: 0.12s;
  }

  .faq-item.open .faq-a-outer {
    transition: none;
  }

  .faq-item,
  .faq-item::before,
  .faq-chevron,
  .faq-q-index {
    transition-duration: 0.15s !important;
  }
}

body.rtl .faq-section-head {
  text-align: right;
}

body.rtl .faq-q {
  text-align: right;
}

body.rtl .faq-a {
  padding: 0 calc(22px + 2.4rem + 18px) 22px 22px;
}

@media (max-width: 520px) {
  body.rtl .faq-a {
    padding: 0 calc(16px + 2rem + 14px) 18px 16px;
  }
}
