/*
 * The API reference in the guides' colours and type (ADR 0129). Scalar draws the page; these are
 * its theme variables set to the site's paper and ink, and the bar the guides carry across the
 * top. Its own theme is switched off, so nothing here competes with a default.
 */

.light-mode, .dark-mode {
    --scalar-font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --scalar-font-code: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --scalar-radius: .5rem;
    --scalar-radius-lg: .75rem;
    --scalar-radius-xl: .75rem;
    --scalar-custom-header-height: 3.75rem;
}

.light-mode {
    --scalar-background-1: #f7f3e9;
    --scalar-background-2: #fffdf7;
    --scalar-background-3: #efe9db;
    --scalar-background-accent: #e6f4c7;
    --scalar-color-1: #111111;
    --scalar-color-2: rgba(17, 17, 17, .66);
    --scalar-color-3: rgba(17, 17, 17, .5);
    --scalar-color-accent: #1c6b3f;
    --scalar-border-color: rgba(17, 17, 17, .12);
    --scalar-color-green: #1c6b3f;
    --scalar-color-red: #b3261e;
    --scalar-color-yellow: #8a5a00;
    --scalar-color-blue: #1f5fa8;
    --scalar-color-orange: #a8521c;
    --scalar-color-purple: #6b3fa0;
    --scalar-button-1: #111111;
    --scalar-button-1-color: #f7f3e9;
    --scalar-button-1-hover: rgba(17, 17, 17, .85);
    --scalar-sidebar-background-1: #f7f3e9;
    --scalar-sidebar-item-hover-background: rgba(17, 17, 17, .06);
    --scalar-sidebar-item-active-background: #e6f4c7;
    --scalar-sidebar-color-active: #1f3a12;
    --scalar-sidebar-border-color: rgba(17, 17, 17, .12);
    --scalar-sidebar-search-background: #fffdf7;
    --scalar-sidebar-search-border-color: rgba(17, 17, 17, .12);
    --px-bar-background: rgba(247, 243, 233, .92);
    --px-mark: #111111;
}

.dark-mode {
    --scalar-background-1: #0f0f0e;
    --scalar-background-2: #171716;
    --scalar-background-3: #1f1f1d;
    --scalar-background-accent: rgba(228, 255, 90, .14);
    --scalar-color-1: #f3efe4;
    --scalar-color-2: rgba(243, 239, 228, .68);
    --scalar-color-3: rgba(243, 239, 228, .5);
    --scalar-color-accent: #e4ff5a;
    --scalar-border-color: rgba(243, 239, 228, .14);
    --scalar-color-green: #7fe0a3;
    --scalar-color-red: #ff8f85;
    --scalar-color-yellow: #f2c66d;
    --scalar-color-blue: #8fc7ff;
    --scalar-color-orange: #f2a37a;
    --scalar-color-purple: #c9a7ff;
    --scalar-button-1: #f3efe4;
    --scalar-button-1-color: #0f0f0e;
    --scalar-button-1-hover: rgba(243, 239, 228, .85);
    --scalar-sidebar-background-1: #0f0f0e;
    --scalar-sidebar-item-hover-background: rgba(243, 239, 228, .07);
    --scalar-sidebar-item-active-background: rgba(228, 255, 90, .16);
    --scalar-sidebar-color-active: #e4ff5a;
    --scalar-sidebar-border-color: rgba(243, 239, 228, .14);
    --scalar-sidebar-search-background: #171716;
    --scalar-sidebar-search-border-color: rgba(243, 239, 228, .14);
    --px-bar-background: rgba(15, 15, 14, .92);
    --px-mark: #f3efe4;
}

/* The bar the guides carry, drawn here with Scalar's own variables so it follows its theme. */
.px-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 3.75rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0 1.5rem;
    background: var(--px-bar-background);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--scalar-border-color);
    font-family: var(--scalar-font);
    font-weight: 500;
    color: var(--scalar-color-1);
}

.px-brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; flex-shrink: 0; }

.px-mark {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border: 2.5px solid var(--px-mark);
    border-radius: .6rem;
    font-weight: 700;
    font-size: .85rem;
    letter-spacing: -.02em;
}

.px-word { font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em; }

.px-label {
    font-family: var(--scalar-font-code);
    font-size: .7rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--scalar-color-2);
    padding-left: .6rem;
    border-left: 1px solid var(--scalar-border-color);
}

.px-links { display: flex; gap: .25rem; font-size: .95rem; overflow-x: auto; scrollbar-width: none; }
.px-links::-webkit-scrollbar { display: none; }

.px-links a {
    padding: .35rem .8rem;
    border-radius: 999px;
    color: var(--scalar-color-2);
    text-decoration: none;
    white-space: nowrap;
}

.px-links a:hover { color: var(--scalar-color-1); background: var(--scalar-sidebar-item-hover-background); }
.px-links a[aria-current="page"] { color: var(--scalar-color-1); background: var(--scalar-background-3); }

@media (max-width: 56rem) {
    .px-bar { gap: 1rem; padding: 0 1rem; }
    .px-label { display: none; }
}
