/* Reset, body, and the frame every page shares: banner, nav, content area. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Keep [hidden] hidden even where a rule sets display. */
[hidden] {
    display: none !important;
}

body {
    font-family: var(--font);
    font-size: var(--text-md);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-page);
    min-height: 100vh;
}

/* The status bar is fixed along the bottom; keep the page clear of it. */
body {
    padding-bottom: var(--status-bar-height);
}

.status-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-banner);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--status-bar-height);
    padding: 0 var(--space-xl);
    background: var(--navy);
    color: var(--navy-text-soft);
    font-size: var(--text-sm);
}

.status-count {
    color: var(--navy-text-soft);
    text-decoration: none;
}

.status-count:hover {
    color: var(--text-on-dark);
    text-decoration: underline;
}

.status-count-due {
    color: var(--warning-on-dark);
    font-weight: 600;
}

/* Hidden until sign-in completes, so nothing shows before a redirect. */
body.booting .app-main {
    visibility: hidden;
}

/* Banner */
.top-banner {
    position: sticky;
    top: 0;
    z-index: var(--z-banner);
    height: var(--banner-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    background: var(--navy);
    border-bottom: 1px solid var(--navy-edge);
    color: var(--text-on-dark);
}

.app-title {
    font-size: var(--text-lg);
    font-weight: 600;
}

/* The user's name in the banner, and the menu it opens */
.user-menu {
    position: relative;
}

/* Used with .on-dark */
.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    border: 1px solid var(--on-dark-border);
    border-radius: var(--radius-lg);
    background: none;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.user-menu-trigger[aria-expanded="true"] {
    background: var(--on-dark-hover);
}



/* Used with .popup */
.user-menu-list {
    position: absolute;
    top: calc(100% + var(--space-sm));
    right: 0;
    min-width: var(--menu-width);
    padding: var(--space-xs) 0;
}

.user-menu-item {
    display: block;
    width: 100%;
    padding: var(--space-sm) var(--space-lg);
    border: none;
    background: none;
    font: inherit;
    text-align: left;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
}

.user-menu-item[aria-current="page"] {
    font-weight: 600;
}

.user-menu-item:hover {
    background: var(--bg-hover);
}

.user-menu-divider {
    height: 1px;
    margin: var(--space-xs) 0;
    background: var(--border-light);
}

/* Nav */
.app-nav {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: var(--shadow-nav);
    overflow-x: auto;
}

.nav-menu {
    list-style: none;
    display: flex;
    padding: 0 var(--space-md);
}

.nav-item {
    position: relative;
    display: block;
    margin: var(--space-xs) 0;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--blue-tint);
    color: var(--blue-dark);
    font-weight: 500;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    left: 15%;
    right: 15%;
    bottom: calc(-1 * var(--space-xs));
    height: 3px;
    background: var(--blue);
    border-radius: 2px 2px 0 0;
}

/* Content */
/* The page's gutter, which the page title's band bleeds into (components.css) */
.app-main {
    --page-gutter: var(--space-xl);
    padding: 0 var(--page-gutter) var(--page-gutter);
}

@media (max-width: 768px) {
    .top-banner {
        padding: 0 var(--space-lg);
    }

    .app-main {
        --page-gutter: var(--space-lg);
    }
}
