/* Define your framework's custom design variables */
:root {
    /* Colors */
    --color-background-primary: #ffffff;    /* Main page background */
    --color-background-secondary: #f8f9fa;  /* Code block background */
    --color-foreground-primary: #2b2b2b;    /* General text color */
    --color-accent-primary: #1a5f7a;        /* Main Headings (H1, H2, H3) */
    --color-accent-secondary: #c85c00;      /* Hyperlinks and anchors */

    /* Layout Dimensions */
    --sidebar-width: 300px;                 /* Dynamic sidebar width variable */
}

/* Fix inverted color scheme for Markdown-rendered content */
.markdown-body {
    background-color: var(--color-background-primary); /* Match the theme's primary background */
    color: var(--color-foreground-primary);           /* Match the theme's primary text color */
}

/* Ensure headings match the theme */
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: var(--color-accent-primary);
}

/* Style links */
.markdown-body a {
    color: var(--color-accent-secondary);
}

/* Adjust code blocks */
.markdown-body pre, .markdown-body code {
    background-color: var(--color-background-secondary);
    color: var(--color-foreground-primary);
}

/* Ensure consistent background for the main content area */
.wy-nav-content, .content, .markdown-body {
    background-color: var(--color-background-primary) !important;
    filter: none !important; /* Remove any sepia or inversion */
    opacity: 1 !important;  /* Ensure full visibility */
}

/* Adjust margins to fix zoom/viewport issues */
html, body {
    margin: 0;
    padding: 0;
}

/* Constrain the sidebar logo height, protect aspect ratio, and center it */
.wy-side-nav-search img,
.wy-side-nav-search img.logo {
    max-height: 200px !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 auto 5px auto !important;
    display: block !important;
}


/* Expands the main page text bounds to eliminate excessive right-side margins */
.wy-nav-content {
    max-width: 1100px !important;
    margin: 0 auto !important;
}

/* RESPONSIVE LAYOUT BOUNDS (Protects tablets and mobile layout shifting) */
@media screen and (min-width: 769px) {
    /* Apply sidebar custom width and content shifting on desktops only */
    .wy-nav-side {
        width: var(--sidebar-width) !important;
    }
    .wy-side-nav-search {
        width: var(--sidebar-width) !important;
    }
    .wy-nav-content-wrap {
        margin-left: var(--sidebar-width) !important;
    }
}

/* Force long sidebar navigation text and sub-nested spans to wrap cleanly */
.wy-menu-vertical li a,
.wy-menu-vertical li a span,
.wy-menu-vertical li.current a {
    white-space: normal !important;       
    overflow-wrap: break-word !important; 
    word-break: break-word !important;
    text-overflow: unset !important;      
    line-height: 1.4 !important;          
    height: auto !important;
    display: block !important;
}

/* Provide clean padding blocks for multi-line list elements */
.wy-menu-vertical li a {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}