/* details.css */
/* Shared disclosure surface. Navigation uses its own menu controls. */
:is(main, [role="main"]) details:not(:where(
    header *, nav *, footer *, .site-menu, .site-menu *, .locale-menu,
    .locale-menu *, .nav-slot, .nav-slot *, [data-fold-exempt], [data-fold-exempt] *
)) {
    box-sizing: border-box;
    min-width: 0;
    margin: 16px 0;
    border: 1px solid #dcded5;
    border-radius: 12px;
    background: #fffef9;
    padding: 0 16px;
    box-shadow: none;

    &[open] {
        padding-bottom: 16px;
    }

    & details:not(:where(header *, nav *, footer *, [data-fold-exempt], [data-fold-exempt] *)) {
        background: transparent;
    }

    &:has(+ details:not(:where(.site-menu, .locale-menu, .nav-slot, [data-fold-exempt]))) {
        margin-bottom: 0;
    }

    & + details:not(:where(.site-menu, .locale-menu, .nav-slot, [data-fold-exempt])) {
        margin-top: 8px;
    }

    & > summary {
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 9px;
        min-height: 44px;
        margin: 0;
        border: 0;
        background: transparent;
        padding: 12px 0;
        box-shadow: none;
        font-size: 1rem;
        font-weight: 600;
        color: #222c28;
        cursor: pointer;
        list-style: none;
        text-indent: 0;

        &::marker {
            content: "";
        }

        &::-webkit-details-marker {
            display: none;
        }

        &::before {
            content: "▸";
            flex: 0 0 12px;
            width: 12px;
            color: currentColor;
            text-align: center;
        }

        & > :is(h2, h3, h4, strong) {
            margin: 0;
            font: inherit;
            color: inherit;
        }
    }

    &[open] > summary::before {
        transform: rotate(90deg);
    }
}

/* Keep the homepage control label with the shared arrow. */
#xml-workspace > summary .home-workspace-control {
    margin-left: auto;
}
#xml-workspace > summary .home-workspace-chevron {
    display: none;
}
