/* Table of contents */

.table-of-contents {
    box-sizing: border-box;

    /* Keep the table of contents from overlapping floated elements. */
    display: flow-root;

    /*
     * Limit the width to 420px and keep at least 100px when space allows.
     * Move below floated images when the minimum width does not fit.
     */
    width: fit-content;
    min-width: min(100px, 100%);
    max-width: min(420px, 100%);

    margin-top: 1em;
    margin-right: 1em;
    margin-bottom: 1em;
    margin-left: 0;

    padding: 0.75em 1em;

    border: 1px solid #a2a9b1;
    background-color: #f8f9fa;

    line-height: 1.5;
}


/* Table of contents title */

.toc-title {
    font-size: 18px;
    font-weight: bold;

    margin-bottom: 0.5em;
}


/* Top-level sections (H2) */

.toc-main-list {
    list-style: none;

    margin: 0;
    padding: 0;
}


/* Reserve space on the right of each top-level item for the expand button. */
.toc-main-item {
    position: relative;
    min-height: 34px;

    margin: 0;
    padding: 0 42px 0.45em 0;

    box-sizing: border-box;
}

/* Top-level section link */

.toc-main-item > a {
    line-height: 1.4;
}


/* Expandable subsections */

.toc-subsections {
    display: block;
}


/*
 * Style the summary as a small button anchored to the top of the list item.
 * Do not center it within the full item: expanded subsections can make it tall.
 */
.toc-subsections > summary {
    position: absolute;

    top: 0;
    right: 0;

    width: 34px;
    height: 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    padding: 0;
    margin: 0;

    border: 1px solid #a2a9b1;
    border-radius: 4px;

    background-color: #ffffff;

    cursor: pointer;

    list-style: none;

    user-select: none;
}


/* Hide the default browser disclosure marker */

.toc-subsections > summary::-webkit-details-marker {
    display: none;
}

.toc-subsections > summary::marker {
    content: "";
}


/* Custom chevron */

.toc-subsections > summary::before {
    content: "›";

    display: block;

    font-size: 24px;
    line-height: 1;

    color: #54595d;

    transition: transform 0.15s ease;
}


/* Expanded state */

.toc-subsections[open] > summary::before {
    transform: rotate(90deg);
}


/* Hover */

.toc-subsections > summary:hover {
    background-color: #eaecf0;
    border-color: #72777d;
}


/* Keyboard focus */

.toc-subsections > summary:focus-visible {
    outline: 2px solid #3366cc;
    outline-offset: 2px;
}


/* Subsections */

.toc-sub-list {
    list-style: none;

    margin-top: 0.4em;
    margin-bottom: 0.5em;
    margin-left: 1.3em;

    padding-left: 0.8em;

    border-left: 1px solid #c8ccd1;
}

.toc-sub-item {
    margin: 0.2em 0;
}


/* Table of contents links */

.table-of-contents a {
    text-decoration: none;
    color: #3366cc;
}

.table-of-contents a:hover {
    text-decoration: underline;
}


/* Touch devices */

@media (pointer: coarse) {
    .toc-main-item {
        min-height: 46px;
        padding-right: 52px;
    }

    .toc-subsections > summary {
        width: 44px;
        height: 44px;
    }
}

/* Screen reader only text */

.visually-hidden {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}


/* Main navigation */

.navigation-bar-main {
    float: right;
}

.navigation-bar-main ul {
    list-style-type: none;

    margin: 0;
    padding: 0;

    overflow: hidden;

    background-color: white;
}

.navigation-bar-main li {
    float: left;

    margin-right: 3px;

    /*
     * border-radius: 10px;
     * border-right: 1px solid #bbb;
     * border-top: 1px solid #bbb;
     * border-bottom: 1px solid #bbb;
     * border-left: 1px solid #bbb;
     */
}

.navigation-bar-main li a {
    display: block;

    text-align: center;

    padding: 7px 8px;

    text-decoration: underline;
}

.navigation-bar-main li a:hover {
    text-decoration: underline;
}


/* Clear floats after the columns */

.row:after {
    content: "";

    display: table;

    clear: both;
}