/*
 * The menu of the signed-in pages (templates/sidebar.html): a column on the left, and on
 * a narrow screen a bar on top that opens. Used by both layouts, so it relies on neither:
 * every rule starts with "side". The accent colors come from theme.css.
 */

body.has-side { padding-left: 16rem; }

.side {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    box-sizing: border-box;
    width: 16rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    border-right: 1px solid rgb(var(--white) / var(--hair));
    background: rgb(var(--page));
    /* the same on every page, whichever font the page itself uses */
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: left;
}

.side-head { display: flex; align-items: center; gap: 0.5rem; }
.side-head .scheme-switch { flex: none; }
.side-head .scheme-switch button { width: 1.5rem; height: 1.5rem; }

.side-brand { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0 0.5rem; color: rgb(var(--white));
    text-decoration: none; font-size: 1.2rem; font-weight: 600; }

.side-mark { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem;
    height: 2.25rem; border-radius: 0.75rem; color: rgb(var(--on-accent));
    background: linear-gradient(135deg, rgb(var(--a-500)), rgb(var(--a2-600))); }

.side-toggle { margin-left: auto; display: none; padding: 0.45rem 0.9rem; border: 1px solid rgb(var(--white) / var(--hair2));
    border-radius: 0.6rem; background: transparent; color: rgb(var(--slate-200)); font: inherit; font-weight: 600;
    cursor: pointer; }

.side-menu { flex: 1; display: flex; flex-direction: column; }

.side .side-account { margin: 1.25rem 0 0.75rem; padding: 0 0.75rem; color: rgb(var(--slate-200)); font-size: 0.85rem;
    overflow-wrap: anywhere; }
.side-account span { display: block; color: rgb(var(--faint)); font-size: 0.75rem; }

.side-nav { display: flex; flex-direction: column; gap: 0.15rem; }
.side-end { margin-top: 1.25rem; padding-top: 0.75rem; border-top: 1px solid rgb(var(--white) / var(--hair)); }

.side-nav a { display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0.75rem;
    border-radius: 0.6rem; color: rgb(var(--slate-300)); text-decoration: none; }
.side-nav a:hover { background: rgb(var(--white) / 0.06); color: rgb(var(--white)); }
.side-nav a[aria-current="page"] { background: rgb(var(--a-500) / 0.18); color: rgb(var(--white)); font-weight: 600; }
.side-nav svg { flex: none; width: 1.15rem; height: 1.15rem; }

.side a:focus-visible, .side-toggle:focus-visible { outline: 2px solid rgb(var(--a-400));
    outline-offset: 2px; }

@media (max-width: 767.98px) {
    body.has-side { padding-left: 0; }
    .side { position: static; width: auto; padding: 0.75rem 1rem; border-right: 0;
        border-bottom: 1px solid rgb(var(--white) / var(--hair)); }
    .side-brand { padding: 0; }
    .side-toggle { display: inline-block; }
    .side-menu { display: none; }
    .side-open .side-menu { display: flex; }
    .side-end { margin-top: 0; }
}

/* A wide screen can show the menu as icons only; js/side-state.js sets data-side on <html>. */
.side-collapse { display: none; }

@media (min-width: 768px) {
    .side-collapse { display: inline-flex; align-items: center; justify-content: center; align-self: flex-end;
        width: 2.25rem; height: 2.25rem; margin: auto 0.25rem 0; padding: 0; border-radius: 0.6rem;
        border: 1px solid rgb(var(--white) / var(--hair2)); background: transparent; color: rgb(var(--slate-200)); cursor: pointer; }
    .side-collapse:hover { background: rgb(var(--white) / 0.06); color: rgb(var(--white)); }
    .side-collapse:focus-visible { outline: 2px solid rgb(var(--a-400)); outline-offset: 2px; }
    .side-collapse svg { width: 1.25rem; height: 1.25rem; }

    html[data-side="icons"] body.has-side { padding-left: 4.5rem; }
    html[data-side="icons"] .side { width: 4.5rem; padding: 1rem 0.5rem; }
    html[data-side="icons"] .side-label { display: none; }
    html[data-side="icons"] .side-head { flex-direction: column; gap: 0.75rem; }
    html[data-side="icons"] .side-brand { padding: 0; }
    html[data-side="icons"] .side-head .scheme-switch { flex-direction: column; }
    html[data-side="icons"] .side-nav { margin-top: 1rem; }
    html[data-side="icons"] .side-nav a { justify-content: center; padding: 0.6rem 0; }
    html[data-side="icons"] .side-collapse { align-self: center; margin-left: 0; margin-right: 0; }
    html[data-side="icons"] .side-end { margin-top: 1.25rem; }
    }

/* The footer is a thin line on the pages that have the menu: the menu already shows the logo. */
body.has-side footer { padding-top: 0.9rem; padding-bottom: 0.9rem; }
body.has-side footer > div { gap: 0.5rem; }
body.has-side footer > div > div:first-child { display: none; }

/* On a short page the footer sits at the bottom edge instead of floating mid-screen with blank space below. */
/* the page wrapper only: other divs of the body, such as the cookie notice, are not part of the page */
body.has-side > div:not(.cookie-notice) { display: flex; flex-direction: column; min-height: 100vh; }
body.has-side > div:not(.cookie-notice) > main { flex: 1 0 auto; }
body.has-side > div:not(.cookie-notice) > footer { margin-top: auto; }
