/* Fix spacing in sidebar navigation titles */
.bd-sidebar-primary .bd-toc .toctree-l1 > a {
    white-space: pre-wrap;
}

/* Specifically target numbered sections to add space after numbers */
.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="01_Introduction"]:before {
    content: "1. ";
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="02_Terminology"]:before {
    content: "2. ";
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="03_HED_formats"]:before {
    content: "3. ";
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="04_Basic_annotation"]:before {
    content: "4. ";
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="05_Advanced_annotation"]:before {
    content: "5. ";
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="06_Infrastructure_and_tools"]:before {
    content: "6. ";
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="07_Library_schemas"]:before {
    content: "7. ";
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="08_HED_ontology"]:before {
    content: "8. ";
}

/* Hide the original text and replace with properly spaced versions */
.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="01_Introduction"] {
    font-size: 0;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="01_Introduction"]:after {
    content: "Introduction to HED";
    font-size: 14px;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="02_Terminology"] {
    font-size: 0;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="02_Terminology"]:after {
    content: "Terminology";
    font-size: 14px;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="03_HED_formats"] {
    font-size: 0;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="03_HED_formats"]:after {
    content: "HED Formats";
    font-size: 14px;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="04_Basic_annotation"] {
    font-size: 0;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="04_Basic_annotation"]:after {
    content: "Basic Annotation";
    font-size: 14px;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="05_Advanced_annotation"] {
    font-size: 0;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="05_Advanced_annotation"]:after {
    content: "Advanced Annotation";
    font-size: 14px;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="06_Infrastructure_and_tools"] {
    font-size: 0;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="06_Infrastructure_and_tools"]:after {
    content: "Infrastructure and Tools";
    font-size: 14px;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="07_Library_schemas"] {
    font-size: 0;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="07_Library_schemas"]:after {
    content: "Library Schemas";
    font-size: 14px;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="08_HED_ontology"] {
    font-size: 0;
}

.bd-sidebar-primary .bd-toc .toctree-l1 > a[href*="08_HED_ontology"]:after {
    content: "HED Ontology";
    font-size: 14px;
}

/* Custom styles for HED Specification */

/* Quick Links sidebar styling */
.sidebar-quicklinks {
    margin: 1rem 0;
    padding: 1rem;
    background-color: var(--pst-color-surface);
    border-radius: 0.25rem;
    border-left: 3px solid var(--pst-color-primary);
    border: 1px solid var(--pst-color-border);
}

.sidebar-quicklinks h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--pst-color-text-base);
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-quicklinks ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.sidebar-quicklinks li {
    margin-bottom: 0.25rem;
}

.sidebar-quicklinks a {
    color: var(--pst-color-link);
    text-decoration: none;
    font-size: 0.875rem;
    display: block;
    padding: 0.25rem 0;
    transition: color 0.2s ease;
}

.sidebar-quicklinks a:hover {
    color: var(--pst-color-link-hover);
    text-decoration: underline;
}

/* Logo styling for dark mode visibility */
html[data-theme="dark"] .logo__image.only-dark {
    background-color: #A0A0A0;
    padding: 8px;
    border-radius: 6px;
}

/* Index page logo styling for dark mode to match sidebar */
html[data-theme="dark"] .bd-content img[alt="HED Logo"] {
    background-color: #A0A0A0;
    padding: 8px;
    border-radius: 6px;
}
