/**
 * EWMS sidebar tuning.
 *
 * Goals:
 * - all first-level sections stay open
 * - sibling sections stay fully on the dark rail
 * - only the actual current page gets a filled highlight
 * - no +/- controls
 * - no stray borders/boxes
 */

/* Hide RTD +/- controls. */
.wy-menu-vertical .toctree-expand {
    display: none !important;
}

/* Keep JS-opened first-level groups visible. */
.wy-menu-vertical li.toctree-l1.ewms-force-open > ul {
    display: block !important;
}

/* Strip boxiness from the whole rail. */
.wy-menu-vertical li,
.wy-menu-vertical ul,
.wy-menu-vertical p.caption {
    box-shadow: none !important;
    border: none !important;
}
.wy-menu-vertical a {
    border: none !important;
}

/* Top-level section headers: always dark. */
.wy-menu-vertical li.toctree-l1 > a,
.wy-menu-vertical li.toctree-l1 > a:hover,
.wy-menu-vertical li.toctree-l1.current > a,
.wy-menu-vertical li.toctree-l1.current > a:hover {
    background: transparent !important;
    color: #f5f5f5 !important;
    font-weight: 500;
}

/* Active top-level section: keep dark, add only a thin accent. */
.wy-menu-vertical li.toctree-l1.current > a,
.wy-menu-vertical li.toctree-l1.current > a:hover {
    background: transparent !important;
    color: #f5f5f5 !important;
    box-shadow: inset 3px 0 0 #2980b9 !important;
    font-weight: 600 !important;
}

/* Open first-level groups: keep the container dark too. */
.wy-menu-vertical li.toctree-l1.ewms-force-open > ul,
.wy-menu-vertical li.toctree-l1.current > ul,
.wy-menu-vertical li.current > ul {
    background: transparent !important;
    margin: 0 !important;
    padding: 0.15rem 0 0.3rem 0 !important;
}

/* Kill light backgrounds on descendant list items. */
.wy-menu-vertical li.toctree-l1.ewms-force-open > ul > li,
.wy-menu-vertical li.toctree-l1.current > ul > li,
.wy-menu-vertical li.current > ul > li,
.wy-menu-vertical li.toctree-l2,
.wy-menu-vertical li.toctree-l3,
.wy-menu-vertical li.toctree-l4,
.wy-menu-vertical li.toctree-l1.current,
.wy-menu-vertical li.toctree-l1.ewms-force-open {
    background: transparent !important;
    margin: 0 !important;
}

/* Default links inside open groups: light text on dark rail. */
.wy-menu-vertical li.toctree-l1.ewms-force-open > ul a,
.wy-menu-vertical li.toctree-l1.current > ul a,
.wy-menu-vertical li.current > ul a {
    background: transparent !important;
    color: #d7dde3 !important;
    font-weight: 400;
}

/* Hover inside open groups. */
.wy-menu-vertical li.toctree-l1.ewms-force-open > ul a:hover,
.wy-menu-vertical li.toctree-l1.current > ul a:hover,
.wy-menu-vertical li.current > ul a:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}

/* Active l2/l3 ancestors: accent bar only, no fill. */
.wy-menu-vertical li.toctree-l2.current > a,
.wy-menu-vertical li.toctree-l2.current > a:hover,
.wy-menu-vertical li.toctree-l3.current > a,
.wy-menu-vertical li.toctree-l3.current > a:hover {
    background: transparent !important;
    color: #f5f5f5 !important;
    font-weight: 600 !important;
    box-shadow: inset 3px 0 0 #2980b9 !important;
}

/* Actual current page/link: blue tint + accent bar, identified by RTD's a.current class. */
.wy-menu-vertical li.toctree-l1.current > ul a.current,
.wy-menu-vertical li.toctree-l1.ewms-force-open > ul a.current,
.wy-menu-vertical li.current > ul a.current {
    background: rgba(41, 128, 185, 0.35) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: inset 3px 0 0 #2980b9 !important;
}

/* Nested descendants: indented spacing to show hierarchy. */
.wy-menu-vertical li.toctree-l2 > a {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    padding-left: 3.0rem !important;
    line-height: 1.35;
}
.wy-menu-vertical li.toctree-l3 > a {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    padding-left: 4.0rem !important;
    line-height: 1.35;
}
.wy-menu-vertical li.toctree-l4 > a {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    padding-left: 5.0rem !important;
    line-height: 1.35;
}

/* Captions should not introduce extra framing. */
.wy-menu-vertical p.caption {
    margin-top: 0 !important;
    padding-top: 0.5rem !important;
}
