/* User Provided Stylesheet */

/* Custom CSS for MyST Book */

/* Page layout adjustments - increase text width and move sidebars outward */
/* Main content area - increase width by ~20% */
.bd-main .bd-content,
.bd-main .bd-content .bd-article-container,
.bd-main .bd-content .bd-article,
.bd-main .bd-content article {
    max-width: 120% !important;
    margin-left: -10% !important;
    margin-right: -10% !important;
    width: 120% !important;
}

/* Adjust the main container to accommodate wider content */
.bd-main,
.bd-main .bd-content {
    max-width: 120% !important;
    width: 120% !important;
}

/* Move left sidebar (table of contents) outward */
.bd-sidebar-primary,
.bd-sidebar .bd-sidebar-primary,
.sidebar-primary {
    left: -4% !important;
    width: 24% !important;
    position: relative !important;
}

/* Move right sidebar (page outline) outward */
.bd-sidebar-secondary,
.bd-sidebar .bd-sidebar-secondary,
.sidebar-secondary {
    right: -4% !important;
    width: 24% !important;
    position: relative !important;
}

/* Ensure proper spacing between content and sidebars */
.bd-content,
.bd-content .bd-article-container,
.bd-content .bd-article,
.bd-content article {
    margin-left: 26% !important;
    margin-right: 26% !important;
    padding-left: 2% !important;
    padding-right: 2% !important;
}

/* Additional targeting for different theme variations */
.bd-page-width,
.bd-page-width .bd-content {
    max-width: 120% !important;
    width: 120% !important;
}

/* Target the main content wrapper */
.bd-content .bd-article-container,
.bd-content .bd-article {
    max-width: none !important;
    width: 100% !important;
}

/* Alternative approach using more specific selectors */
.bd-page-width {
    max-width: 120% !important;
    width: 120% !important;
}

/* Target the main content area more specifically */
.bd-main .bd-content .bd-article-container {
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Force the layout to be wider */
.bd-page-width .bd-content {
    max-width: none !important;
    width: 100% !important;
}

/* Additional targeting for the main content */
.bd-content .bd-article {
    max-width: none !important;
    width: 100% !important;
    padding-left: 5% !important;
    padding-right: 5% !important;
}

/* More aggressive targeting for the main content area */
.bd-main .bd-content {
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Target the article content directly */
.bd-article {
    max-width: none !important;
    width: 100% !important;
    padding-left: 10% !important;
    padding-right: 10% !important;
}

/* Override any max-width constraints */
.bd-content .bd-article-container,
.bd-content .bd-article,
.bd-content article {
    max-width: none !important;
    width: 100% !important;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1200px) {
    .bd-main .bd-content {
        max-width: 115% !important;
        margin-left: -7.5% !important;
        margin-right: -7.5% !important;
    }
    
    .bd-sidebar-primary {
        left: -2% !important;
        width: 23% !important;
    }
    
    .bd-sidebar-secondary {
        right: -2% !important;
        width: 23% !important;
    }
    
    .bd-content {
        margin-left: 25% !important;
        margin-right: 25% !important;
    }
}

@media (max-width: 768px) {
    /* Reset to normal layout on mobile */
    .bd-main .bd-content {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .bd-sidebar-primary,
    .bd-sidebar-secondary {
        left: auto !important;
        right: auto !important;
        width: auto !important;
    }
    
    .bd-content {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Text justification - softer approach with better spacing */
p {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    word-spacing: 0.1em;
}

/* Also justify other text elements for consistency */
.bd-content p,
.bd-article p,
.bd-content .bd-article p {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    word-spacing: 0.1em;
}

/* Justify text in lists and other content areas */
.bd-content li,
.bd-content .bd-article li,
.bd-content .bd-article-container li {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    word-spacing: 0.1em;
}

/* Justify text in admonitions and other special blocks */
.bd-content .admonition p,
.bd-content .note p,
.bd-content .warning p,
.bd-content .tip p,
.bd-content .important p {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    word-spacing: 0.1em;
}

/* Hide download buttons and links */
.download-button,
.btn-download,
.download-link,
a[download],
a[href$=".md"],
a[href$=".ipynb"],
.sourcelink,
.btn-source,
.headerlink[title*="download"],
.headerlink[title*="source"],
.btn[title*="download"],
.btn[title*="Download"],
.fa-download,
.download,
button[title*="download"],
button[title*="Download"] {
    display: none !important;
}

/* ---------------------------------------------
   Table column width utilities (per-table opt-in)
   Usage: add ":class: col2-2x" to a table directive
   This will make the 2nd column approximately double width
   --------------------------------------------- */
.col2-2x, .col2-2x table {
    table-layout: fixed;
    width: 100%;
}

.col2-2x th:nth-child(2),
.col2-2x td:nth-child(2),
.col2-2x table th:nth-child(2),
.col2-2x table td:nth-child(2) {
    width: 50% !important;
}

/* Optional variants for finer control */
.col2-1_5x, .col2-1_5x table { table-layout: fixed; width: 100%; }
.col2-1_5x th:nth-child(2),
.col2-1_5x td:nth-child(2),
.col2-1_5x table th:nth-child(2),
.col2-1_5x table td:nth-child(2) { width: 40% !important; }

.col2-2_5x, .col2-2_5x table { table-layout: fixed; width: 100%; }
.col2-2_5x th:nth-child(2),
.col2-2_5x td:nth-child(2),
.col2-2_5x table th:nth-child(2),
.col2-2_5x table td:nth-child(2) { width: 60% !important; }
