/* All pages: theme colours, page layout with the top bar, light and dark versions */

/* --highlight: the sidebar's blue, for the current page, the open sidebar panel and buttons (white text on it);
   --accent: links and icons; --font: the sidebar's font, used everywhere */
:root {
    --bar-height: 44px;
    --font: "Helvetica Neue", Arial, Helvetica, sans-serif;
    --surface: #ffffff;
    --surface-hover: #f1f3f5;
    --border: #d6dadf;
    --text: #222a31;
    --muted: #5d6772;
    --accent: #0074d9;
    --highlight: #0074d9;
    --highlight-hover: #0063b8;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --surface: #1a2027;
    --surface-hover: #242b33;
    --border: #2c343d;
    --text: #e7ebee;
    --muted: #9aa5b0;
    --accent: #4db3ef;
    --highlight: #1b5e9e;
    --highlight-hover: #2270ba;
}

/* page: top bar above the content, which fills the rest of the window */
html, body {
    height: 100%;
}
body {
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 4px;
    height: var(--bar-height);
    padding: 0 8px 0 14px;
    background: var(--surface);
    /* see-through edge over the top of the content (map), like the sidebar and zoom buttons have */
    position: relative;
    z-index: 1001;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .2);
    color: var(--text);
    font: 14px/1 var(--font);
}
.topbar a {
    color: inherit;
    text-decoration: none;
}
.topbar .logo {
    flex: none;
    margin-right: 12px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.01em;
}
.topbar .logo span {
    color: var(--muted);
    font-weight: 500;
}
.topbar .links {
    display: flex;
    flex: 1;
    gap: 4px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.topbar .links a {
    flex: none;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--muted);
    white-space: nowrap;
}
.topbar .links a:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.topbar .links a.current {
    background: var(--highlight);
    color: #ffffff;
    font-weight: 600;
}
.topbar button {
    flex: none;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
}
.topbar button.text {
    width: auto;
    padding: 0 10px;
    font: inherit;
}
.topbar button:hover {
    background: var(--surface-hover);
    color: var(--text);
}
@media (max-width: 600px) {
    .topbar .logo span { display: none; }
    .topbar .links {
        -webkit-mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 24px), transparent);
        mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 24px), transparent);
    }
}

/* things with a light and a dark version (theme button icon, legend picture) */
:root:not([data-theme="dark"]) .theme-dark,
:root[data-theme="dark"] .theme-light {
    display: none;
}
