/* =============================================================================
   Furo theme customisations
   =========================================================================== */

/* --- Releases table: smaller font ----------------------------------------- */

table.small-font-table {
    font-size: 0.8rem;
}

/* --- Left sidebar width --------------------------------------------------- */

:root {
    --sidebar-width: 20rem;  /* default is 15rem; increase as needed */
}

/* --- Right TOC collapse toggle -------------------------------------------- */

/* The toggle button sits on the left edge of the TOC drawer.
   position: fixed keeps it vertically centred while scrolling. */
.toc-toggle-btn {
    position: fixed;
    top: 50vh;
    transform: translateY(-50%);
    z-index: 51;

    width: 1.1rem;
    height: 2.5rem;
    padding: 0;

    border: 1px solid var(--color-background-border);
    border-right: none;
    border-radius: 0.3rem 0 0 0.3rem;

    background: var(--color-background-secondary);
    color: var(--color-foreground-secondary);
    cursor: pointer;
    font-size: 0.65rem;
    line-height: 1;

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

    transition: background 0.15s ease, color 0.15s ease;
}

.toc-toggle-btn:hover {
    background: var(--color-background-hover);
    color: var(--color-foreground-primary);
}

/* The toggle button sits on the left edge of the TOC drawer. */
.toc-drawer {
    position: relative;
    transition: width 0.2s ease, min-width 0.2s ease;
}

/* Wide-screen collapse logic — only on screens where Furo shows the inline TOC
   (>82em). On smaller screens Furo uses its own overlay; the toggle is hidden. */
@media (min-width: 83em) {
    /* Pages with no local TOC: automatically expand content into the empty right
       column — same layout as the manually-collapsed state, no button needed. */
    .main:has(.toc-drawer.no-toc) .content {
        width: calc(46em + 15em);
    }

    /* Shrink the drawer to zero; keep overflow visible so the toggle button
       remains clickable outside the collapsed zero-width box. */
    .toc-drawer.toc-collapsed {
        width: 0 !important;
        min-width: 0 !important;
        overflow: visible;
    }

    .toc-drawer.toc-collapsed .toc-sticky {
        display: none;
    }

    /* Grow content by exactly the TOC width (15em) so the freed space is
       absorbed into the text area.  Nothing else moves — the sidebar, the
       remaining viewport space, and the content's own padding (0 3em) all
       stay identical. */
    .main.toc-collapsed .content {
        width: calc(46em + 15em);
    }
}

/* Hide the toggle on small screens — Furo handles the TOC via overlay there. */
@media (max-width: 82em) {
    .toc-toggle-btn {
        display: none !important;
    }
}

/* === Notebook Output Scrolling === */
/* myst-nb */
.cell_output {
    max-height: 20em;
    overflow-y: scroll;
}

/* nbsphinx */
div.nboutput.container div.output_area {
    max-height: 500px;
}

/* nbsphinx: no prompt */
.nbinput .prompt,
.nboutput .prompt {
    display: none;
}

/* space below toc */
.contents {
    margin-bottom: 1em;
}

/* === Mermaid reset-zoom button === */
.mermaid-zoom-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.mermaid-reset-btn {
    position: absolute;
    top: 0.4rem;
    right: 1.0rem;
    z-index: 10;

    width: 1.6rem;
    height: 1.6rem;
    padding: 0;

    border: 1px solid var(--color-background-border);
    border-radius: 0.25rem;
    background: var(--color-background-secondary);
    color: var(--color-foreground-secondary);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.mermaid-zoom-wrapper:hover .mermaid-reset-btn {
    opacity: 1;
}

/* Hide Sphinx/Furo attribution in footer, keep copyright */
.bottom-of-page .left-details {
    font-size: 0 !important;
    visibility: hidden !important;
}
.bottom-of-page .left-details .copyright {
    font-size: 0.81rem !important;
    visibility: visible !important;
}

/* --- Slightly reduce global font size ------------------------------------ */
/* Setting on :root scales all rem-based sizes (Furo uses rem extensively).   */
:root {
    font-size: 93.75%;  /* browser default 16px × 93.75% ≈ 15px */
}