/* Left-packed sidebar tweaks, kept in sync with the fleetcode homepage
   (fleetcode/homepage/_static/homepage.css). Loaded after the theme CSS via
   `html_css_files`, so these rules win on source order. */

/* Primary (left) sidebar hugs its nav instead of reserving a fixed 25% of the
   page (the theme default), reclaiming that width for content. `fit-content`
   shrink-wraps to the widest item, capped so a long entry can't run away.
   Scoped to the desktop layout so the mobile off-canvas drawer (75%) is left
   untouched. */
@media (min-width: 960px) {
    .bd-sidebar-primary {
        width: fit-content;
        max-width: 18rem;
    }
}

/* Secondary (right) sidebar likewise shrink-wraps to its "On this page" TOC
   instead of the theme's fixed 17rem (--pst-sidebar-secondary). Scoped to the
   desktop layout; below 1200px the theme turns this sidebar into a 75%-wide
   off-canvas drawer, which is left untouched. */
@media (min-width: 1200px) {
    .bd-sidebar-secondary {
        width: fit-content;
        max-width: 15rem;
    }

    /* Shrinking the sidebar alone isn't enough: the book theme caps the
       article column at calc(100% - var(--pst-sidebar-secondary)) -- i.e. it
       reserves the full 17rem variable no matter how narrow the sidebar
       actually renders, so the reclaimed space just sits empty. Raise the cap
       to a comfortable reading width and let flexbox size the column: the
       sidebar is flex-shrink:0, so the article takes whatever it doesn't
       use. */
    .bd-main .bd-content .bd-article-container {
        max-width: 90em;
    }
}

/* Left-align the whole layout instead of centering the 88rem content column,
   so the sidebar sits flush against the left edge on every page and the navbar
   logo stays aligned above it. */
.bd-header,
.bd-container {
    justify-content: flex-start;
}

/* ...and drop the 88rem cap itself. Even left-aligned with both sidebars
   shrunk, the theme still boxes the header inner and the whole body
   (.bd-container__inner) to 88rem on desktop, so the article column stops
   growing there. Let the layout span the viewport; applied to both carriers
   of the class so the header stays aligned with the content below it. */
.bd-page-width {
    max-width: 100%;
}
