/* ── Page layout ──────────────────────────────────────────────────────────── */

body > main > .documentation-page {
    display: flex;
}

.documentation-page {
    padding: 1rem 1rem;
    display: flex;
    gap: 2rem;
    flex-direction: row;
    align-items: stretch;
    min-height: 75vh;
    justify-content: space-between;
    

    .documentation-toc-container {
        width: 33%;
        padding: 16px;
        max-width: 300px;
        min-width: 250px;
        position: sticky;
        top: 6rem;
        background: linear-gradient(135deg, #daf3f3, #def7e4);
        border-radius: 10px;
        height: calc(100vh - 7rem);
        overflow-y: auto;

        .documentation-toc-search {

            .documentation-toc-search__input {
                width: 100%;
            }
        }
    }

    .documentation-content {
        max-width: 900px;
        padding: 0 2rem;
        flex-grow: 1;
        padding-bottom: var(--page-content-footer-spacing);
        /* padding-right: var(--news-ribbon-spacing); */
    }
}

/* ── TOC ──────────────────────────────────────────────────────────────────── */

.toc ul {
    font-size: 14px;
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-wrap: break-word;
}

    .toc ul ul {
        padding-left: 1.25rem;
    }

.toc li {
    font-weight: 400;
    margin: 0;
    padding: 0.2rem .85rem;
    position: relative;
}

    /* Expandable item: stub + link on one line, child ul full-width below */
    .toc li.expander {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

        .toc li.expander > a {
            flex: 1;
        }

        .toc li.expander > ul {
            flex-basis: 100%;
            padding-left: 1.25rem;
            display: none;
        }

        .toc li.expander.expanded > ul {
            display: block;
        }

/* Chevron — Bootstrap Icons bi-chevron-right, rotates 90° when expanded */
.expand-stub {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

    .expand-stub::before {
        font-family: bootstrap-icons;
        content: '\f285';
        font-size: 0.7rem;
        transition: transform 0.15s ease;
    }

.toc li.expander.expanded > .expand-stub::before {
    transform: rotate(90deg);
}

/* TOC link hover/focus */
.toc li > a:hover,
.toc li > a:focus {
    text-decoration: underline;
}

/* TOC section label (no link) */
.toc li > span {
    font-weight: 600;
    display: inline-block;
}

/* Active TOC item */
.toc li.active > a {
    font-weight: 700;
    color: var(--text);
}

/* In this article */
.affix {
    display: block;
    width: 33%;
    max-width: 250px;
    min-width: 200px;
    max-height: calc(100vh - 60px - 1.6rem);
    overflow-x: hidden;
    overflow-y: auto;
    position: sticky;
    top: calc(60px + 1.6rem);
    top: 6rem;
    font-size: 13px;
    margin-top: 2.5rem;
}

    .affix h5 {
        display: inline-block;
        margin: 0;
        font-weight: 300;
        text-transform: uppercase;
        padding-bottom: .5em;
        font-size: 14px;
        letter-spacing: 2px;
    }

.border-bottom {
    border-bottom: 1px solid #dee2e6;
}

.affix ul {
    flex-direction: column;
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

    .affix ul li {
        margin: .4rem 0;
    }

        .affix ul li a {
            text-decoration: none;
        }

            .affix ul li a:hover, .affix ul li a:focus {
                text-decoration: underline;
            }

/* ── Content area ─────────────────────────────────────────────────────────── */
/* All rules below are scoped to .documentation-content so they cannot affect  */
/* the site's navbar, footer, or any other page chrome.                        */

@scope (.documentation-content) {

    /* ── Breadcrumb ───────────────────────────────────────────────────── */

    #breadcrumb {
        margin-bottom: 1rem;
        margin-top: 0rem;
    }

    .breadcrumb {
        display: flex;
        flex-wrap: wrap;
        padding: 0;
        margin-bottom: 0;
        font-size: 12px;
        list-style: none;
    }

    .breadcrumb-item + .breadcrumb-item {
        padding-left: 0.5rem;
    }

        .breadcrumb-item + .breadcrumb-item::before {
            float: left;
            padding-right: 0.5rem;
            color: var(--bs-secondary-color, #6c757d);
            content: "/";
        }

    .breadcrumb a {
        color: var(--orange);
        text-decoration: none;
    }

        .breadcrumb a:hover,
        .breadcrumb a:focus {
            text-decoration: underline;
        }

    /* ── Typography ───────────────────────────────────────────────────── */

    p {
        margin-top: 0;
        margin-bottom: 1rem;
    }

    ul,
    ol {
        padding-left: 2rem;
        margin-top: 0;
        margin-bottom: 1rem;
    }

    a {
        color: var(--orange);
        text-decoration: underline;
    }

        a:hover {
            text-decoration: none;
        }

    /* ── Code ─────────────────────────────────────────────────────────── */

    code {
        font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        font-size: 0.875em;
        color: #d63384;
        background-color: #f8f9fa;
        padding: 0.15em 0.3em;
        border-radius: 4px;
    }

    pre {
        display: block;
        background-color: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        padding: 1rem;
        overflow-x: auto;
        margin-top: 0;
        margin-bottom: 1rem;
        font-size: 0.875em;
    }

        pre code {
            background: none;
            padding: 0;
            color: inherit;
            font-size: inherit;
            border-radius: 0;
        }

    /* ── Tables ───────────────────────────────────────────────────────── */
    /* DocFX generates bare <table> with no Bootstrap class. */

    table {
        border-collapse: collapse;
        width: 100%;
        margin-bottom: 1rem;
    }

        table td,
        table th {
            border: 1px solid #dee2e6;
            padding: .5rem;
            vertical-align: top;
        }

        table thead th {
            vertical-align: bottom;
            border-bottom-width: 2px;
            font-weight: 600;
        }

    /* ── Blockquote ───────────────────────────────────────────────────── */

    blockquote {
        border-left: 4px solid #dee2e6;
        padding: 0.5rem 1rem;
        margin: 0 0 1rem;
        color: #6c757d;
    }

    /* ── Divider ──────────────────────────────────────────────────────── */

    hr {
        border: 0;
        border-top: 1px solid #dee2e6;
        margin: 1.5rem 0;
    }

    /* ── Images ───────────────────────────────────────────────────────── */

    img {
        max-width: 100%;
        height: auto;
        margin-bottom: 2rem;
    }

    /* ── Alert / callout boxes ────────────────────────────────────────── */
    /* DocFX > [!NOTE]      → .alert.alert-info                           */
    /* DocFX > [!TIP]       → .alert.alert-success                        */
    /* DocFX > [!WARNING]   → .alert.alert-warning                        */
    /* DocFX > [!IMPORTANT] → .alert.alert-danger                         */
    /* DocFX > [!CAUTION]   → .alert.alert-danger                         */

    .alert {
        padding: 1rem;
        margin-bottom: 1rem;
        border: 1px solid transparent;
        border-radius: 4px;
    }

        .alert h5 {
            margin-top: 0;
            margin-bottom: 0.5rem;
            font-size: 0.875rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

    .alert-info {
        background-color: #cfe2ff;
        border-color: #b6d4fe;
        color: #084298;
    }

    .alert-success {
        background-color: #d1e7dd;
        border-color: #badbcc;
        color: #0f5132;
    }

    .alert-warning {
        background-color: #fff3cd;
        border-color: #ffecb5;
        color: #664d03;
    }

    .alert-danger {
        background-color: #f8d7da;
        border-color: #f5c2c7;
        color: #842029;
    }
}

@media (max-width: 576px) {
    .documentation-page {
        flex-direction: column;

        .documentation-toc-container {
            width: 100%;
            max-width: none;
            position: relative;
            top: auto;
            height: auto;
            margin-bottom: 0rem;
        }

        .documentation-content {
            padding: 0 1rem;
        }

        .affix {
            display: none;
        }
    }
}
