/* 11.5 app shell: sidebar + drawer, theme-aware via Bootstrap 5.3 vars. */

:root {
    --app-navbar-height: 3.5rem;
    --app-sidebar-width: 250px;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-shell {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
}

.app-sidebar {
    flex: 0 0 var(--app-sidebar-width);
    width: var(--app-sidebar-width);
    padding: 0.75rem;
    background: var(--bs-tertiary-bg);
    border-right: 1px solid var(--bs-border-color);
    overflow-y: auto;
}

.app-main {
    flex: 1 1 auto;
    min-width: 0;
}

.app-nav-heading {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin: 1rem 0.5rem 0.25rem;
}

.app-nav-link {
    border-radius: 0.375rem;
    padding: 0.35rem 0.5rem;
}

.app-nav-link.active,
.app-nav-link:hover {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
}

.app-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.45);
}

/* Below lg the sidebar is an off-canvas drawer toggled by the hamburger;
   no Bootstrap JS is loaded, so this is plain CSS + one class on <body>. */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1045;
        width: min(85vw, 300px);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 0 0 2rem rgba(0, 0, 0, 0.35);
    }

    body.sidebar-open .app-sidebar {
        transform: none;
    }
}

@media (min-width: 992px) {
    #sidebarToggle {
        display: none;
    }

    .app-sidebar {
        position: sticky;
        top: var(--app-navbar-height);
        max-height: calc(100vh - var(--app-navbar-height));
    }
}

/* Tables scroll horizontally on phones instead of squeezing columns. */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* Long Markdown/event bodies never punch through the layout. */
.event-body img,
.app-main img {
    max-width: 100%;
    height: auto;
}
