/* MyST Theme Options */

:root {
  --cite-group-open: '[';
  --cite-group-close: ']';
}

/* User Provided Stylesheet */

/* Color scheme */
:root {
    --primary: #4E79A7;
    --secondary: #E15759;
    --tertiary: #59A14F;
    --bg: #FFFFFF;
    --text: #000000;
    --lighttext: #79706E;
    --primarybox: #A0CBE8;

    --tip-background: rgba(225, 87, 89, 0.1);
    --tip-border: #E15759;
    --tip-object: #E15759;

    --algorithm-background: rgb(242, 242, 242);
    --algorithm-border: rgba(34, 34, 34, 0.8);

    --example-border: #4E79A7;
    --example-background: #D9EAF6;

    --chapobj-border: #4E79A7;
    --chapobj-background: #D9EAF6;
    --chapobj-object: #4E79A7;

    --reference-link-color: rgb(29, 78, 216);
    --reference-link-color-on-hover: rgb(59, 130, 246);
}

/* Dark mode */
html.dark {
    --primary: #A0CBE8;
    --secondary: #FF9D9A;
    --tertiary: #8CD17D;
    --bg: #202020;
    --text: #FFFFFF;
    --lighttext: #BBBBBB;
    --primarybox: #4E79A7;

    --tip-background: rgba(225, 87, 89, 0.1);
    --tip-border: #E15759;
    --tip-object: rgb(255, 255, 255);

    --algorithm-background: rgb(34, 34, 34, 0.8);
    --algorithm-border: rgba(34, 34, 34, 0.8);

    --example-border: #4E79A7;
    --example-background: #4E79A7;

    --chapobj-border: #4E79A7;
    --chapobj-background: #4E79A7;
    --chapobj-object: rgb(255, 255, 255);

    --reference-link-color: rgb(219, 234, 254);
    --reference-link-color-on-hover: rgb(219, 234, 254);
}

span[style*="color:#4E79A7;"] {
    color: var(--primary) !important;
}

span[style*="color: rgb(78, 121, 167);"] {
    color: var(--primary) !important;
}

span[style*="color:#E15759;"] {
    color: var(--secondary) !important;
}

span[style*="color:#59A14F;"] {
    color: var(--tertiary) !important;
}

span[style*="color:#79706E;"] {
    color: var(--lighttext) !important;
}

span[style*="color:#A0CBE8;"] {
    color: var(--primarybox) !important;
}

/*
  Prevent horizontal scrolling caused by width: 100vw on full-width layouts.
  Setting width: 100% ensures the element fits within the visible viewport area,
  excluding the space taken by the vertical scrollbar, and avoids unwanted
  horizontal scrollbars that can occur if width: 100vw is used.
*/
body > div.w-screen {
    width: 100%;
}

.margin-anchor {
    display: block;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    visibility: hidden;
    overflow: hidden;
}

/* Remove underline from links */
a {
    text-decoration: none !important;
}

/* Set reference link colors */
*, :after, :before {
    --tw-prose-links: var(--reference-link-color) !important;
}

a[data-state="closed"]:not([class]) {
    color: var(--reference-link-color);
    font-weight: 400;

    &:hover {
        color: var(--reference-link-color-on-hover);
    }
}

a[data-state="closed"][class=""] {
    color: var(--reference-link-color);
    font-weight: 400;

    &:hover {
        color: var(--reference-link-color-on-hover);
    }
}

/* Hide MystMD banner */
a[href="https://mystmd.org/made-with-myst"] {
    display: none;
}

/* Increase table of contents left and right sidebar gap */
@media (min-width: 1280px) {
    .grid-gap {
        gap: 1.6rem !important;
    }
}

@media (min-width: 1536px) {
    .grid-gap {
        gap: 1.6rem !important;
    }
}

/* Fit large images */
img {
    max-width: min(1000px, 100%);
    max-height: 60vh;
    height: auto;
    width: auto;
    object-fit: contain;
}

/* Set a max-height for all subfigures */
.fig-figure > figure > img {
    max-height: max(300px, 30vh) !important;
    height: auto;
    width: auto;
    object-fit: contain;
}

