/* ============================================================
   guide-choisir.css — Layout et animation des pages /GUIDES/
   Toutes les règles scopées à .guide-page — aucun reset global
   ============================================================ */

/* ── Conteneur principal ──────────────────────────────────── */
#guide-container.guide-page {
    position: relative;
    overflow-x: hidden;
}

/* ── Hero ─────────────────────────────────────────────────── */
.guide-page .header {
    position: relative;
    min-height: 100svh;
    width: 100%;
}

.guide-page .bg-img {
    position: absolute;
    overflow: hidden;
    top: 0; left: 0; right: 0; bottom: 0;
    backface-visibility: hidden;
}

.guide-page .bg-img img {
    position: absolute;
    top: 0; left: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ── Titre hero ───────────────────────────────────────────── */
.guide-page .title {
    z-index: 1000;
    position: absolute;
    top: 50%;
    left: 0;
    padding: 0 3em 0 2em;
    width: 60%;
    transform: translateX(33.3%) translateY(-50%);
}
.guide-page .title h1 {
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.6rem, 4vw, 3rem);
    color: #516165;
    padding: 0 0 0.5em;
    line-height: 1.2;
    margin: 0;
}
.guide-page .title p {
    opacity: 0;
    color: #7b8d92;
    transform: translateY(100px);
    font-size: 1rem;
    font-weight: 300;
    margin:0 0 0.6em;
    line-height: 1.5;
}

.guide-page .title p.subline {
    font-size: 1.15rem;
}

.guide-page .title p.guide-author {
    font-size: 0.85rem;
    font-style: italic;
}

