/*------------------------------------------------
   Reset
------------------------------------------------*/

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, button, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    line-height: inherit;
    vertical-align: baseline;
}  
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote::before,
blockquote::after {
    content: none;
}
q::before,
q::after {
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}
a {
    text-decoration: none;
}
strong {
    font-weight: bold;
}
em {
    font-style: italic;
}
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    user-select: none;
}

/*------------------------------------------------
   Fonts
------------------------------------------------*/

@font-face {
    font-family: 'source_sans_3';
    src: url('SourceSans3-Regular.ttf.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'robotobold';
    src: url('roboto-bold-webfont.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'jetbrains_mono';
    src: url('jetbrainsmono-medium-webfont.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'jetbrains_mono';
    src: url('jetbrainsmono-bold-webfont.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'Inter';
    src: url('InterVariable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
}
@font-face {
    font-family: 'Inter';
    src: url('InterVariable-Italic.woff2') format('woff2');
    font-weight: 100 900;
    font-style: italic;
}

/*------------------------------------------------
   Light mode
------------------------------------------------*/

:root {
    --bg-page: #ffffff;
    --bg-banner: #5d8cac;
    --bg-sidebar: #e0e0e0;
    --bg-popup: #f8f8f8;
    --bg-sidebar-hover: #c8d1d7;
    --bg-code-block: #f4f4f4;
    --bg-highlight: #ffffd0;
    --bg-nav-link-hover: #f4faff;
    --diagram-solid-fill: #fffff8;
    --diagram-arrow-color: #2b6bc6;
    
    --text-banner: #ffffff;
    --text-primary: #181818;
    --text-secondary: #404040;
    --text-toc-subheading: #707070;
    --text-table-heading: #707070;
    --text-heading: #567bb0;
    --text-title-subheading: #a9c3e8;
    --text-muted: #909090;
    --text-code: #909090;
    --text-code-inline: #909090;

    --link-color: #269eff;
    --type-color: #28b6b6;
    --symbol-color: #269eff;
    --var-color: #404040;
    --button-background: #dfebf3;

    --border-primary: #181818;
    --border-secondary: #a5bee0;
    --border-sidebar: #999999;
    --border-toc-subheading: #c8c8c8;
    --border-nav-link: #d6d6d6;
    --border-nav-link-hover: #a1c5e2;
    --border-popup: #cccccc;
    --border-content: #aaaaaa;
    --border-table: #e8e8e8;
    --shadow-opacity: 0.05;
    --shadow-popup-opacity: 0.05;
    
    --scrollbar-thumb: #80868b42;
}

/*------------------------------------------------
   Dark mode
------------------------------------------------*/

[data-theme="dark"] {
    --bg-page: #1c1c1c;
    --bg-banner: #2a4a67;
    --bg-sidebar: #242424;
    --bg-popup: #181818;
    --bg-sidebar-hover: #2b3945;
    --bg-code-block: #0f0f0f;
    --bg-highlight: #3a3a20;
    --bg-nav-link-hover: #1d2124;
    --diagram-solid-fill: #171a1b;
    --diagram-arrow-color: #3c679c;
    
    --text-primary: #e4e4e4;
    --text-secondary: #b0b0b0;
    --text-toc-subheading: #808080;
    --text-table-heading: #808080;
    --text-heading: #9ab6d6;
    --text-title-subheading: #4e6b8e;
    --text-muted: #808080;
    --text-code: #a8a8a8;
    --text-code-inline: #a0a0a0;
    
    --link-color: #5dade2;
    --type-color: #48d1cc;
    --symbol-color: #5dade2;
    --var-color: #c0c0c0;
    --button-background: #263339;
    
    --border-primary: #707070;
    --border-secondary: #546a88;
    --border-sidebar: #707070;
    --border-toc-subheading: #3c3c3c;
    --border-nav-link: #383838;
    --border-nav-link-hover: #435b6b;
    --border-popup: #404040;
    --border-content: #404040;
    --border-table: #333333;
    --shadow-opacity: 0.1;
    --shadow-popup-opacity: 0.5;
    
    --scrollbar-thumb: #60606080;
}

/*------------------------------------------------
   Page
------------------------------------------------*/

html {
    background: var(--bg-page);
}

.inner-body {
    max-width: 1170px;
    margin-left: auto;
    margin-right: auto;
}

#hamburger {
    display: none;
    position: relative;
    width: 30px;
    height: 30px;
    background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDcuOTM3NSA3LjkzNzUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogPHJlY3QgaWQ9InJlY3QxNDAyIiB4PSIxLjA1ODMiIHk9IjMuNDM5NiIgd2lkdGg9IjUuODIwOCIgaGVpZ2h0PSIxLjA1ODMiIHJ5PSIuNTI5MTciIGZpbGw9IiNlMGUwZTAiLz4KIDx1c2UgaWQ9InVzZTE0MDQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTIuMTE2NykiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHhsaW5rOmhyZWY9IiNyZWN0MTQwMiIvPgogPHVzZSB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDQuMjMzMykiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHhsaW5rOmhyZWY9IiN1c2UxNDA0Ii8+Cjwvc3ZnPgo=);
    background-size: 28px 28px;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

#hamburger:hover,
#hamburger.highlight {
    background-color: rgba(255, 255, 255, 0.15);
}

/*------------------------------------------------
   Theme toggle button
------------------------------------------------*/

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    border: none;
    background: transparent;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Icon via CSS mask - color comes from background-color */
.theme-toggle::before {
    content: '';
    width: 22px;
    height: 22px;
    background-color: var(--text-banner);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z' fill='white'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z' fill='white'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    transition: background-color 0.2s ease;
}

/* Sun icon (shown in dark mode) */
[data-theme="dark"] .theme-toggle::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='5' fill='white'/%3E%3Cpath d='M12 1L12 3M12 21L12 23M4.22 4.22L5.64 5.64M18.36 18.36L19.78 19.78M1 12L3 12M21 12L23 12M4.22 19.78L5.64 18.36M18.36 5.64L19.78 4.22' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='5' fill='white'/%3E%3Cpath d='M12 1L12 3M12 21L12 23M4.22 4.22L5.64 5.64M18.36 18.36L19.78 19.78M1 12L3 12M21 12L23 12M4.22 19.78L5.64 18.36M18.36 5.64L19.78 4.22' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/*------------------------------------------------
   Content styles
------------------------------------------------*/

.content a {
    color: var(--link-color);
}
.content a:hover {
    text-decoration: underline;
}

.content .highlighted {
    background: var(--bg-highlight);
}

.content-parent {
    padding: 10px 20px;
    background: var(--bg-page);
}

.content {
    font-family: "Inter", sans-serif;
    font-weight: 350;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.4667;
    user-select: text;
}
.content h1 {
    font-family: "robotobold", sans-serif;
    font-size: 42px;
    color: var(--text-heading);
    margin-bottom: 16px;
    overflow: visible;
}
.content h2 {
    font-family: "robotobold", sans-serif;
    font-size: 31px;
    color: var(--text-heading);
    margin-top: 38px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-secondary);
}
.content h3 {
    font-family: "robotobold", sans-serif;
    font-size: 24px;
    color: var(--text-heading);
    margin-top: 30px;
    margin-bottom: 11px;
}
.content h1 code {
    font-size: 39px;
    font-weight: bold;
    line-height: 1;
}
.content h1:has(> .title-subheading) > br {
    display: none;
}
.content h1 .title-subheading {
    display: block;
    font-family: "robotobold", sans-serif;
    font-size: 24px;
    color: var(--text-title-subheading);
    line-height: 1.5;
    margin-top: -9px;
    padding-bottom: 8px;
}
.content h2 code, .content h3 code, .content h1 .title-subheading code {
    font-weight: bold;
    line-height: 1;
}
.content h2 code {
    font-size: 30px;
}
.content h3 code, .content h1 .title-subheading code {
    font-size: 21px;
}
.content p {
    margin-bottom: 18px;
}
.content svg {
    margin-bottom: 18px;
}
.content code {
    font-family: "jetbrains_mono", monospace;
    font-size: 14px;
}
.content p code, .content ul code, .content ol code, .content table code {
    color: var(--text-code-inline);
}
.content a code {
    color: var(--link-color);
}
.content pre {
    font-family: "jetbrains_mono", monospace;
    box-sizing: border-box;
    width: fit-content;
    max-width: 100%;
    padding: 5px 7px;
    margin-bottom: 1.5em;
    color: var(--text-code);
    background-color: var(--bg-code-block);
    overflow-x: auto;
    scrollbar-color: var(--scrollbar-thumb) transparent;
    line-height: 1.2;
}
.content pre::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
}
.content ul, .content ol {
    margin-left: 40px;
    margin-bottom: 1.5em;
}
.content ul {
    list-style-type: disc;
}
.content ol {
    list-style-type: decimal;
}
.content li > ul, .content li > ol {
    margin-bottom: 0;
}
.content .type {
    color: var(--type-color);
}
.content .symbol {
    color: var(--symbol-color);
}
.content .var {
    color: var(--var-color);
}
.content .caption {
    font-size: 14px;
    font-family: "source_sans_3", sans-serif;
    color: var(--text-muted);
    margin-left: 13px;
}
/*------------------------------------------------
   API definitions
------------------------------------------------*/

.content dl.api_defs dt code {
    color: var(--text-muted);
}
.content dl.api_defs dt code.api-decl {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
}
.content dl.api_defs .api-decl-prefix {
    white-space: nowrap;
}
.content dl.api_defs .api-decl-params {
    min-width: 0;
}
.content dl.api_defs .api-param {
    display: inline-block;
    max-width: 100%;
}
.content dl.api_defs code.api-decl + br {
    display: none;
}
.content dl.api_defs dt {
    margin-bottom: 2px;
    line-height: 1.3333;
}
.content dl.api_defs dd {
    margin-left: 40px;
}

/*------------------------------------------------
   Tables
------------------------------------------------*/

.content table {
    border-collapse: collapse;
    margin: 0 auto 1.5em auto;
}
.content table th,
.content table td {
    border: 2px solid var(--border-table);
    padding: 0 7px;
}
.content table th {
    font-family: "source_sans_3", sans-serif;
    color: var(--text-table-heading);
    font-size: 16px;
    background-color: var(--border-table);
}

/*------------------------------------------------
   Directory/TOC shared styles
------------------------------------------------*/

.directory ul {
    line-height: 1.45;
}
.directory .toc-page-link,
.directory .toc-section > a {
    box-sizing: border-box;
    display: block;
    width: 100%;
}
.directory .toc-entry {
    --toc-page-indent: 20px;
    --toc-section-indent: 38px;
    --toc-section-line-left: 26px;
}
.directory .toc-depth-1 {
    --toc-page-indent: 38px;
    --toc-section-indent: 56px;
    --toc-section-line-left: 44px;
}
.directory .toc-depth-2 {
    --toc-page-indent: 56px;
    --toc-section-indent: 74px;
    --toc-section-line-left: 62px;
}
.directory .toc-depth-3 {
    --toc-page-indent: 74px;
    --toc-section-indent: 90px;
    --toc-section-line-left: 78px;
}
.directory .toc-depth-4 {
    --toc-page-indent: 90px;
    --toc-section-indent: 110px;
    --toc-section-line-left: 98px;
}
.directory .toc-depth-5 {
    --toc-page-indent: 110px;
    --toc-section-indent: 128px;
    --toc-section-line-left: 116px;
}
.directory .toc-entry > .toc-page-link {
    padding-left: var(--toc-page-indent);
}
.directory .toc-section > a {
    color: var(--text-toc-subheading);
    padding-left: var(--toc-section-indent);
}
.directory .toc-section {
    line-height: calc(1.45em - 1px);
}
.directory .toc-section:first-child {
    padding-top: 0.5px;
}
.directory .toc-section:last-child {
    padding-bottom: 0.5px;
}
.directory .toc-sections {
    max-height: 0;
    overflow: hidden;
    transition: max-height 150ms ease, visibility 0s linear 150ms;
    visibility: hidden;
}
.directory .toc-page.selected > .toc-sections {
    max-height: var(--toc-sections-height);
    position: relative;
    transition-delay: 0s;
    visibility: visible;
}
.directory .toc-page.selected > .toc-sections::before {
    background: var(--border-toc-subheading);
    bottom: 1px;
    content: "";
    left: var(--toc-section-line-left);
    pointer-events: none;
    position: absolute;
    top: 1px;
    width: 3px;
}
.directory .toc-page.selected > .toc-page-link {
    color: var(--text-primary);
}
.directory .toc-page.selected > .toc-page-link code {
    color: var(--text-primary);
}
.directory .toc-page.selected > .toc-page-link > .toc-title {
    font-weight: bold;
}
.directory .toc-page:not(.selected) > .toc-page-link:hover {
    color: var(--link-color);
}
.directory .toc-page:not(.selected) > .toc-page-link:hover code {
    color: var(--link-color);
}
.directory .toc-section > a:hover {
    color: var(--link-color);
}
@media (prefers-reduced-motion: reduce) {
    .directory .toc-sections {
        transition: none;
    }
}
.directory .toc-page-link code,
.directory .toc-section code {
    font-family: "jetbrains_mono", monospace;
    font-size: 13px;
}
.directory .toc-section code {
    color: inherit;
}
.directory .toc-page-link code {
    color: var(--text-heading);
    font-weight: bold;
}
.directory a {
    color: inherit;
}
.directory a:focus-visible {
    outline: 2px solid var(--link-color);
    outline-offset: -2px;
}
.directory .toc-heading {
    margin: 16px 0px 8px 19px;
    font-family: "robotobold", sans-serif;
    font-size: 16px;
    color: var(--text-heading);
}

.scroller {
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    height: 100%;
    transform-origin: top right;
}

.scroller .inner {
    margin: 8px 0;
    white-space: nowrap;
}
.scroller ul {
    margin-bottom: 0px;
}

.scroller::-webkit-scrollbar, scrollbar {
    width: 8px;
}

.scroller::-webkit-scrollbar-thumb, scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

.mobile-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0px 16px 5px;
    border-bottom: 1px solid var(--border-secondary);
    margin-bottom: 4px;
}

.mobile-nav a {
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 14px;
}

.mobile-nav .nav-link {
    padding: 4px 8px;
    border-radius: 4px;
}

.mobile-nav .nav-link:hover {
    background: var(--bg-sidebar-hover);
}

.mobile-nav .theme-toggle {
    margin-left: auto;
}

.mobile-nav .theme-toggle:hover {
    background: var(--bg-sidebar-hover);
}

.mobile-nav .theme-toggle::before {
    background-color: var(--text-secondary);
}