/* Hide figure display on Section links */
.hover-document:has(h2[id*="sec-"] ~ figure) h2[id*="sec-"] ~ figure {
    display: none;
}

/* Hide figure display on Chapter links */
div.hover-card-content > img {
    display: none;
}

/* Hide headers of algorithms inside other algorithms */
.myst-proof .myst-proof .myst-proof-header {
    display: none;
}

/* Remove all borders and shadows from nested proof/algorithm containers */
.myst-proof-body aside.myst-proof {
    border: none !important;
    border-left-width: 0 !important;
    box-shadow: none !important;
}

/* Remove line numbers from algorithms */
.myst-proof-body p.line::before,
.myst-proof-body p.line::marker {
    content: none;
    display: none;
}

/* Add separator line to algorithms */
.separator-line {
    height: 2px;
    width: 100%;
    background: rgb(80, 80, 80);
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Add primary color to algorithm comments */
.myst-proof-body span[style*="float: right"],
.myst-proof-body span[style*="float:right"] {
    color: var(--primary);
}

html.dark .myst-proof-body span[style*="color: rgb(78, 121, 167)"] {
    color: var(--primary) !important;
}

/* Prevent Math text wrapping */
.katex {
    white-space: nowrap;
}

.MathJax, .MJXc-display, .mjx-math {
    white-space: nowrap !important;
}

/* Prevent text wrapping on algorithm blocks */
aside[id^="alg"].myst-proof {
    position: relative;
    display: block;
    overflow-x: auto;
    width: 100%;
}

aside[id^="alg"] .myst-proof-body {
    padding-left: 0;
    width: max-content;
    min-width: 100%;
}

/* Add left padding to colored comment texts */
aside[id^="alg"] .myst-proof-body p.line > span[style*="color"] {
    padding-left: 0.25rem;
}

/* Remove color on code text */
.myst-proof-body code {
    color: inherit;
    font-weight: 700;
}

.myst-admonition code {
    color: inherit;
    font-weight: 700;
}

/* Add equation highlight color for LaTeX environment \begin{eqhlight} */
.eq-highlight > .katex > .katex-html {
    display: inline-block;
    background: aliceblue;
    padding: 1rem;
}

html.dark .eq-highlight > .katex > .katex-html {
    display: inline-block;
    background: #324456;
    padding: 1rem;
}

/* Example environment */
aside[id^="ex-"].myst-proof {
    border-color: var(--example-border);
    border-left-width: 4px;
    border-radius: .25rem;
}

aside[id^="ex-"].myst-proof > .myst-proof-header {
    background-color: var(--example-background);
}

/* Tip environment */
.myst-admonition-tip {
    border-color: var(--tip-border);
}

.myst-admonition-tip > .myst-admonition-header {
    background-color: var(--tip-background);
}

.myst-admonition-tip > .myst-admonition-header svg {
    color: var(--tip-object);
}

/* Chapter Objective environment */
.myst-admonition-note {
    border-color: var(--chapobj-border);
}

.myst-admonition-note > .myst-admonition-header {
    background-color: var(--chapobj-background);
}

.myst-admonition-note > .myst-admonition-header svg {
    color: var(--chapobj-object);
}

/* Algorithm environment */
aside[id^="alg-"].myst-proof {
    border-color: var(--algorithm-border);
    border-left-width: 4px;
    border-radius: .25rem;
}

aside[id^="alg-"].myst-proof > .myst-proof-header {
    background-color: var(--algorithm-background);
}

/* Add icon to algorithm admonition */
aside[id^="alg-"].myst-proof .myst-proof-header::before {
    display: inline-block;
    background-image: url('data:image/svg+xml;utf8,<svg id="fi_9679801" enable-background="new 0 0 512 512" height="1.75rem" viewBox="0 0 512 512" width="1.75rem" xmlns="http://www.w3.org/2000/svg"><path fill="rgb(34, 34, 34)" d="m456.625 300.41h-26.164v-227.237c0-4.511-1.687-8.581-4.875-11.769l-48.53-48.529c-3.189-3.189-7.258-4.875-11.769-4.875h-264.967c-9.178 0-16.644 7.466-16.644 16.644v34.631h-34.631c-9.177 0-16.643 7.466-16.643 16.643v411.439c0 9.177 7.466 16.643 16.643 16.643h313.497c9.178 0 16.644-7.466 16.644-16.643v-11.108h77.439c12.667 0 22.973-10.306 22.973-22.973v-129.893c0-12.667-10.306-22.973-22.973-22.973zm-53.479-238.817h-26.279v-26.279zm-303.469-36.949c0-.343.301-.644.644-.644h260.547v41.271c0 6.794 5.527 12.322 12.321 12.322h41.272v222.817h-35.275v-175.962c0-4.512-1.687-8.582-4.874-11.769l-48.53-48.529c-3.188-3.189-7.258-4.875-11.769-4.875h-214.336zm225.916 61.945 26.279 26.279h-26.279zm37.593 400.768c0 .343-.301.643-.644.643h-313.497c-.343 0-.643-.3-.643-.643v-411.439c0-.343.3-.643.643-.643h260.548v41.271c0 6.794 5.527 12.321 12.321 12.321h41.271v171.543h-80.239c-12.667 0-22.972 10.306-22.972 22.973v129.894c0 12.667 10.305 22.973 22.972 22.973h80.239v11.107zm100.412-34.081c0 3.845-3.128 6.973-6.973 6.973h-173.679c-3.844 0-6.972-3.128-6.972-6.973v-129.893c0-3.845 3.128-6.973 6.972-6.973h173.679c3.845 0 6.973 3.128 6.973 6.973zm-75.162-103.638-21.845 81.525c-.958 3.574-4.19 5.931-7.723 5.931-.686 0-1.382-.089-2.075-.274-4.268-1.144-6.801-5.53-5.657-9.798l21.845-81.525c1.144-4.268 5.532-6.797 9.798-5.657 4.267 1.143 6.8 5.53 5.657 9.798zm-45.799 14.816-28.334 23.876 28.334 23.876c3.379 2.847 3.81 7.894.962 11.273-1.582 1.877-3.844 2.845-6.121 2.845-1.82 0-3.65-.618-5.151-1.882l-35.594-29.994c-1.804-1.52-2.845-3.759-2.845-6.118s1.041-4.598 2.845-6.118l35.594-29.994c3.378-2.848 8.426-2.417 11.272.962 2.847 3.38 2.417 8.426-.962 11.274zm103.047 23.876c0 2.359-1.041 4.598-2.845 6.118l-35.594 29.994c-1.501 1.265-3.331 1.882-5.151 1.882-2.277 0-4.539-.967-6.121-2.845-2.848-3.379-2.417-8.426.962-11.273l28.334-23.876-28.334-23.876c-3.379-2.847-3.81-7.894-.962-11.273 2.847-3.378 7.895-3.81 11.272-.962l35.594 29.994c1.804 1.519 2.845 3.758 2.845 6.117zm-365.417-272.62c0-4.418 3.582-8 8-8h159.324c4.418 0 8 3.582 8 8s-3.582 8-8 8h-159.324c-4.418 0-8-3.581-8-8zm0 55.31c0-4.418 3.582-8 8-8h235.055c4.418 0 8 3.582 8 8s-3.582 8-8 8h-235.055c-4.418 0-8-3.582-8-8zm145.706 276.544c0 4.418-3.582 8-8 8h-129.706c-4.418 0-8-3.582-8-8s3.582-8 8-8h129.706c4.418 0 8 3.582 8 8zm0-110.617c0 4.418-3.582 8-8 8h-129.706c-4.418 0-8-3.582-8-8s3.582-8 8-8h129.706c4.418 0 8 3.581 8 8zm0 55.308c0 4.418-3.582 8-8 8h-129.706c-4.418 0-8-3.582-8-8s3.582-8 8-8h129.706c4.418 0 8 3.582 8 8zm-145.706-110.618c0-4.418 3.582-8 8-8h235.055c4.418 0 8 3.582 8 8s-3.582 8-8 8h-235.055c-4.418 0-8-3.582-8-8zm0-55.309c0-4.418 3.582-8 8-8h235.055c4.418 0 8 3.582 8 8s-3.582 8-8 8h-235.055c-4.418 0-8-3.581-8-8z"></path></svg>');
    height: 1.75rem;
    width: 1.75rem;
    background-size: contain;
    background-repeat: no-repeat;
    content: "";
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    line-height: normal;
}

/* Adjust the title margin to accommodate the icon */
aside[id^="alg-"].myst-proof .myst-proof-header .myst-proof-title {
    margin-left: 0 !important;
}

/* Dark mode icon color adjustment */
.dark aside[id^="alg-"].myst-proof .myst-proof-header::before {
    background-image: url('data:image/svg+xml;utf8,<svg id="fi_9679801" enable-background="new 0 0 512 512" height="1.75rem" viewBox="0 0 512 512" width="1.75rem" xmlns="http://www.w3.org/2000/svg"><path fill="rgb(242, 242, 242)" d="m456.625 300.41h-26.164v-227.237c0-4.511-1.687-8.581-4.875-11.769l-48.53-48.529c-3.189-3.189-7.258-4.875-11.769-4.875h-264.967c-9.178 0-16.644 7.466-16.644 16.644v34.631h-34.631c-9.177 0-16.643 7.466-16.643 16.643v411.439c0 9.177 7.466 16.643 16.643 16.643h313.497c9.178 0 16.644-7.466 16.644-16.643v-11.108h77.439c12.667 0 22.973-10.306 22.973-22.973v-129.893c0-12.667-10.306-22.973-22.973-22.973zm-53.479-238.817h-26.279v-26.279zm-303.469-36.949c0-.343.301-.644.644-.644h260.547v41.271c0 6.794 5.527 12.322 12.321 12.322h41.272v222.817h-35.275v-175.962c0-4.512-1.687-8.582-4.874-11.769l-48.53-48.529c-3.188-3.189-7.258-4.875-11.769-4.875h-214.336zm225.916 61.945 26.279 26.279h-26.279zm37.593 400.768c0 .343-.301.643-.644.643h-313.497c-.343 0-.643-.3-.643-.643v-411.439c0-.343.3-.643.643-.643h260.548v41.271c0 6.794 5.527 12.321 12.321 12.321h41.271v171.543h-80.239c-12.667 0-22.972 10.306-22.972 22.973v129.894c0 12.667 10.305 22.973 22.972 22.973h80.239v11.107zm100.412-34.081c0 3.845-3.128 6.973-6.973 6.973h-173.679c-3.844 0-6.972-3.128-6.972-6.973v-129.893c0-3.845 3.128-6.973 6.972-6.973h173.679c3.845 0 6.973 3.128 6.973 6.973zm-75.162-103.638-21.845 81.525c-.958 3.574-4.19 5.931-7.723 5.931-.686 0-1.382-.089-2.075-.274-4.268-1.144-6.801-5.53-5.657-9.798l21.845-81.525c1.144-4.268 5.532-6.797 9.798-5.657 4.267 1.143 6.8 5.53 5.657 9.798zm-45.799 14.816-28.334 23.876 28.334 23.876c3.379 2.847 3.81 7.894.962 11.273-1.582 1.877-3.844 2.845-6.121 2.845-1.82 0-3.65-.618-5.151-1.882l-35.594-29.994c-1.804-1.52-2.845-3.759-2.845-6.118s1.041-4.598 2.845-6.118l35.594-29.994c3.378-2.848 8.426-2.417 11.272.962 2.847 3.38 2.417 8.426-.962 11.274zm103.047 23.876c0 2.359-1.041 4.598-2.845 6.118l-35.594 29.994c-1.501 1.265-3.331 1.882-5.151 1.882-2.277 0-4.539-.967-6.121-2.845-2.848-3.379-2.417-8.426.962-11.273l28.334-23.876-28.334-23.876c-3.379-2.847-3.81-7.894-.962-11.273 2.847-3.378 7.895-3.81 11.272-.962l35.594 29.994c1.804 1.519 2.845 3.758 2.845 6.117zm-365.417-272.62c0-4.418 3.582-8 8-8h159.324c4.418 0 8 3.582 8 8s-3.582 8-8 8h-159.324c-4.418 0-8-3.581-8-8zm0 55.31c0-4.418 3.582-8 8-8h235.055c4.418 0 8 3.582 8 8s-3.582 8-8 8h-235.055c-4.418 0-8-3.582-8-8zm145.706 276.544c0 4.418-3.582 8-8 8h-129.706c-4.418 0-8-3.582-8-8s3.582-8 8-8h129.706c4.418 0 8 3.582 8 8zm0-110.617c0 4.418-3.582 8-8 8h-129.706c-4.418 0-8-3.582-8-8s3.582-8 8-8h129.706c4.418 0 8 3.581 8 8zm0 55.308c0 4.418-3.582 8-8 8h-129.706c-4.418 0-8-3.582-8-8s3.582-8 8-8h129.706c4.418 0 8 3.582 8 8zm-145.706-110.618c0-4.418 3.582-8 8-8h235.055c4.418 0 8 3.582 8 8s-3.582 8-8 8h-235.055c-4.418 0-8-3.582-8-8zm0-55.309c0-4.418 3.582-8 8-8h235.055c4.418 0 8 3.582 8 8s-3.582 8-8 8h-235.055c-4.418 0-8-3.581-8-8z"></path></svg>');
}

/* Adjust font weight to match Tip admonition header */
.myst-proof-title {
    font-size: 18px;
}

aside[id^="alg-"].myst-proof .myst-proof-header .myst-proof-title a {
    font-weight: 500;
}

/* Exercise environment */
/* Add icon to exercise admonition */
aside[id^="ex-"].myst-proof .myst-proof-header::before {
    display: inline-block;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="rgb(78, 121, 167)" aria-hidden="true" data-slot="icon" width="1.5rem" height="1.5rem"><path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"></path></svg>');
    height: 1.5rem;
    width: 1.5rem;
    background-size: contain;
    background-repeat: no-repeat;
    content: "";
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    line-height: normal;
    vertical-align: middle;
    align-self: center;
}

/* Adjust the title margin to accommodate the icon */
aside[id^="ex-"].myst-proof .myst-proof-header .myst-proof-title {
    margin-left: 0 !important;
}

/* Dark mode icon color adjustment */
.dark aside[id^="ex-"].myst-proof .myst-proof-header::before {
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="rgb(229, 231, 235)" aria-hidden="true" data-slot="icon" width="1.5rem" height="1.5rem"><path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"></path></svg>');
}

aside[id^="ex-"].myst-proof .myst-proof-header .myst-proof-title a {
    font-weight: 500;
}

/* Tip environment */
/* Hide existing icon */
.myst-admonition-tip > .myst-admonition-header > svg {
    display: none;
}

/* New tip icon */
.myst-admonition-tip > .myst-admonition-header::before {
    display: inline-block;
    background-image: url('data:image/svg+xml;utf8,<svg id="fi_5803228" enable-background="new 0 0 512 512" height="1.75rem" viewBox="0 0 512 512" width="1.75rem" xmlns="http://www.w3.org/2000/svg" fill="rgb(225, 87, 89)"><g><path d="m256 71c8.284 0 15-6.716 15-15v-41c0-8.284-6.716-15-15-15s-15 6.716-15 15v41c0 8.284 6.716 15 15 15z"></path><path d="m426.606 53.394c-5.857-5.857-15.355-5.857-21.213 0l-32 32c-5.858 5.857-5.858 15.355 0 21.213s15.355 5.858 21.213 0l32-32c5.858-5.858 5.858-15.356 0-21.213z"></path><path d="m138.606 106.606c5.858-5.857 5.858-15.355 0-21.213l-32-32c-5.857-5.857-15.355-5.857-21.213 0s-5.858 15.355 0 21.213l32 32c5.859 5.859 15.356 5.858 21.213 0z"></path><path d="m256 105c-83.262 0-151 67.738-151 151 0 77.192 72 114.978 72 160v49c0 25.916 21.084 47 47 47h64c25.916 0 47-21.084 47-47v-49c0-45.037 72-82.776 72-160 0-83.262-67.738-151-151-151zm32 377h-64c-9.374 0-17-7.626-17-17v-34h98v34c0 9.374-7.626 17-17 17zm18.55-81h-35.55v-60.469c18.58-6.276 32-23.86 32-44.531 0-8.284-6.716-15-15-15s-15 6.716-15 15c0 9.374-7.626 17-17 17s-17-7.626-17-17c0-8.284-6.716-15-15-15s-15 6.716-15 15c0 20.671 13.42 38.255 32 44.531v60.469h-35.55c-10.574-51.581-70.45-84.695-70.45-145 0-66.72 54.28-121 121-121s121 54.28 121 121c0 60.254-59.889 93.479-70.45 145z"></path></g></svg>');
    height: 1.75rem;
    width: 1.75rem;
    background-size: contain;
    background-repeat: no-repeat;
    content: "";
    align-self: center;
    vertical-align: middle;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    line-height: normal;
}

.dark .myst-admonition-tip > .myst-admonition-header::before {
    content: url('data:image/svg+xml;utf8,<svg id="fi_5803228" enable-background="new 0 0 512 512" height="1.75rem" viewBox="0 0 512 512" width="1.75rem" xmlns="http://www.w3.org/2000/svg" fill="rgb(255, 255, 255)"><g><path d="m256 71c8.284 0 15-6.716 15-15v-41c0-8.284-6.716-15-15-15s-15 6.716-15 15v41c0 8.284 6.716 15 15 15z"></path><path d="m426.606 53.394c-5.857-5.857-15.355-5.857-21.213 0l-32 32c-5.858 5.857-5.858 15.355 0 21.213s15.355 5.858 21.213 0l32-32c5.858-5.858 5.858-15.356 0-21.213z"></path><path d="m138.606 106.606c5.858-5.857 5.858-15.355 0-21.213l-32-32c-5.857-5.857-15.355-5.857-21.213 0s-5.858 15.355 0 21.213l32 32c5.859 5.859 15.356 5.858 21.213 0z"></path><path d="m256 105c-83.262 0-151 67.738-151 151 0 77.192 72 114.978 72 160v49c0 25.916 21.084 47 47 47h64c25.916 0 47-21.084 47-47v-49c0-45.037 72-82.776 72-160 0-83.262-67.738-151-151-151zm32 377h-64c-9.374 0-17-7.626-17-17v-34h98v34c0 9.374-7.626 17-17 17zm18.55-81h-35.55v-60.469c18.58-6.276 32-23.86 32-44.531 0-8.284-6.716-15-15-15s-15 6.716-15 15c0 9.374-7.626 17-17 17s-17-7.626-17-17c0-8.284-6.716-15-15-15s-15 6.716-15 15c0 20.671 13.42 38.255 32 44.531v60.469h-35.55c-10.574-51.581-70.45-84.695-70.45-145 0-66.72 54.28-121 121-121s121 54.28 121 121c0 60.254-59.889 93.479-70.45 145z"></path></g></svg>');
}

/* Add and between author details */
span.text-comma:has(button[aria-label="Author Details"]):after {
    content: " and ";
    white-space: pre;
}

/* Fix equation clipping issues */
.katex > .katex-html {
    padding-top: 2px;
    padding-bottom: 2px;
}

/* Hide downloads button */
.myst-fm-downloads-dropdown {
    visibility: hidden !important;
}

/* Fix dark mode image rendering */
html.dark .fig-figure img {
    filter: invert(0.9) hue-rotate(180deg) brightness(1.3) contrast(1.05);
}

/* Fix overflow issues on small screens */
@media (max-width: 768px) {
    .myst-home-link-logo {
        display: none;
    }

    .myst-fm-journal {
        flex: 1 1 auto !important;
        min-width: 0;
    }
}

/* Fix pop-over overflow issues */
.myst-fm-author-popover-content {
    width: auto;
}

/* Fix tabular images */
.fig-table > table > tbody > tr > td > img {
    max-height: unset;
}

html.dark .fig-table > table > tbody > tr > td > img {
    filter: invert(0.9) hue-rotate(180deg) brightness(1.3) contrast(1.05);
}
