/* Sommaire automatique on Design 2025 SEO articles. */

.wrapperContenuEdito.withSommaire .contenuEdito {
    width: 84%;
    margin: 0 auto;
}

.wrapperContenuEdito.withSommaire .contenuEdito h2,
.wrapperContenuEdito.withSommaire .contenuEdito h3 {
    scroll-margin-top: 157px;
}

@media screen and (min-width: 980px) {
    .wrapperContenuEdito.withSommaire .contenuEdito h2,
    .wrapperContenuEdito.withSommaire .contenuEdito h3 {
        scroll-margin-top: 198px;
    }
}

.sommaireArticle {
    width: 84%;
    margin: 0 auto 6.4vw;
    box-sizing: border-box;
    background-color: #ECE5D3;
    border-radius: 16px;
    padding: 24px;
    font-family: 'Anuphan', sans-serif;
    color: #042E34;
}

.sommaireHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sommaireTitle {
    font-family: 'Archia', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 1.2;
    margin: 0;
    color: #042E34;
}

.sommaireTitle--desktop {
    display: none;
}

.sommaireToggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: inherit;
    font-family: inherit;
}

.sommaireToggleLabel {
    font-family: 'Archia', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 1.2;
    color: #042E34;
}

.sommaireChevron {
    width: 14px;
    height: 8px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8' fill='none'><path d='M1 1L7 7L13 1' stroke='%23042E34' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
    transition: transform 200ms ease;
}

.sommaireArticle[data-state="expanded"] > .sommaireHeader .sommaireChevron {
    transform: rotate(180deg);
}

/* Mobile: hide h3 entries entirely (only h2 entries on mobile). */
.sommaireSubList,
.sommaireSubToggle {
    display: none;
}

.sommaireList {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    max-height: 0;
    margin-top: 0;
    transition: max-height 300ms ease, margin-top 300ms ease;
}

.sommaireArticle[data-state="expanded"] .sommaireList {
    max-height: 4000px;
    margin-top: 24px;
}

.sommaireItem {
    margin: 0;
    padding: 0;
}

.sommaireItem a {
    display: block;
    text-decoration: none;
    color: #042E34;
    font-family: 'Anuphan', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background-color 150ms ease, color 150ms ease;
}

.sommaireItem--h3 {
    padding-left: 24px;
}

.sommaireItem--h3 a {
    font-weight: 400;
    font-size: 15px;
}

.sommaireItem a:hover,
.sommaireItem a:focus-visible {
    background-color: rgba(4, 46, 52, 0.06);
}

.sommaireItem.is-active > a,
.sommaireItem.is-active > .sommaireItemRow > a {
    background-color: #fff;
    font-weight: 700;
}

/* Desktop: 2-column layout, sticky sidebar, list always open, scroll-spy enabled. */
@media screen and (min-width: 980px) {
    .wrapperContenuEdito.withSommaire {
        display: grid;
        grid-template-columns: minmax(280px, 28%) minmax(0, 1fr);
        column-gap: 4vw;
        align-items: start;
        padding-left: 8%;
        padding-right: 8%;
        box-sizing: border-box;
    }

    .wrapperContenuEdito.withSommaire .contenuEdito {
        width: 100%;
        margin: 0;
    }

    .sommaireArticle {
        width: 100%;
        margin: 0;
        position: sticky;
        top: 198px;
        padding: 32px;
        font-size: 18px;
        max-height: calc(100vh - 230px);
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
    }

    .sommaireTitle--desktop {
        display: block;
        font-family: 'Anuphan', sans-serif;
        font-weight: 700;
        font-size: 24px;
    }

    .sommaireHeader {
        display: block;
        flex: 0 0 auto;
    }

    .sommaireToggle {
        display: none;
    }

    .sommaireList {
        max-height: none;
        margin-top: 24px;
        gap: 8px;
        overflow-y: auto;
        flex: 1 1 auto;
        min-height: 0;
        transition: none;
        padding-right: 6px;
        scrollbar-width: thin;
        scrollbar-color: rgba(4, 46, 52, 0.3) transparent;
    }

    .sommaireList::-webkit-scrollbar {
        width: 6px;
    }

    .sommaireList::-webkit-scrollbar-track {
        background: transparent;
    }

    .sommaireList::-webkit-scrollbar-thumb {
        background-color: rgba(4, 46, 52, 0.25);
        border-radius: 3px;
    }

    .sommaireList::-webkit-scrollbar-thumb:hover {
        background-color: rgba(4, 46, 52, 0.45);
    }

    .sommaireItem a {
        font-size: 20px;
        padding: 6px 8px;
    }

    .sommaireItem--h3 a {
        font-size: 18px;
    }

    /* Desktop: h2 entries with children collapse their h3 sublist. */
    .sommaireItemRow {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
    }

    .sommaireItemRow > a {
        flex: 1 1 auto;
        min-width: 0;
    }

    .sommaireSubToggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 32px;
        height: 32px;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 6px;
        cursor: pointer;
        color: inherit;
        transition: background-color 150ms ease;
    }

    .sommaireSubToggle:hover,
    .sommaireSubToggle:focus-visible {
        background-color: rgba(4, 46, 52, 0.08);
    }

    .sommaireSubList {
        display: block;
        list-style: none;
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 250ms ease, margin-top 250ms ease;
    }

    .sommaireItem.has-children[data-state="expanded"] > .sommaireSubList {
        max-height: 2000px;
        margin-top: 4px;
    }

    .sommaireItem.has-children[data-state="expanded"] > .sommaireItemRow .sommaireChevron {
        transform: rotate(180deg);
    }

    .sommaireSubList > .sommaireItem {
        padding: 2px 0;
    }
}

@media screen and (min-width: 1920px) {
    .wrapperContenuEdito.withSommaire {
        column-gap: 80px;
    }

    .sommaireArticle {
        top: 198px;
    }
}

/* Mobile: keep collapsible behavior even when JS is off — use details fallback? Skipped, JS-only. */
