/* shell.css -- the site header, on every page including the dashboards.
   Colours are tokens from css/tokens.css, light and dark; sizes, radii,
   spacing and shadows are the operational-screen values. Every
   class is sx- prefixed so a dashboard's own stylesheet cannot collide. */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/css/InterVariable.woff2') format('woff2');
}

:root {
    --sx-font:        Inter, system-ui, sans-serif;
    --sx-radius-card: 6px;
    --sx-radius-ctl:  4px;
    --sx-shadow-card: 0 1px 4px var(--c-shadow-soft);
    --sx-shadow-pop:  0 4px 16px var(--c-shadow-pop);
}

.sx-bar {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
    min-height: 64px; padding: 0 24px; box-sizing: border-box;
    background: var(--c-bar); color: var(--c-on-solid);
    border-bottom: 4px solid var(--c-bar-mark);
    font-family: var(--sx-font); font-size: 16px; line-height: 1.4;
    position: relative; z-index: 50;
}
.sx-brand {
    color: var(--c-on-solid); text-decoration: none;
    font-size: 18px; font-weight: 700; letter-spacing: .2px; white-space: nowrap;
}
.sx-brand { justify-self: start; }
.sx-nav   { justify-self: center; display: flex; align-items: center; gap: 4px; }
.sx-who   { justify-self: end; }

.sx-nav-link {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 40px; padding: 8px 12px; box-sizing: border-box;
    color: var(--c-on-solid); background: transparent; border: 0; border-radius: var(--sx-radius-ctl);
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
    border-bottom: 4px solid transparent;
}
.sx-nav-link:hover, .sx-nav-link[aria-expanded="true"] { background: var(--c-bar-hover); }
.sx-nav-link:focus-visible, .sx-menu a:focus-visible, .sx-toggle:focus-visible, .sx-brand:focus-visible {
    outline: 2px solid var(--c-on-bar); outline-offset: 2px;
}
.sx-nav-link.sx-on { border-bottom-color: var(--c-bar-mark); }
.sx-caret {
    width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
}

.sx-group { position: relative; }
.sx-menu {
    position: absolute; top: calc(100% + 4px); left: 0; min-width: 240px;
    background: var(--c-surface); border-radius: var(--sx-radius-card); box-shadow: var(--sx-shadow-pop);
    padding: 8px 0; z-index: 60;
}
.sx-menu[hidden] { display: none; }
.sx-menu-right { left: auto; right: 0; }
.sx-menu a {
    display: block; padding: 8px 16px; color: var(--c-ink); text-decoration: none;
    font-weight: 400; white-space: nowrap;
}
.sx-menu a:hover { background: var(--c-surface-sunk); }
.sx-menu a.sx-on { font-weight: 600; color: var(--c-link); }

.sx-toggle {
    display: none; margin-left: auto; min-height: 40px; padding: 8px 12px;
    color: var(--c-on-solid); background: transparent; border: 1px solid var(--c-on-bar);
    border-radius: var(--sx-radius-ctl); font: inherit; font-weight: 600; cursor: pointer;
}

@media (max-width: 900px) {
    .sx-bar { display: flex; flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
    .sx-toggle { display: inline-block; }
    .sx-nav, .sx-who { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; }
    .sx-bar.sx-open .sx-nav, .sx-bar.sx-open .sx-who { display: flex; }
    .sx-nav-link { width: 100%; justify-content: space-between; }
    .sx-menu { position: static; box-shadow: none; background: transparent; padding: 0 0 8px 16px; min-width: 0; }
    .sx-menu a { color: var(--c-on-solid); padding: 8px 12px; }
    .sx-menu a:hover { background: var(--c-bar-hover); }
    .sx-menu a.sx-on { color: var(--c-on-solid); }
}

/* Colours: Light, Dark, Same as computer, in the account menu. */
.sx-theme { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px 16px; border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); margin: 4px 0; }
.sx-theme-label { width: 100%; font-size: 14px; color: var(--c-ink-muted); }
.sx-theme button {
    font: inherit; font-size: 14px; padding: 4px 8px; border-radius: var(--sx-radius-ctl);
    border: 1px solid var(--c-line-strong); background: var(--c-surface); color: var(--c-ink); cursor: pointer;
}
.sx-theme button[aria-pressed="true"] { background: var(--c-bar); border-color: var(--c-bar); color: var(--c-on-bar); font-weight: 600; }
.sx-theme button:focus-visible { outline: 2px solid var(--c-link); outline-offset: 2px; }
