/* Accordéon FAQ — FESWEB
 *
 * Remplace des styles écrits en inline qui ne fixaient que le fond (#f7f7f7)
 * sans jamais fixer la couleur du texte : celui-ci héritait du thème et
 * ressortait en blanc sur gris clair, donc illisible.
 *
 * Règle appliquée ici : tout élément qui pose un fond pose aussi sa couleur
 * de texte. Aucune couleur n'est laissée à l'héritage.
 *
 * Palette reprise du thème : violet #5f2dde (--primary-color) et rose #fe0054
 * (--link-color-hover), sur fond blanc.
 */

.page-faq {
   --faq-encre: #191430;
   --faq-encre-douce: #55506B;
   --faq-accent: #5F2DDE;
   --faq-accent-vif: #FE0054;
   --faq-bord: #E4E0F2;
   --faq-surface: #FFFFFF;
   --faq-survol: #F8F6FF;

   margin: 56px 0;
}

.page-faq__inner {
   max-width: 860px;
   margin: 0 auto;
}

/* ---------- Titre ---------- */
.page-faq__head {
   margin: 0 0 28px;
}

.page-faq__kicker {
   display: inline-block;
   font-size: 12px;
   font-weight: 700;
   letter-spacing: .14em;
   text-transform: uppercase;
   color: var(--faq-accent);
   margin: 0 0 10px;
}

.page-faq__title {
   font-size: clamp(24px, 3.4vw, 34px);
   line-height: 1.2;
   font-weight: 700;
   color: var(--faq-encre);
   margin: 0;
}

.page-faq__lead {
   margin: 12px 0 0;
   font-size: 16px;
   line-height: 1.65;
   color: var(--faq-encre-douce);
   max-width: 62ch;
}

/* ---------- Liste ---------- */
.faq-list {
   display: flex;
   flex-direction: column;
   gap: 12px;
}

.faq-item {
   background: var(--faq-surface);
   border: 1px solid var(--faq-bord);
   border-radius: 12px;
   overflow: hidden;
   transition: border-color .18s ease, box-shadow .18s ease;
}

.faq-item:hover {
   border-color: #CFC6EE;
}

.faq-item.is-open {
   border-color: var(--faq-accent);
   box-shadow: 0 10px 30px -18px rgba(95, 45, 222, .55);
}

/* ---------- Question ---------- */
/* Chaque question est un titre de niveau 3 sous le h2 de la section : la
   hierarchie reste correcte et le bouton porte l'interaction. */
.faq-item__heading {
   margin: 0;
   font-size: inherit;
   font-weight: inherit;
   line-height: inherit;
}

.faq-question {
   /* La couleur est posée explicitement : c'est elle qui manquait. */
   color: var(--faq-encre);
   background: transparent;
   border: 0;
   margin: 0;
   width: 100%;
   display: flex;
   align-items: flex-start;
   justify-content: space-between;
   gap: 18px;
   padding: 20px 22px;
   text-align: left;
   font-family: inherit;
   font-size: 17px;
   font-weight: 600;
   line-height: 1.45;
   cursor: pointer;
   transition: color .18s ease, background-color .18s ease;
}

.faq-question:hover {
   background: var(--faq-survol);
   color: var(--faq-accent);
}

.faq-question:focus-visible {
   outline: 2px solid var(--faq-accent);
   outline-offset: -3px;
   border-radius: 12px;
}

.faq-item.is-open .faq-question {
   color: var(--faq-accent);
}

/* Chevron dessiné en CSS : pas d'image, pas de dépendance à une police d'icônes */
.faq-question__icon {
   flex: 0 0 auto;
   width: 22px;
   height: 22px;
   margin-top: 2px;
   position: relative;
   border-radius: 50%;
   background: var(--faq-survol);
   transition: transform .25s ease, background-color .18s ease;
}

.faq-question__icon::before,
.faq-question__icon::after {
   content: "";
   position: absolute;
   top: 50%;
   left: 50%;
   width: 10px;
   height: 2px;
   border-radius: 2px;
   background: var(--faq-accent);
   transform: translate(-50%, -50%);
   transition: opacity .2s ease, background-color .18s ease;
}

.faq-question__icon::after {
   transform: translate(-50%, -50%) rotate(90deg);
}

.faq-item.is-open .faq-question__icon {
   background: var(--faq-accent);
}

.faq-item.is-open .faq-question__icon::before,
.faq-item.is-open .faq-question__icon::after {
   background: #FFFFFF;
}

/* En position ouverte le "+" devient un "−" */
.faq-item.is-open .faq-question__icon::after {
   opacity: 0;
}

/* ---------- Réponse ---------- */
.faq-answer {
   padding: 0 22px 22px;
   border-top: 1px solid var(--faq-bord);
   margin-top: -1px;
}

.faq-answer p {
   margin: 18px 0 0;
   font-size: 16px;
   line-height: 1.72;
   color: var(--faq-encre-douce);
}

.faq-answer p:first-child {
   margin-top: 18px;
}

.faq-answer a {
   color: var(--faq-accent);
   text-decoration: underline;
   text-underline-offset: 2px;
}

.faq-answer a:hover {
   color: var(--faq-accent-vif);
}

/* `hidden` doit rester efficace même si le thème force un display sur la classe */
.faq-answer[hidden] {
   display: none;
}

@media (max-width: 600px) {
   .faq-question {
      font-size: 16px;
      padding: 17px 18px;
   }
   .faq-answer {
      padding: 0 18px 18px;
   }
}

@media (prefers-reduced-motion: reduce) {
   .faq-item,
   .faq-question,
   .faq-question__icon,
   .faq-question__icon::before,
   .faq-question__icon::after {
      transition: none;
   }
}
