/* =========================================================
   style-histoire.css
   Objectif : garder la charte (variables + boutons + typos)
   et apporter une mise en page spécifique à histoire.html
   ========================================================= */

/* --------- Base page --------- */
.histoire-kicker {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color);
    background: rgba(0, 102, 255, 0.08);
    padding: 8px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.histoire-lead {
    font-size: 20px;
    color: var(--text-gray);
    line-height: 1.8;
    margin-top: 18px;
    max-width: 62ch;
}

.histoire-next {
    margin-top: 28px;
    font-size: 17px;
    color: var(--text-gray);
}

.histoire-next a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --------- Hero --------- */
.histoire-hero {
    padding: 80px 0 60px;
    background: linear-gradient(135deg, #F0F7FF 0%, #E0EFFE 100%);
}

.histoire-hero .container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
    align-items: center;
}

.histoire-hero__content h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.18;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.histoire-hero__cta {
    display: flex;
    gap: 16px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.histoire-hero__media {
    margin: 0;
}

.histoire-hero__media img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
}

.histoire-hero__media figcaption {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-gray);
}

/* --------- Table of contents --------- */
.histoire-toc {
    position: sticky;
    top: 76px;
    /* hauteur approx de la navbar sticky */
    z-index: 900;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #E5E7EB;
}

.histoire-toc .container {
    padding: 14px 24px;
}

.histoire-toc ul {
    list-style: none;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.histoire-toc a {
    display: inline-block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid #E5E7EB;
    background: var(--bg-white);
}

.histoire-toc a:hover {
    color: var(--primary-color);
    border-color: rgba(0, 102, 255, 0.35);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

/* --------- Sections --------- */
.histoire-section {
    padding: 80px 0;
    background: var(--bg-white);
}

.histoire-section:nth-of-type(even) {
    background: var(--bg-light);
}

.histoire-section__header {
    max-width: 900px;
    margin: 0 auto 44px;
    padding: 8px;
    border-radius: 18px;
    text-align: center;
}

.histoire-section__header h2 {
    font-size: 40px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.histoire-section__header p {
    font-size: 18px;
    color: var(--text-gray);
    line-height: 1.8;
    margin: 0 auto;
    max-width: 70ch;
}

.histoire-section a {
    color: var(--primary-color);
    font-weight: 600;
}

.histoire-section a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --------- Split layout (texte + media) --------- */
.histoire-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.histoire-split__text p {
    font-size: 18px;
    color: var(--text-gray);
    line-height: 1.85;
    margin-bottom: 18px;
}

.histoire-split__media {
    margin: 0;
}

.histoire-split__media img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(229, 231, 235, 0.9);
}

.histoire-split__media figcaption {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-gray);
}

/* --------- Value cards --------- */
.histoire-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.histoire-card {
    background: var(--bg-white);
    border: 2px solid #E5E7EB;
    border-radius: 16px;
    padding: 30px 28px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.histoire-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 102, 255, 0.35);
    box-shadow: var(--shadow-lg);
}

.histoire-card h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.histoire-card p {
    font-size: 17px;
    color: var(--text-gray);
    line-height: 1.75;
}

/* --------- Steps (Méthode) --------- */
.histoire-steps {
    list-style: none;
    counter-reset: step;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
}

.histoire-steps li {
    background: var(--bg-white);
    border: 2px solid #E5E7EB;
    border-radius: 16px;
    padding: 22px 22px 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.histoire-steps li::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(1200px 200px at 0% 0%, rgba(0, 102, 255, 0.08), transparent 60%);
    pointer-events: none;
}

.histoire-steps li:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 102, 255, 0.35);
    box-shadow: var(--shadow-md);
}

.histoire-steps h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.histoire-steps p {
    font-size: 17px;
    color: var(--text-gray);
    line-height: 1.75;
    margin: 0;
}

/* --------- FAQ --------- */
.histoire-faq {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    gap: 14px;
}

.histoire-faq details {
    background: var(--bg-white);
    border: 2px solid #E5E7EB;
    border-radius: 16px;
    padding: 18px 18px;
    box-shadow: var(--shadow-sm);
}

.histoire-faq details[open] {
    border-color: rgba(0, 102, 255, 0.35);
    box-shadow: var(--shadow-md);
}

.histoire-faq summary {
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-dark);
    list-style: none;
}

.histoire-faq summary::-webkit-details-marker {
    display: none;
}

.histoire-faq summary::after {
    content: "＋";
    float: right;
    font-weight: 900;
    color: var(--primary-color);
}

.histoire-faq details[open] summary::after {
    content: "−";
}

.histoire-faq p {
    margin-top: 12px;
    font-size: 17px;
    color: var(--text-gray);
    line-height: 1.8;
}

/* --------- Bottom CTA --------- */
.histoire-cta-bottom {
    max-width: 900px;
    margin: 28px auto 0;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

/* --------- Responsive --------- */
@media (max-width: 968px) {
    .histoire-hero .container {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .histoire-hero__content h1 {
        font-size: 38px;
    }

    .histoire-lead {
        font-size: 18px;
    }

    .histoire-split {
        grid-template-columns: 1fr;
    }

    .histoire-cards {
        grid-template-columns: 1fr;
    }

    .histoire-section__header h2 {
        font-size: 34px;
    }

    .histoire-toc {
        position: relative;
        /* évite les surprises sur mobiles */
        top: 0;
    }

    .histoire-toc .container {
        padding: 12px 24px;
    }
}

@media (max-width: 640px) {
    .histoire-hero {
        padding: 56px 0 40px;
    }

    .histoire-hero__content h1 {
        font-size: 30px;
    }

    .histoire-hero__cta {
        flex-direction: column;
    }

    .histoire-hero__cta .btn-primary,
    .histoire-hero__cta .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .histoire-section {
        padding: 56px 0;
    }

    .histoire-section__header {
        margin-bottom: 28px;
    }

    .histoire-section__header h2 {
        font-size: 28px;
    }

    .histoire-section__header p,
    .histoire-split__text p,
    .histoire-steps p,
    .histoire-faq p {
        font-size: 16px;
    }

    .histoire-toc a {
        width: 100%;
        text-align: center;
    }
}

/* --------- Print --------- */
@media print {

    .histoire-toc,
    .navbar,
    footer,
    .histoire-hero__cta,
    .histoire-cta-bottom {
        display: none !important;
    }

    .histoire-section {
        padding: 24px 0 !important;
    }
}



/* FIX: empêcher les sections / toc de passer au-dessus de la navbar */
header {
    position: sticky;
    top: 0;
    z-index: 99999;
    /* au-dessus de tout */
    isolation: isolate;
    /* évite des bugs de stacking context */
}

.navbar {
    position: relative;
    z-index: 99999;
}

/* Le sommaire reste visible mais sous la navbar */
.histoire-toc {
    z-index: 1000;
}

/* S'assure que le contenu reste "en dessous" */
main,
.histoire-hero,
.histoire-section {
    position: relative;
    z-index: 0;
}