/* ── Bouton trigger ───────────────────────────────────────── */
.guide-page button.trigger {
    position: fixed;
    bottom: 40px;
    left: 50%;
    z-index: 5000;
    display: block;
    width: 2.5em;
    height: 2.5em;
    margin-left: -1.25em;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.guide-page button.trigger::before {
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    color: #fff;
    content: attr(data-info);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    padding: 0.35em 0.75em;
    background: rgba(81, 97, 101, 0.7);
    border-radius: 2px;
    pointer-events: none;
}

/* Chevron CSS pur (remplace icomoon de la démo) */
.guide-page button.trigger span {
    display: block;
    width: 0.9em;
    height: 0.9em;
    margin: 0.7em auto 0;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.guide-page:not(.notrans) button.trigger {
    transition: opacity 0.3s 0.5s;
}

.guide-page.modify:not(.notrans) button.trigger {
    opacity: 0;
    pointer-events: none;
    transition-delay: 0s;
}

/* ── Zone de contenu ──────────────────────────────────────── */
.guide-page .content {
    position: relative;
    z-index: 10;
    background:#ffffff82;
    margin: 0 auto;
    padding: 0 0 5rem;
}

.guide-page .content > div {
    opacity: 0;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.25em;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATION — intro-effect-side
   ══════════════════════════════════════════════════════════ */

.guide-page .bg-img::before,
.guide-page .bg-img::after {
    content: '';
    position: absolute;
    z-index: 100;
}

/* Panneau blanc glissant depuis la gauche */
.guide-page .bg-img::before {
    background: #fff;
    top: 0; left: 0;
    width: 60%;
    height: 100%;
    transform: translateX(-100%);
}

.guide-page.modify .bg-img::before {
    transform: translateX(0);
}

/* Bordure décorative */
.guide-page .bg-img::after {
    border: 80px solid #fff;
    top: -80px; right: -80px; bottom: -80px; left: -80px;
    background-color: rgba(255, 255, 255, 0.5);
}

.guide-page.modify .bg-img::after {
    top: 0; right: 0; bottom: 0; left: 0;
    background-color: rgba(255, 255, 255, 0);
}

/* Titre glisse à gauche */
.guide-page.modify .title {
    transform: translateY(-50%);
}

/* Paragraphes apparaissent */
.guide-page.modify .header p {
    opacity: 1;
    transform: translateX(0);
}

/* Contenu fond entrant */
.guide-page.modify .content > div {
    opacity: 1;
}

/* ── Transitions ──────────────────────────────────────────── */
.guide-page:not(.notrans) .bg-img::before,
.guide-page:not(.notrans) .title {
    transition: transform 0.5s cubic-bezier(0.7, 0, 0.3, 1);
}

.guide-page:not(.notrans) .bg-img::after {
    transition: top    0.5s cubic-bezier(0.7, 0, 0.3, 1),
                left   0.5s cubic-bezier(0.7, 0, 0.3, 1),
                bottom 0.5s cubic-bezier(0.7, 0, 0.3, 1),
                right  0.5s cubic-bezier(0.7, 0, 0.3, 1),
                background-color 0.5s cubic-bezier(0.7, 0, 0.3, 1);
}

.guide-page:not(.notrans) .header p {
    transition: transform 0.5s cubic-bezier(0.7, 0, 0.3, 1),
                opacity  0.5s cubic-bezier(0.7, 0, 0.3, 1);
}

.guide-page:not(.notrans) .content > div {
    transition: opacity 0.5s cubic-bezier(0.7, 0, 0.3, 1);
}

/* ── Délais ───────────────────────────────────────────────── */

/* État normal : bg + title avec délai (pour l'anim retour) */
.guide-page:not(.notrans) .title,
.guide-page:not(.notrans) .bg-img::before,
.guide-page:not(.notrans) .bg-img::after {
    transition-delay: 0.3s;
}

/* État .modify : bg + title immédiats */
.guide-page.modify:not(.notrans) .title,
.guide-page.modify:not(.notrans) .bg-img::before,
.guide-page.modify:not(.notrans) .bg-img::after {
    transition-delay: 0s;
}

.guide-page.modify:not(.notrans) .header p:nth-last-child(2) {
    transition-delay: 0.15s;
}

.guide-page.modify:not(.notrans) .header p:last-child {
    transition-delay: 0.2s;
}

.guide-page.modify:not(.notrans) .content > div {
    transition-delay: 0.3s;
}

/* ═══════════════════════════════════════════════════════════
   BLOCS DE CONTENU
   ══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   ACCORDION
   ══════════════════════════════════════════════════════════ */

/* Conteneur section */
.guide-block {
    border-top: 1px solid rgba(81, 97, 101, 0.18);
    overflow: hidden;
    border-radius: 3px;
}

.guide-block:last-of-type {
    border-bottom: 1px solid rgba(81, 97, 101, 0.18);
}

/* H2 wrapper — structure WAI-ARIA APG (h2 enveloppe le button) */
.guide-block-title {
    margin: 0;
    padding: 0;
    display: block;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-family: "Story Script", sans-serif;
    font-weight: 400;
    line-height: 1.25;
    color: #516165;
}

/* Bouton titre — hérite la police du h2 parent */
.guide-accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
    background: transparent;
    cursor: pointer;
    text-align: left;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: none;
    border-bottom: none;
    font: inherit;
    color: inherit;
}

.guide-accordion-trigger:hover {
    filter: brightness(0.96);
}

/* Icône + / × */
.guide-accordion-icon {
    flex-shrink: 0;
    position: relative;
    width: 1.2em;
    height: 1.2em;
}

.guide-accordion-icon::before,
.guide-accordion-icon::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    background: #516165;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.guide-accordion-icon::before {
    width: 2px; height: 14px;
    transform: translate(-50%, -50%);
}

.guide-accordion-icon::after {
    width: 14px; height: 2px;
    transform: translate(-50%, -50%);
}

.guide-accordion-trigger[aria-expanded="true"] .guide-accordion-icon::before {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

/* Stage = contexte perspective + animateur de hauteur */
.guide-accordion-stage {
    height: 0;
    overflow: hidden;
    perspective: 1200px;
}

.guide-accordion-stage.guide-opening {
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapse progressif à la fermeture — évite le snap brutal */
.guide-accordion-stage.guide-closing {
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Corps du contenu = élément animé */
.guide-accordion-body {
    padding: 0.5rem 1.5rem 2rem;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    will-change: transform, opacity;
    border-left: 3px solid #FFF;
    border-right: 3px solid #FFF;
}

/* Float layout : texte enroulé autour de l'image */
.guide-accordion-body::after {
    content: '';
    display: table;
    clear: both;
}

.guide-has-img--left .guide-block-img {
    float: left;
    width: clamp(200px, 40%, 400px);
    margin: 0 1.75rem 1rem 0;
}

.guide-has-img--right .guide-block-img {
    float: right;
    width: clamp(200px, 40%, 400px);
    margin:0 0 0.7rem 1rem;
}

/* ── Keyframes ─────────────────────────────────────────────── */

@keyframes guideGlueLeft {
    40%  { transform: rotateY(15deg);               opacity: 0.8; animation-timing-function: ease-out; }
    100% { transform: scale(0.8) translateZ(-200px); opacity: 0; }
}

@keyframes guideFromRight {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

.guide-accordion-body.guide-anim-out {
    transform-origin: 0% 50%;
    animation: guideGlueLeft 0.8s ease-in both;
}

.guide-accordion-body.guide-anim-in {
    animation: guideFromRight 0.6s ease both;
}

/* ── Contenu de chaque bloc ────────────────────────────────── */

.guide-block-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 14px rgba(81, 97, 101, 0.12);
    margin-bottom: 1rem;
}

.guide-block-text {
    color: #4a5568;
    line-height: 1.8;
    font-size: 0.98rem;
}

.guide-block-text .ds-bullet {
    color: #516165;
    font-weight: 600;
}

/* Bouton CTA */
.guide-cta {
    display: block;
    padding: 0.6em 1.5em;
    background: #007abc;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: background 0.2s;
    width: 70%;
    box-shadow: 1px 2px 5px #00000096;
    border: 2px solid #FFF;
    text-transform: uppercase;
    text-align: center;
    margin: 10px auto;
}
.guide-cta:hover,
.guide-cta:focus {
    background: #43939d;
    color: #fff;
    outline-offset: 3px;
}

/* Liste blist */
.guide-blist {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.guide-blist-item {
    padding: 0.8rem 0;
    border-top: 1px solid #edeae8;
    color: #4a5568;
    line-height: 1.65;
    font-size: 0.98rem;
}

.guide-blist-item:first-child {
    border-top: none;
}

.guide-blist-link {
    display: inline-block;
    margin-top: 0.2rem;
    color: #43939d;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

.guide-blist-link:hover,
.guide-blist-link:focus {
    color: #516165;
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════
   FAQ
   ══════════════════════════════════════════════════════════ */

.guide-faq {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 2px solid #516165;
}

.guide-faq-title {
    font-size: clamp(1.2rem, 2.5vw, 1.55rem);
    font-weight: 700;
    color: #516165;
    margin: 0 0 1.25rem;
}

.guide-faq-item {
    border-bottom: 1px solid #edeae8;
}

.guide-faq-item:first-of-type {
    border-top: 1px solid #edeae8;
}

.guide-faq-question {
    display: block;
    padding: 1rem 2.5rem 1rem 0;
    font-weight: 600;
    color: #516165;
    cursor: pointer;
    list-style: none;
    position: relative;
    font-size: 1rem;
    line-height: 1.45;
}

.guide-faq-question::-webkit-details-marker { display: none; }

.guide-faq-question::after {
    content: '+';
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 300;
    color: #43939d;
    transition: transform 0.2s ease;
    line-height: 1;
}

.guide-faq-item[open] .guide-faq-question::after {
    transform: translateY(-50%) rotate(45deg);
}

.guide-faq-answer {
    padding: 0 0 1.25rem;
    color: #4a5568;
    line-height: 1.8;
    font-size: 0.98rem;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media screen and (max-width: 47em) {
    .guide-page .title {
        width: 100%;
        padding: 0 1.25em;
        transform: translateY(-50%);
    }

    /* Sur mobile le panneau blanc ne glisse pas */
    .guide-page.modify .bg-img::before {
        transform: translateX(-100%);
    }

    .guide-page .bg-img::after {
        border-left-width: 0;
        border-right-width: 0;
        right: 0; left: 0;
        background: rgba(255, 255, 255, 0.15);
    }

    .guide-page.modify .bg-img::after {
        background: rgba(255, 255, 255, 0.85);
    }

    .guide-has-img--left .guide-block-img,
    .guide-has-img--right .guide-block-img {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 0 0 1rem 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   PREFERS-REDUCED-MOTION
   ══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
