/* -------------------------------------------------
   Sidebar navigation
-------------------------------------------------- */
.sidebar {
    /* overrides old float / sticky rules */
    float: none !important;
    position: relative !important;
    top: auto;
    width: 140px;                         /* fixed width on desktop */
    background: #f0e6d2;
    padding: 15px 0;
    box-sizing: border-box;
    border-right: 2px solid #e0d6c2;
    flex-shrink: 0;                       /* keep its width */
    z-index: 10;
    border-radius: 10px;
}

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.sidebar li {
    margin: 0 0 10px 25px;
}

.sidebar a {
    color: #333;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color .2s ease;
    display: block;
}

.sidebar a:hover,
.sidebar a.active {
    background: #e0d6c2;
}

.sidebar a.active {
    font-weight: bold;
}

/* Hamburger menu toggle (hidden on desktop) */
.menu-toggle {
    display: none;
    background: #f0e6d2;
    border: none;
    border-bottom: 2px solid #e0d6c2;
    font-size: 18px;
    padding: 10px 15px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s ease;
}

.menu-toggle:hover {
    background: #e0d6c2;
}

.menu-toggle:focus {
    outline: 2px solid #333; /* Accessibility: focus outline */
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .sidebar {
        display: none; /* Hidden by default on mobile */
        position: fixed; /* Overlay for better UX */
        top: 0;
        left: 0;
        width: 250px; /* Fixed width slide-in menu */
        height: 100vh;
        background: #f0e6d2;
        border-right: 2px solid #e0d6c2;
        overflow-y: auto;
        z-index: 1000; /* Above content */
        box-shadow: 2px 0 5px rgba(0,0,0,0.2); /* Subtle shadow for depth */
        transition: transform 0.3s ease; /* Smooth slide-in */
        transform: translateX(-100%); /* Off-screen left */
    }

    .sidebar.open {
        display: block;
        transform: translateX(0);
        width: 100%;
        justify-items: center;
        height: auto;
    }

    .menu-toggle {
        display: block; /* Show toggle on mobile */
    }

    /* Optional: Dim background when menu open (requires JS to add class to body) */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    body.menu-open::before {
        opacity: 1;
    }
}