/*
 * The left sidebar after the font standard (preview "schrift", Seitenleiste;
 * Petar 14.11.). Loaded on every page right after framework.css, which holds
 * the type tokens (--ej-fs-*, --ej-lh-*); each use carries its fallback.
 *
 * Colours on the dark menu (#313a46), WCAG AA measured in the preview:
 *   entries          #b4c0cc  6.2:1   (Hyper #8391a2 was 3.6:1)
 *   section titles   #aab8c5  5.7:1, 14 px semibold, no capitals
 *   active entry     #ffffff 11.5:1, semibold, a lilac bar at the left edge
 *   counter pill     #1f1030 on #c4a6e8  8.5:1
 * On Hyper's dark theme (#3a444e) the same colours keep AA (5.4:1 / 4.9:1);
 * hover #e3e9f0 9.4:1.
 */

html[data-menu-color=dark],
html[data-bs-theme=dark][data-menu-color=light],
html[data-bs-theme=dark][data-menu-color=dark] {
    --ct-menu-item-color: #b4c0cc;
    --ct-menu-item-hover-color: #e3e9f0;
    --ct-menu-item-active-color: #ffffff;
    --ej-nav-title-color: #aab8c5;
}

.side-nav .side-nav-link {
    font-size: var(--ej-fs-body, 0.9375rem);
    line-height: var(--ej-lh-body, 1.375rem);
}

.side-nav .side-nav-title {
    color: var(--ej-nav-title-color, var(--ct-menu-item-color));
    font-size: var(--ej-fs-label, 0.875rem);
    line-height: var(--ej-lh-label, 1.25rem);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.side-nav-second-level li a,
.side-nav-second-level li .side-nav-link {
    font-size: var(--ej-fs-body, 0.9375rem);
    line-height: var(--ej-lh-body, 1.375rem);
}

.side-nav .menuitem-active > a,
.side-nav .side-nav-second-level .menuitem-active > a {
    font-weight: 600;
}

/* the active module: a lilac bar at the left edge, as in the preview */
.side-nav > .side-nav-item.menuitem-active > .side-nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #c4a6e8;
}

/* ---- the counter (Bewerbungen, Nachrichten) ------------------------------------------ */

.side-nav .ej-nav-count {
    display: inline-block;
    min-width: 24px;
    padding: 0 7px;
    border-radius: 10px;
    background: #c4a6e8;
    color: #1f1030;
    font-size: var(--ej-fs-badge, 0.875rem);
    line-height: var(--ej-lh-badge, 1.25rem);
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    margin-left: 8px;
}

/* at a module: right-aligned, left of the arrow when there is one */
.side-nav .side-nav-link .ej-nav-count {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    margin-left: 0;
}
.side-nav .side-nav-link.ej-has-arrow .ej-nav-count {
    right: 40px;
}
.side-nav .side-nav-link:has(.ej-nav-count) > span:not(.ej-nav-count):not(.menu-arrow) {
    padding-right: 36px;
}

/* collapsed (Hyper "condensed", 70 px): the pill sits on the icon's corner */
html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .side-nav .side-nav-item .side-nav-link span.ej-nav-count {
    visibility: visible;
    top: 2px;
    left: 36px;
    right: auto;
    transform: none;
    min-width: 20px;
    padding: 0 5px;
    margin-left: 0;
}
html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .side-nav .side-nav-item:hover .side-nav-link span.ej-nav-count {
    margin-left: 0;
}

/*
 * Collapsed (Hyper "condensed", 768-1140 px wide, EJ-0040). The bar is 70 px
 * wide; hovering an entry widens its link to 260 px and shows the label, a
 * module with a submenu opens a flyout beside it. framework.css gives the
 * sidebar of the scrollable layout `overflow: hidden` (so SimpleBar cannot
 * stretch the page), and that clipped all of it at 70 px: the hover showed a
 * purple bar without a word. In the collapsed bar SimpleBar does not scroll
 * (Hyper sets its mask visible) and the page is 2000 px tall anyway
 * (--ct-leftbar-condensed-height), so nothing needs clipping there.
 *
 * The label takes the width it needs (at least the full bar), never wraps and
 * keeps the 6.2:1 entry colours of the dark menu; on the hovered link white
 * on the brand purple (#6731a1) is 8.3:1.
 */
html[data-layout-position=scrollable][data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu,
html[data-layout-position=scrollable][data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu #leftside-menu-container,
html[data-layout-position=scrollable][data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .simplebar-wrapper {
    overflow: visible;
}
html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .side-nav .side-nav-item:hover > .side-nav-link {
    width: auto;
    min-width: var(--ct-leftbar-width);
    padding-right: 20px;
    white-space: nowrap;
}
html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .side-nav .side-nav-item:hover > .collapse > ul,
html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .side-nav .side-nav-item:hover > .collapsing > ul,
html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .side-nav .side-nav-item:hover > .collapse > ul a,
html[data-sidenav-size=condensed]:not([data-layout=topnav]) .wrapper .leftside-menu .side-nav .side-nav-item:hover > .collapsing > ul a {
    width: auto;
    min-width: calc(var(--ct-leftbar-width) - var(--ct-leftbar-width-sm));
    white-space: nowrap;
}
