/* Variables par défaut (écrasées dynamiquement via wp_add_inline_style) */
.faq {
  --faq-primary:     #7A1E2C;
  --faq-primary-rgb: 122, 30, 44;
  --faq-header-bg:   #f4d7a6;
  --faq-header-open: #701818;
  --faq-item-border: #836737;

  max-width: 100%;
  margin: auto;
}

.faq__search {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #ddd;
  margin-bottom: 20px;
  line-height: 20px;
}

.faq__filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }

.faq__filter {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
}
.faq__filter.is-active { border-color: var(--faq-primary); }

.faq__item {
  border: 1px solid var(--faq-item-border);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
}

.faq__a-inner { padding: 16px; }

.faq__empty { padding: 16px; border: 1px dashed #ccc; border-radius: 14px; }

/* --- Micro-interactions --- */
.faq__item { transition: transform .18s ease, box-shadow .18s ease; }
.faq__item:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(0,0,0,.08); }

.faq__q:focus-visible,
.faq__copy:focus-visible {
  outline: 3px solid rgba(var(--faq-primary-rgb), .35);
  outline-offset: 2px;
  border-radius: 12px;
}

.faq__q[aria-expanded="true"] .faq__icon {
  transform: rotate(180deg) scale(1.05);
  opacity: 1;
}

/* --- Panel animé : max-height + opacity --- */
.faq__a {
  background: #ffffff;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .32s ease, opacity .22s ease;
  will-change: max-height, opacity;
}
.faq__item.is-open .faq__a { opacity: 1; }

/* --- Highlight lien profond --- */
@keyframes faqFlash {
  0%   { box-shadow: 0 0 0     rgba(var(--faq-primary-rgb), 0); }
  25%  { box-shadow: 0 0 0 6px rgba(var(--faq-primary-rgb), .18); }
  70%  { box-shadow: 0 0 0 10px rgba(var(--faq-primary-rgb), .10); }
  100% { box-shadow: 0 0 0     rgba(var(--faq-primary-rgb), 0); }
}
.faq__item.is-highlight { animation: faqFlash 1.2s ease; }

.faq__item.is-highlight,
.faq__item.is-open { border: 1px solid var(--faq-primary); }

/* --- Accessibilité : réduit les animations --- */
@media (prefers-reduced-motion: reduce) {
  .faq__item, .faq__a, .faq__icon { transition: none !important; animation: none !important; }
}

/* --- En-tête de chaque item --- */
.faq__head {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--faq-header-bg);
  padding: 0;
}
.faq__item.is-highlight .faq__head,
.faq__item.is-open .faq__head { background: var(--faq-header-open); }

/* --- Titre de groupe --- */
.faq__group {
  margin: 26px 0 10px;
  font-size: 20px;
  letter-spacing: .3px;
  text-transform: uppercase;
  opacity: .75;
  border-left: 4px solid var(--faq-primary);
  padding-left: 10px;
  color: var(--faq-primary);
}

/* --- Bouton question --- */
.faq__q {
  flex: 1;
  width: auto;
  text-align: left;
  padding: 16px;
  background: transparent;
  color: #333;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.faq__item.is-highlight .faq__q,
.faq__item.is-open .faq__q { color: white; }

.faq__qtext { white-space: normal; font-weight: 600; color: white; }

/* --- Contenu réponse --- */
.faq__a-inner a          { font-weight: bold; }
.faq__a-inner a:hover    { text-decoration: underline; }
.faq__a-inner > :last-child { margin-bottom: 0; }

/* --- Icône +/– --- */
.faq__icon {
  flex: 0 0 auto;
  color: #fff;
  font-weight: 700;
  transition: transform .18s ease, opacity .18s ease;
  transform-origin: center;
  opacity: .95;
}

/* --- Bouton "Lien" (admins) --- */
.faq__copy {
  flex: 0 0 auto;
  margin-right: 12px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.45);
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.faq__item.is-highlight .faq__icon,
.faq__item.is-open .faq__icon,
.faq__item.is-highlight .faq__copy,
.faq__item.is-open .faq__copy { color: white; }
