/* ============================================================
   Content folded behind a summary line (osp_collapse ext)
   ============================================================ */

details.osp-collapse {
    border: 1px solid #d0d7de;
    border-radius: 6px;
    margin: 1em 0 1.5em;
    background: #fafbfc;
}

details.osp-collapse > summary {
    padding: 0.5em 1em;
    cursor: pointer;
    font-size: 90%;
    font-weight: 700;
    color: #2980b9;
    list-style-position: inside;
}

details.osp-collapse > summary:hover {
    background: #f0f3f7;
}

details.osp-collapse[open] > summary {
    border-bottom: 1px solid #d0d7de;
}

/* Keep a very long include scrollable instead of pushing the page down */
details.osp-collapse > div[class^="highlight-"] {
    max-height: 40em;
    overflow-y: auto;
    margin: 0.5em 1em 1em;
}

/* ── Dark mode ──────────────────────────────────────────────────────────── */

html[data-theme="dark"] details.osp-collapse,
.theme-dark details.osp-collapse { background: #2a2a2a; border-color: #444; }

html[data-theme="dark"] details.osp-collapse > summary:hover,
.theme-dark details.osp-collapse > summary:hover { background: #333; }

html[data-theme="dark"] details.osp-collapse[open] > summary,
.theme-dark details.osp-collapse[open] > summary { border-bottom-color: #444; }
