/* Prevent text wrapping in CSV tables */
.docutils td,
.docutils th {
    white-space: nowrap; /* Prevents text wrapping */
}


/* Change default website fonts - optimized for default system fonts */
:root {
    --md-text-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --md-code-font: SFMono-Regular, Consolas, Menlo, monospace;
}

/* Reduce line spacing for headers */
.md-typeset h1 {
    line-height: 1.1 !important;  /* Adjust for tighter spacing */
    margin-bottom: 0.5em !important;  /* Reduce bottom margin */
}

.md-typeset h2 {
    line-height: 1.2 !important;
    margin-bottom: 0.5em !important;
}

.md-typeset h3 {
    line-height: 1.3 !important;
    margin-bottom: 0.6em !important;
}

/* Reduce extra margin between h2 and h3 */
.md-typeset h1+h2 {
    margin-top: 0.5em !important;
}

/* Reduce extra margin between h2 and h3 */
.md-typeset h2+h3 {
    margin-top: 0.5em !important;
}

/* Reduce space only when a paragraph follows a header */
.md-typeset h1 + p,
.md-typeset h2 + p,
.md-typeset h3 + p,
.md-typeset h4 + p,
.md-typeset h5 + p,
.md-typeset h6 + p {
    margin-top: 0.4em !important;  /* Reduce gap between header and paragraph */
}

/* Reduce spacing for paragraphs inside lists */
.md-typeset ul li p,
.md-typeset ol li p {
    margin-top: 0.2em !important;  /* Reduce space at the top */
    margin-bottom: 0.2em !important; /* Reduce space at the bottom */
}

/* Adjust font size for custom footer */
.md-footer-author {
    color: var(--md-footer-fg-color--lighter);
    font-size: .64rem;
    margin: auto .6rem;
    padding: .4rem 0;
    width: 100%;
}

/* Reduce extra spacing in TOC list without removing indentation */
.toctree-wrapper ul {
    margin-top: 1px !important;
    margin-bottom: 1px !important;
    padding-left: inherit; /* Keeps indentation */
}

/* Reduce space between individual TOC entries while keeping hierarchy */
.toctree-wrapper li {
    margin-top: 1px !important;
    margin-bottom: 1px !important;
    padding-left: inherit; /* Keeps indentation */
}


/* Add image border for light an dark modes */
[data-md-color-scheme="default"] .img-bordered img {
    border: 4px solid #29313D; /* Light mode color */
}

[data-md-color-scheme="slate"] .img-bordered img {
    border: 4px solid #222832; /* Dark mode color */
}

/* Adjust image spacing */
.img-bordered img {
    display: block; /* Ensures proper spacing */
    max-width: 100%; /* Keeps the image responsive */
}

.img-bordered {
    display: flex;
    flex-direction: column; /* Ensures image stays above caption */
    align-items: center; /* Keeps the image centered */
}

/* Ensure the caption is fully right-aligned and no extra spacing */
.img-bordered figcaption {
    text-align: right; /* Ensures the text within the caption is right-aligned */
    margin-left: auto; /* Pushes the caption fully to the right */
    margin-top: 0 !important; /* Reduce the gap */
    padding-top: 0; /* Ensure no extra padding */
    font-style: italic; /* Optional: makes it look more like a caption */
    width: auto; /* Prevents caption from stretching across entire width */
    max-width: 100%; /* Ensures it doesn't exceed container limits */
}

/* Fix the unwanted gap from the <p> inside figcaption */
.img-bordered figcaption p {
    margin: 0 !important; /* Remove default paragraph margin */
    padding: 0; /* Ensure no extra padding */
}

/* EXCEPTION: Remove underline for links inside image captions */
.img-bordered figcaption a {
    text-decoration: none !important;
}

/* Light mode - Font color */
[data-md-color-scheme="default"] {
    --md-typeset-color: #222832; /* Example: Dark blue */
}

/* Dark mode - Font color */
[data-md-color-scheme="slate"] {
    --md-typeset-color: #CED6DD; /* Example: Light blue */
}

