/* ==========================================================================
   Decap Radia — FAQ Accordéon (palette Decap Radia)
   Palette alignée sur _template-prestation.html / processus.css :
     --dre-primary  : #04748C   (principal, titre/bordures/fond CTA)
     --dre-primary-d: #056478
     --dre-primary-l: #32A6BE
     --dre-cta      : #F8C117   (état ouvert : question sur fond jaune)
   Spécificité très élevée (html body ...) pour battre Elementor / OceanWP.
   Préfixe `dre-faq-` pour éviter les collisions avec MUC et autres plugins.
   ========================================================================== */

/* === VARIABLES === */
:root {
    --dre-faq-primary:      #04748C;
    --dre-faq-primary-dark: #056478;
    --dre-faq-primary-light:#32A6BE;
    --dre-faq-cta:          #F8C117;
    --dre-faq-text:         #0f172a;
    --dre-faq-muted:        #475569;
}

/* === RESET DUR : ferme tout par défaut, même si le DOM arrive "ouvert" === */
html body .dre-faq-accordion .dre-faq-item .dre-faq-answer {
    max-height: 0 !important;
    overflow: hidden !important;
}

html body .dre-faq-accordion .dre-faq-item .dre-faq-answer[style] {
    /* Permet au JS d'écrire inline style="max-height: XXXpx" quand ouvert */
    max-height: 0 !important;
}

html body .dre-faq-accordion .dre-faq-item.is-open .dre-faq-answer {
    /* Laisse le JS appliquer la hauteur réelle via style inline */
    max-height: none !important;
}

/* === TITRE === */
.dre-faq-title {
    color: var(--dre-faq-primary);
    font-size: clamp(1.5rem, 2.6vw, 2.125rem);
    line-height: 1.2;
    margin: 0 0 24px;
    font-weight: 700;
}

/* === CONTENEUR === */
html body .dre-faq-accordion {
    margin: 24px 0 48px !important;
    display: block !important;
    font-family: inherit !important;
    color: var(--dre-faq-text) !important;
}

/* === ITEM (carte) === */
html body .dre-faq-accordion .dre-faq-item {
    background: transparent !important;
    border: 0 !important;
    border-top: 2px solid var(--dre-faq-primary-light) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

html body .dre-faq-accordion .dre-faq-item:last-child {
    border-bottom: 2px solid var(--dre-faq-primary-light) !important;
}

/* === BOUTON QUESTION === */
html body .dre-faq-question {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    padding: 16px 20px !important;
    text-align: left !important;
    cursor: pointer !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: var(--dre-faq-primary) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    font-size: clamp(0.95rem, 1.4vw, 1.0625rem) !important;
    line-height: 1.35 !important;
    transition: color 200ms ease, background 200ms ease !important;
}

html body .dre-faq-question:hover {
    background: #F1F9FB !important;
}

html body .dre-faq-question:focus-visible {
    outline: 2px dashed var(--dre-faq-primary) !important;
    outline-offset: -4px !important;
}

html body .dre-faq-question-text {
    flex: 1 1 auto !important;
}

/* === ICÔNE + / − === */
html body .dre-faq-icon {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    background: var(--dre-faq-primary) !important;
    background-color: var(--dre-faq-primary) !important;
    border: 0 !important;
    border-radius: 50% !important;
    color: #ffffff !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    transition: background 200ms ease, color 200ms ease !important;
}

/* === ÉTAT OUVERT — bandeau jaune CTA === */
html body .dre-faq-item.is-open > .dre-faq-question {
    background: var(--dre-faq-cta) !important;
    background-color: var(--dre-faq-cta) !important;
    color: var(--dre-faq-text) !important;
}

html body .dre-faq-item.is-open > .dre-faq-question .dre-faq-icon {
    background: var(--dre-faq-text) !important;
    color: var(--dre-faq-cta) !important;
}

/* === RÉPONSE (zone dépliable) === */
html body .dre-faq-answer {
    background: #ffffff !important;
    color: var(--dre-faq-text) !important;
}

html body .dre-faq-answer-content {
    padding: 18px 20px 22px !important;
    color: var(--dre-faq-text) !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

/* === TYPOGRAPHIE DE LA RÉPONSE === */
html body .dre-faq-answer-content p {
    margin: 10px 0 !important;
}

html body .dre-faq-answer-content p:first-child {
    margin-top: 0 !important;
}

html body .dre-faq-answer-content p:last-child {
    margin-bottom: 0 !important;
}

html body .dre-faq-answer-content a {
    color: var(--dre-faq-primary) !important;
    text-decoration: underline !important;
}

html body .dre-faq-answer-content a:hover,
html body .dre-faq-answer-content a:focus-visible {
    color: var(--dre-faq-primary-dark) !important;
}

html body .dre-faq-answer-content strong {
    color: var(--dre-faq-text) !important;
}

html body .dre-faq-answer-content ul,
html body .dre-faq-answer-content ol {
    margin: 10px 0 10px 22px !important;
    padding: 0 !important;
}

html body .dre-faq-answer-content li {
    margin: 6px 0 !important;
}

/* === ÉTAT VIDE === */
.dre-faq-empty {
    color: var(--dre-faq-muted);
    font-style: italic;
    padding: 12px 0;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    html body .dre-faq-question {
        padding: 14px 16px !important;
        gap: 12px !important;
    }
    html body .dre-faq-answer-content {
        padding: 14px 16px 18px !important;
    }
    html body .dre-faq-icon {
        width: 24px !important;
        height: 24px !important;
        font-size: 1.05rem !important;
    }
}

/* === ACCESSIBILITÉ === */
@media (prefers-reduced-motion: reduce) {
    html body .dre-faq-question,
    html body .dre-faq-icon {
        transition: none !important;
    }
}
