/* Custom styling for NexusLIMS documentation */

/* Also hide the h1 containing that ID */
section#nexuslims > h1 {
    display: none;
}

/* Logo sizing - constrain logo to reasonable navbar height */
.navbar-brand img {
    /* max-height: 32px; */
    width: auto;
}

/* Prevent navbar items from wrapping on smaller screens */
.navbar-nav {
    flex-wrap: nowrap;
}

/* Improve navbar spacing on smaller screens */
@media (max-width: 768px) {
    .navbar-brand img {
        max-height: 28px;
    }
}

/* Give more room to navbar-header-items__start (logo + version switcher) */
/* This prevents version switcher from wrapping to next line with wider logos */
.navbar-header-items__start {
    flex: 0 0 auto !important;
    max-width: none !important;
    min-width: fit-content;
}

/* Allow navbar-header-items to shrink more to make room for logo */
.navbar-header-items {
    flex: 1 1 auto !important;
    max-width: none !important;
}

/* Ensure navbar center navigation can compress if needed */
.navbar-header-items__center {
    min-width: 0;
}

/* fix offset of version switcher button */
#pst-version-switcher-button-2 {
    margin-bottom: 0;
    margin-left: 0.5em;
}

/* mermaid dark theme */
html[data-theme="dark"] pre.mermaid > svg {
    filter: brightness(0.8) invert(0.82) contrast(1.2);
}

/* checklist theming */
.checklist {
    list-style: none;
    padding-left: 0;
    margin-left: 1em;
}

.checklist li {
    margin-bottom: 0.5em;
}

/* Fix prev-next navigation overflow for long module paths */
.prev-next-title {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.prev-next-title .pre {
    white-space: pre-wrap;
}

/* Ensure the prev-next areas can shrink properly */
.prev-next-area a {
    min-width: 0;
}

.prev-next-info {
    overflow: hidden;
}

/* Fix long module path titles to allow wrapping at <wbr> tags inserted by JS */
h1 code.xref.py.py-mod span.pre,
h2 code.xref.py.py-mod span.pre,
h3 code.xref.py.py-mod span.pre,
.sidebar code.xref.py.py-mod span.pre,
.toctree code.xref.py.py-mod span.pre,
nav code.xref.py.py-mod span.pre {
    white-space: normal;
    overflow-wrap: break-word;
}

/* Add hanging indent for wrapped module paths in sidebars/navigation */
.sidebar code.xref.py.py-mod,
.toctree code.xref.py.py-mod,
nav code.xref.py.py-mod {
    display: inline-block;
    padding-left: 1em;
    text-indent: -1em;
}

/* Fix sidebar navigation link background extending too far for xml_serialization
and other long links */
/* Class is added via JavaScript in custom.js to match text content */
.bd-links .toctree-l4 > a.long-text-link {
    /* Ensure link only extends as far as its content */
    display: inline-block;
    max-width: 65%;
    /* Remove excess padding that causes background to extend */
    padding-right: 0.5rem;
}