/* Light mode - Internal and External Link color */
[data-md-color-scheme="default"] .reference.internal,
[data-md-color-scheme="default"] .md-nav__item .md-nav__link--active {
    color: #0a7d91 !important; /* Blue Munsell; alternatives: #1396a0 (Cyan), #00786B (Pine Green) */
    font-weight: 600;
}

[data-md-color-scheme="default"] .reference.external {
    color: #0a7d91 !important; /* Blue Munsell; alternatives: #1396a0 (Cyan), #00786B (Pine Green) */
    font-weight: 600;
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px; /* Adjusts the space between text and underline */
}

/* Dark mode - Internal and External Link color */
[data-md-color-scheme="slate"] .reference.internal,
[data-md-color-scheme="slate"] .md-nav__item .md-nav__link--active {
    color: #3fb1c5; /* Moonstone */
}

[data-md-color-scheme="slate"] .reference.external {
    color: #3fb1c5; /* Moonstone */
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Light Mode - Hover (Only for content and sidebar links, NOT footer links) */
[data-md-color-scheme="default"] .md-typeset a:hover,
[data-md-color-scheme="default"] .md-nav__link:hover {
    color: #c54b8c !important; /* Mulberry; alternatives: #c65Ca2 (Mulberry - pink) */
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Dark Mode - Hover (Only for content and sidebar links, NOT footer links) */
[data-md-color-scheme="slate"] .md-typeset a:hover,
[data-md-color-scheme="slate"] .md-nav__link:hover {
    color: #c54b8c !important; /* Mulberry; alternatives: #b53389 (Magenta) */
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Light Mode - Change SVG logo color on hover */
[data-md-color-scheme="default"] .md-logo:hover svg {
    color: #c54b8c !important; /* Mulberry; alternatives: #c65Ca2 (Mulberry - pink) */
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Dark Mode - Change SVG logo color on hover */
[data-md-color-scheme="slate"] .md-logo:hover svg {
    fill: #c54b8c !important; /* Mulberry; alternatives: #b53389 (Magenta) */
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Light mode - Hover color for sidebar navigation */
[data-md-color-scheme="default"] .md-nav__item .md-nav__link:hover {
    color: #c54b8c !important; /* Mulberry; alternatives: #c65Ca2 (Mulberry - pink) */
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Dark mode - Hover color for sidebar navigation */
[data-md-color-scheme="slate"] .md-nav__item .md-nav__link:hover {
    color: #c54b8c !important; /* Mulberry; alternatives: #d08770 (orange) */
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Light mode - Customize header link color */
[data-md-color-scheme="default"] .md-typeset .headerlink:focus,
[data-md-color-scheme="default"] .md-typeset .headerlink:hover,
[data-md-color-scheme="default"] .md-typeset :target > .headerlink {
    color: #0a7d91 !important; /* Blue Munsell; alternatives: #1396a0 (Cyan), #b53389 (Magenta), #c54b8c (Mulberry) */
}

/* Dark mode - Customize header link color */
[data-md-color-scheme="slate"] .md-typeset .headerlink:focus,
[data-md-color-scheme="slate"] .md-typeset .headerlink:hover,
[data-md-color-scheme="slate"] .md-typeset :target > .headerlink {
    color: #3fb1c5 !important; /* Moonstone */
}

/* Light Mode - Customize footer page navigation title color */
[data-md-color-scheme="default"] .md-footer__link .md-ellipsis {
    color: #3fb1c5 !important; /* Moonstone */
}

/* Dark Mode - Customize footer page navigation title color */
[data-md-color-scheme="slate"] .md-footer__link .md-ellipsis {
    color: #3fb1c5 !important; /* Moonstone */
}

/* Light Mode - Customize hover footer page navigation title color */
[data-md-color-scheme="default"] .md-footer__link .md-ellipsis:hover {
    color: #c54b8c !important; /* Mulberry; alternatives: #c65Ca2 (Mulberry - pink) */
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Dark Mode - Customize hover footer page navigation title color */
[data-md-color-scheme="slate"] .md-footer__link .md-ellipsis:hover {
    color: #c54b8c !important; /* Mulberry; alternatives: #b53389 (Magenta) */
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
