/* Layout variables */
:root {
    --header-height: 56px;
    --footer-height: 40px;
    --aside-width: 220px;
    --transition: 250ms;
    --bg-aside: #f7f7f8;
}

/* Make the whole app exactly the viewport height and a column layout */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial
}

/* Header: full width and fixed height in flow */
header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.85));
}

/* Hamburger on left (hidden on desktop) */
.hamburger {
    font-size: 1.25rem;
    background: none;
    border: 0;
    padding: 0.25rem 0.5rem;
    cursor: pointer
}

.logo {
    font-weight: 600
}

/* Main layout area: aside + main. It grows to fill remaining height between header and footer */
.layout {
    display: flex;
    flex: 1;
    min-height: 0 /* important to allow children to scroll */
}

/* Aside (sidemenu) */
aside {
    width: var(--aside-width);
    background: var(--bg-aside);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem 0.75rem;
    height: 100%;
    overflow: auto;
    box-sizing: border-box;
}

aside nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.25rem
}

aside a {
    padding: 0.5rem;
    border-radius: 6px
}

/* Main content area scrolls if needed */
main.container {
    flex: 1;
    min-width: 0;
    padding: 1rem;
    overflow: auto
}

/* Footer fixed height at bottom of column layout */
footer {
    height: var(--footer-height);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* --- Mobile behavior --- */
/* By default hide hamburger on wide screens */
@media (min-width: 721px) {
    .hamburger {
        display: none
    }
}

/* On small screens: hide aside by default, show via .open class */
@media (max-width: 720px) {
    aside {
        position: fixed;
        top: var(--header-height);
        left: 0;
        height: calc(100vh - var(--header-height) - var(--footer-height));
        transform: translateX(-110%);
        transition: transform var(--transition) ease;
        z-index: 1000;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }

    aside.open {
        transform: translateX(0)
    }

    /* add an overlay when aside is open */
    .overlay {
        position: fixed;
        inset: 0;
        top: var(--header-height);
        left: 0;
        right: 0;
        height: calc(100vh - var(--header-height) - var(--footer-height));
        background: rgba(0, 0, 0, 0.32);
        z-index: 900;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition) ease
    }

    .overlay.visible {
        opacity: 1;
        pointer-events: auto
    }

    /* Make layout fill width; main takes full width when aside hidden */
    .layout {
        position: relative
    }

    main.container {
        padding: 1rem
    }
}

/* Utility: visually hide element but keep accessible label if needed */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}
