/* faq.css — Foire aux questions (page-faq.php)
 * Chargé uniquement sur le template de page FAQ.
 */

/* ── Layout : catégories (gauche) + accordéon (droite) ── */
.faq-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 72px;
  align-items: start;
}
@media (max-width: 1023px) {
  .faq-layout { grid-template-columns: 1fr; gap: 40px; }
}

/* ── Colonne catégories ── */
.faq-cats { position: sticky; top: calc(var(--header-h, 62px) + 24px); }
@media (max-width: 1023px) { .faq-cats { position: static; } }

.faq-cats-label {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  margin: 0 0 16px;
}
.faq-cats-nav { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 1023px) {
  .faq-cats-nav { flex-direction: row; flex-wrap: wrap; gap: 8px; }
}

.faq-cat-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease;
}
.faq-cat-tab:hover { background: var(--surface); }
.faq-cat-tab.is-active { background: var(--primary-container); }
.faq-cat-tab.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  background: var(--primary);
  border-radius: 1px;
}
.faq-cat-name {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  transition: color 0.18s ease;
}
.faq-cat-tab:hover .faq-cat-name { color: var(--text); }
.faq-cat-tab.is-active .faq-cat-name { font-weight: 600; color: var(--primary); }
.faq-cat-count {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-light);
  opacity: 0.75;
}
.faq-cat-tab.is-active .faq-cat-count { color: var(--primary); }

/* CTA contact sous les catégories */
.faq-cats-cta {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Desktop : CTA dans l'aside (sous les catégories). Mobile : CTA après les questions. */
.faq-cats-cta--mobile { display: none; }
@media (max-width: 1023px) {
  .faq-cats-cta--desktop { display: none; }
  .faq-cats-cta--mobile { display: block; margin-top: 40px; }
}
.faq-cats-cta-text {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.faq-cats-cta-link {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
  padding-bottom: 2px;
}

/* ── Animations d'entrée ─────────────────────────────────────────────────────
 * Déclenchées à chaque fois qu'un panneau devient .is-active (chargement initial
 * et chaque changement d'onglet). Le passage par display:none remet les
 * animations à zéro — rejeu garanti sans JS supplémentaire.
 * Step de 50ms entre chaque item pour un décalage discret et naturel.
 * ─────────────────────────────────────────────────────────────────────────── */
@keyframes faqIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.faq-panel.is-active .faq-panel-head {
  animation: faqIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.faq-panel.is-active .faq-item {
  animation: faqIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.faq-panel.is-active .faq-item:nth-child(1)  { animation-delay: 0.07s; }
.faq-panel.is-active .faq-item:nth-child(2)  { animation-delay: 0.12s; }
.faq-panel.is-active .faq-item:nth-child(3)  { animation-delay: 0.17s; }
.faq-panel.is-active .faq-item:nth-child(4)  { animation-delay: 0.22s; }
.faq-panel.is-active .faq-item:nth-child(5)  { animation-delay: 0.27s; }
.faq-panel.is-active .faq-item:nth-child(6)  { animation-delay: 0.32s; }
.faq-panel.is-active .faq-item:nth-child(7)  { animation-delay: 0.37s; }
.faq-panel.is-active .faq-item:nth-child(8)  { animation-delay: 0.42s; }
.faq-panel.is-active .faq-item:nth-child(9)  { animation-delay: 0.47s; }
.faq-panel.is-active .faq-item:nth-child(n+10) { animation-delay: 0.50s; }
@media (prefers-reduced-motion: reduce) {
  .faq-panel.is-active .faq-panel-head,
  .faq-panel.is-active .faq-item { animation: none; }
}

/* ── Panneaux ── */
.faq-panel { display: none; }
.faq-panel.is-active { display: block; }

.faq-panel-head { margin-bottom: 40px; }
.faq-panel-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 12px;
}
.faq-panel-intro {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* ── Accordéon ── */
.faq-accordion { display: flex; flex-direction: column; }

.faq-item {
  border-top: 1px solid rgba(0, 0, 0, 0.09);
  /* Compense le header fixe lors du scrollIntoView */
  scroll-margin-top: calc(var(--header-h, 62px) + 16px);
}

.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
.faq-q-text {
  flex: 1;
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: 21px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
  transition: color 0.2s ease;
}
.faq-q:hover .faq-q-text,
.faq-item.is-open .faq-q-text { color: var(--primary); }

.faq-q-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  position: relative;
  font-size: 0; /* masque le caractère + du HTML */
  color: var(--text-light);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, color 0.2s ease;
}
/* Barre horizontale et barre verticale du + dessinées en CSS pur */
.faq-q-icon::before,
.faq-q-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: currentColor;
  border-radius: 1px;
}
.faq-q-icon::before {
  width: 11px;
  height: 1.5px;
  transform: translate(-50%, -50%);
}
.faq-q-icon::after {
  width: 1.5px;
  height: 11px;
  transform: translate(-50%, -50%);
}
.faq-item.is-open .faq-q-icon {
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(45deg);
}

/* Réponse — animation hauteur via grid-template-rows */
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.faq-item.is-open .faq-a { grid-template-rows: 1fr; }
.faq-a-inner { overflow: hidden; }
.faq-a-content {
  padding-bottom: 32px;
  padding-right: 52px;
  font-family: 'Newsreader', serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}
@media (max-width: 767px) { .faq-a-content { padding-right: 0; } }
.faq-a-content p { margin: 0 0 16px; }
.faq-a-content p:last-child { margin-bottom: 0; }
.faq-a-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
