/* The hub (hub.js): a left pane of groups and items, the chosen one in a frame beside it. Plain CSS, no
   build. On a narrow window the pane is a top strip with a menu button that opens the list over the page. */
:root {
    --hub-pane: 248px;
    --hub-ink: #242424;
    --hub-muted: #616161;
    --hub-line: #e0e0e0;
    --hub-wash: #f5f5f5;
    --hub-accent: #0f6cbd;
    --hub-accent-wash: #ebf3fc;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    color: var(--hub-ink);
    font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--hub-wash);
}

.hub {
    display: grid;
    grid-template-columns: var(--hub-pane) 1fr;
    height: 100%;
}

.hub-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--hub-line);
    background: #ffffff;
}

.hub-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 20px 0;
}

.hub-brand__name {
    color: var(--hub-ink);
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
}

.hub-brand__line {
    margin: 2px 20px 16px;
    color: var(--hub-muted);
    font-size: 12px;
}

.hub-menu {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: -6px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--hub-ink);
    cursor: pointer;
}

.hub-menu:hover {
    background: var(--hub-wash);
}

.hub-nav {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0 10px 12px;
}

.hub-nav__main {
    flex: 1;
}

/* The foot (Privacy): at the bottom of the pane, small, under a line. */
.hub-nav__foot {
    margin-top: 16px;
    padding-top: 8px;
    border-top: 1px solid var(--hub-line);
}

.hub-group--foot .hub-item {
    padding: 5px 10px;
    color: var(--hub-muted);
    font-size: 13px;
}

.hub-group--foot .hub-item__icon {
    width: 15px;
    height: 15px;
}

.hub-group + .hub-group {
    margin-top: 18px;
}

.hub-group__title {
    margin: 0 10px 6px;
    color: var(--hub-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hub-group__items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hub-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--hub-ink);
    text-decoration: none;
}

.hub-item:hover {
    background: var(--hub-wash);
}

.hub-item[aria-current="page"] {
    background: var(--hub-accent-wash);
    color: var(--hub-accent);
}

.hub-item__icon {
    flex: none;
    margin-top: 1px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--hub-muted);
}

.hub-item[aria-current="page"] .hub-item__icon,
.hub-item:hover .hub-item__icon {
    color: inherit;
}

.hub-item__words {
    min-width: 0;
}

.hub-item__title {
    display: block;
    font-weight: 500;
}

.hub-item__note {
    display: block;
    color: var(--hub-muted);
    font-size: 12px;
}

.hub-item[aria-current="page"] .hub-item__note {
    color: inherit;
    opacity: 0.8;
}

:is(.hub-item, .hub-menu, .hub-brand__name):focus-visible {
    outline: 2px solid var(--hub-accent);
    outline-offset: 1px;
}

.hub-main {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    min-height: 0;
    /* White above and below the frame, so where the app's page begins and ends is plain to see. */
    padding: 32px 0;
    background: #ffffff;
}

.hub-frame {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    border: 0;
    background: var(--hub-wash);
}

.hub-frame[hidden] {
    display: none;
}

.hub-sources {
    flex: none;
    max-height: 30%;
    overflow-y: auto;
    padding: 6px 16px;
    border-top: 1px solid var(--hub-line);
    background: #ffffff;
    color: var(--hub-muted);
    font-size: 12px;
    line-height: 1.45;
}

.hub-sources[hidden] {
    display: none;
}

.hub-sources a {
    color: var(--hub-accent);
}

/* While the frame loads: over the frame's room, so the page it is leaving does not show through. */
.hub-loading {
    position: absolute;
    /* Over the frame's room only: the white bands above and below stay white. */
    inset: 32px 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    background: var(--hub-wash);
    color: var(--hub-muted);
}

.hub-loading[hidden] {
    display: none;
}

.hub-message {
    margin: 48px auto;
    max-width: 480px;
    padding: 0 24px;
    color: var(--hub-muted);
    text-align: center;
}

/* A narrow window: the pane becomes a strip across the top; its menu opens the list over the page. */
@media (max-width: 760px) {
    .hub {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .hub-pane {
        position: relative;
        z-index: 10;
        border-right: 0;
        border-bottom: 1px solid var(--hub-line);
    }

    .hub-brand {
        padding: 8px 14px;
    }

    /* A phone keeps its height for the app: thinner white bands. */
    .hub-main {
        gap: 8px;
        padding: 12px 0;
    }

    .hub-loading {
        inset: 12px 0;
    }

    .hub-menu {
        display: inline-flex;
    }

    .hub-brand__line {
        display: none;
    }

    .hub-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: 70vh;
        padding: 12px 10px;
        border-bottom: 1px solid var(--hub-line);
        background: #ffffff;
        box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
    }

    .hub-pane--open .hub-nav {
        display: block;
    }
}
