﻿/* ==========================================================================
   Life — sidebar
   Full-height deep navy navigation rail.
   ========================================================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--lf-sidebar-w);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    background: linear-gradient( 180deg, var(--lf-navy-900) 0%, var(--lf-navy-950) 100% );
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Brand block pinned to the top of the rail */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    height: var(--lf-header-h);
    padding: 0 1.25rem;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

    .sidebar-brand .logo {
        line-height: 1;
        display: flex;
        align-items: center;
        gap: 0.625rem;
        text-decoration: none;
    }

    .sidebar-brand .logo-name {
        font-size: 1.8rem;
        color: var(--lf-emerald-500);
    }

/* Scrollable navigation area */
.sidebar-nav-wrap {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.25rem 0.875rem 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

    .sidebar-nav-wrap::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar-nav-wrap::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.16);
        border-radius: var(--lf-radius-pill);
    }

.sidebar-nav {
    padding: 0;
    margin: 0;
    list-style: none;
}

    .sidebar-nav li {
        padding: 0;
        margin: 0;
        list-style: none;
    }

    /* Top-level links */
    .sidebar-nav .nav-item {
        margin-bottom: 0.5rem;
    }

    .sidebar-nav .nav-link {
        position: relative;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.76);
        padding: 0.5625rem 0.75rem;
        border-radius: var(--lf-radius-sm);
        transition: background-color 0.15s ease, color 0.15s ease;
    }

        .sidebar-nav .nav-link i {
            font-size: 1.0625rem;
            line-height: 1;
            flex-shrink: 0;
            width: 1.25rem;
            text-align: center;
            color: rgba(255, 255, 255, 0.55);
            transition: color 0.15s ease;
        }

        .sidebar-nav .nav-link:hover,
        .sidebar-nav .nav-link:focus {
            color: #fff;
            background-color: rgba(255, 255, 255, 0.07);
        }

            .sidebar-nav .nav-link:hover i,
            .sidebar-nav .nav-link:focus i {
                color: #fff;
            }

        /* Active page — filled chip plus an accent bar on the leading edge */
        .sidebar-nav .nav-link.active {
            color: #fff;
            background-color: rgba(255, 255, 255, 0.11);
            font-weight: 600;
        }

            .sidebar-nav .nav-link.active i {
                color: var(--lf-emerald-500);
            }

        /* A section heading whose group contains the current page.
   The class is set by site.js when it auto-expands the group, which is the
   same point at which it knows a child is current. Only the icon takes the
   accent colour - the heading keeps its normal weight and background so the
   filled chip and leading bar still mark the page you are actually on. */
        .sidebar-nav .nav-link.has-active-child i {
            color: var(--lf-emerald-500);
        }

        .sidebar-nav .nav-link.active::before {
            content: "";
            position: absolute;
            left: -0.875rem;
            top: 50%;
            transform: translateY(-50%);
            width: 3px;
            height: 1.25rem;
            border-radius: 0 var(--lf-radius-pill) var(--lf-radius-pill) 0;
            background-color: var(--lf-emerald-500);
        }

        /* Disclosure chevron */
        .sidebar-nav .nav-link .bi-chevron-down {
            margin-left: auto;
            margin-right: 0;
            font-size: 0.8125rem;
            width: auto;
            color: rgba(255, 255, 255, 0.4);
            transition: transform 0.2s ease-in-out;
        }

        .sidebar-nav .nav-link:not(.collapsed) .bi-chevron-down {
            transform: rotate(180deg);
        }

    /* Nested links */
    .sidebar-nav .nav-content {
        padding: 0.125rem 0 0.375rem 0.25rem;
        margin: 0;
        list-style: none;
    }

        .sidebar-nav .nav-content a {
            position: relative;
            display: flex;
            align-items: center;
            gap: 0.625rem;
            font-size: 0.8125rem;
            font-weight: 500;
            color: rgba(255, 255, 255, 0.62);
            padding: 0.4375rem 0.75rem 0.4375rem 1.875rem;
            border-radius: var(--lf-radius-sm);
            transition: background-color 0.15s ease, color 0.15s ease;
        }

            .sidebar-nav .nav-content a i {
                font-size: 0.375rem;
                line-height: 0;
                flex-shrink: 0;
                width: 0.375rem;
                height: 0.375rem;
                border-radius: 50%;
                background-color: rgba(255, 255, 255, 0.28);
                transition: background-color 0.15s ease;
            }

            /* Faint guide line connecting the nested items.
   Sits at the horizontal centre of the bullet dot so the dots punch through it. */
            .sidebar-nav .nav-content a::before {
                content: "";
                position: absolute;
                left: 2.0625rem;
                top: 0;
                bottom: 0;
                width: 1px;
                background-color: rgba(255, 255, 255, 0.1);
            }

            .sidebar-nav .nav-content a:hover,
            .sidebar-nav .nav-content a:focus {
                color: #fff;
                background-color: rgba(255, 255, 255, 0.06);
            }

                .sidebar-nav .nav-content a:hover i,
                .sidebar-nav .nav-content a:focus i {
                    background-color: rgba(255, 255, 255, 0.6);
                }

            .sidebar-nav .nav-content a.active {
                color: #fff;
                font-weight: 600;
                background-color: rgba(255, 255, 255, 0.09);
            }

                .sidebar-nav .nav-content a.active i {
                    background-color: var(--lf-emerald-500);
                }

/* --------------------------------------------------------------------------
   Off-canvas behaviour below the desktop breakpoint
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--lf-shadow-lg);
    }

    .toggle-sidebar .sidebar {
        transform: translateX(0);
    }
}

@media (min-width: 1200px) {
    #main {
        margin-left: var(--lf-sidebar-w);
    }
}
