/*
 * USP documentation theme.
*/

:root {
    --usp-ink: #000000de;
    --usp-ink-light: #0000008a;
    --usp-ink-lighter: #00000052;
    --usp-ink-lightest: #00000012;
    --usp-paper: #fff;
    --usp-line: #0000001f;
    --usp-row-hover: #00000009;
    --usp-link: #4051b5;
    --usp-link-hover: #526cfe;
    --usp-link-hover-bg: #526cfe1a;
    --usp-code-ink: #36464e;
    --usp-code-bg: #f5f5f5;
    --usp-header-bg: #000;
    --usp-header-ink: #fff;
    --usp-footer-bg: #161616;
    --usp-footer-ink: #ffffffb3;
    --usp-footer-ink-faint: #ffffff73;

    --usp-hint: #448aff;
    --usp-hint-bg: #448aff1a;
    --usp-warning: #ff9100;
    --usp-warning-bg: #ff91001a;
    --usp-danger: #ff5252;
    --usp-danger-bg: #ff52521a;
    --usp-note: #00b0ff;
    --usp-note-bg: #00b0ff1a;

    /* The logo sets the header height: the image plus air and link padding. */
    --usp-logo-height: 2rem;
    --usp-header-height: calc(var(--usp-logo-height) + 2.2rem);
    --usp-sidebar-width: 12.1rem;
    --usp-content-width: 36.8rem;
    --usp-page-width: calc(var(--usp-content-width) + 2 * var(--usp-sidebar-width));
    --usp-hairline: 0.05rem;

    --usp-text-font: "montserrat-2", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
    --usp-code-font: "roboto-mono-2", SFMono-Regular, Consolas, Menlo, monospace;
}

/* base */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 125%;
    scroll-padding-top: calc(var(--usp-header-height) + 1rem);
}

/* A column, so that the footer is pushed to the bottom on short pages. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background-color: var(--usp-paper);
    color: var(--usp-ink);
    font-family: var(--usp-text-font);
    font-size: 0.8rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--usp-link);
    text-decoration: none;
    transition: color 125ms;
}

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

:focus-visible {
    outline: 0.1rem solid var(--usp-link-hover);
    outline-offset: 0.1rem;
}

.usp-skip {
    position: absolute;
    left: -100vw;
}

.usp-agent-note {
    position: absolute;
    left: -100vw;
}

.usp-skip:focus {
    left: 0.4rem;
    top: 0.4rem;
    z-index: 20;
    padding: 0.4rem 0.6rem;
    background-color: var(--usp-paper);
}

/* header */

.usp-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--usp-header-bg);
    color: var(--usp-header-ink);
    box-shadow: 0 0 0.2rem #0000004d, 0 0.2rem 0.4rem #0000004d;
}

.usp-header__inner {
    display: flex;
    align-items: center;
    height: var(--usp-header-height);
    max-width: var(--usp-page-width);
    margin: 0 auto;
    padding: 0 0.2rem;
}

.usp-header a {
    color: inherit;
}

.usp-header__logo {
    margin: 0.2rem;
    padding: 0.4rem;
}

.usp-header__logo img {
    display: block;
    height: var(--usp-logo-height);
    width: auto;
    margin: 0.5rem 0;
}

.usp-header__title {
    min-width: 0;
    margin: 0 0.4rem 0 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.usp-header__tools {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.usp-header__drawer {
    display: none;
    margin: 0.2rem;
    padding: 0.4rem;
    cursor: pointer;
}

.usp-header__drawer svg {
    display: block;
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

/* product and version pickers */

.usp-picker {
    position: relative;
    flex-shrink: 0;
    margin-left: 1rem;
    font-size: 0.8rem;
}

/* The product name is the one label that can be long enough to need clipping. */
.usp-picker--product {
    flex-shrink: 1;
    min-width: 0;
}

.usp-picker__current {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.usp-picker__label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.usp-picker__caret {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.25rem;
    fill: currentColor;
}

.usp-picker__list {
    position: absolute;
    top: calc(100% + 0.2rem);
    left: 0;
    min-width: 100%;
    margin: 0;
    padding: 0.2rem 0;
    list-style: none;
    background-color: var(--usp-paper);
    border-radius: 0.1rem;
    box-shadow: 0 0.2rem 0.5rem #0000001a, 0 0 0.05rem #00000040;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.2rem);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.usp-picker:hover .usp-picker__list,
.usp-picker:focus-within .usp-picker__list {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.usp-picker__list a {
    display: block;
    padding: 0.15rem 0.6rem;
    color: var(--usp-ink);
    line-height: 1.8;
    white-space: nowrap;
}

.usp-picker__list a[aria-current] {
    font-weight: 700;
}

.usp-picker__list a:hover {
    background-color: var(--usp-ink-lightest);
    color: var(--usp-link-hover);
    text-decoration: none;
}

/* breadcrumb */

.usp-breadcrumb {
    font-size: 0.7rem;
    color: var(--usp-ink-light);
}

.usp-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    margin: 0 0 0.8rem;
    padding: 0;
    list-style: none;
}

.usp-breadcrumb li + li::before {
    content: "/";
    padding: 0 0.3rem;
    color: var(--usp-ink-lighter);
}

.usp-breadcrumb a {
    color: inherit;
}

.usp-breadcrumb a:hover {
    color: var(--usp-link-hover);
}

/* search */

.usp-search,
.usp-search-compact {
    display: flex;
    align-items: center;
    --pf-font: var(--usp-text-font);
    --pf-searchbox-max-width: 11rem;
    --pf-input-height: 1.6rem;
    --pf-input-font-size: 0.7rem;
    --pf-border-radius: 0.1rem;
}

.usp-search-compact {
    display: none;
}

/* Pagefind's own stylesheet inflates the specificity of every rule it ships, so
   overriding its button needs !important rather than a longer selector. */
.usp-search-compact .pf-trigger-btn {
    width: auto !important;
    height: auto !important;
    padding: 0.4rem !important;
    background: none !important;
    border: 0 !important;
    color: var(--usp-header-ink) !important;
}

.usp-search-compact .pf-trigger-icon {
    width: 0.9rem !important;
    height: 0.9rem !important;
    background: var(--usp-header-ink) !important;
}

.usp-search-compact .pf-trigger-text,
.usp-search-compact .pf-trigger-shortcut {
    display: none !important;
}

/* banner */

.usp-banner {
    padding: 0.5rem 0.8rem;
    background-color: var(--usp-warning-bg);
    border-bottom: var(--usp-hairline) solid var(--usp-warning);
    font-size: 0.7rem;
    text-align: center;
}

/* layout */

.usp-layout {
    display: grid;
    grid-template-columns: var(--usp-sidebar-width) minmax(0, 1fr) var(--usp-sidebar-width);
    flex-grow: 1;
    width: 100%;
    max-width: var(--usp-page-width);
    margin: 0 auto;
    padding-top: 1.5rem;
    align-items: start;
}

.usp-sidebar {
    position: sticky;
    top: calc(var(--usp-header-height) + 0.8rem);
    max-height: calc(100vh - var(--usp-header-height) - 1.6rem);
    padding: 1.2rem 0;
    overflow-y: auto;
    font-size: 0.7rem;
    line-height: 1.3;
}

/* Placed explicitly: the table of contents is rendered before the content, to
   come first on narrow screens, but sits in the third lane here. */
.usp-nav-wrapper {
    grid-column: 1;
    grid-row: 1;
}

.usp-content {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding: 1rem 1.2rem 1.2rem;
}

.usp-toc {
    grid-column: 3;
    grid-row: 1;
}

/* navigation */

.usp-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.usp-nav__section > details > ul {
    margin-left: 0.6rem;
    padding-left: 0.6rem;
    border-left: var(--usp-hairline) solid var(--usp-line);
}

.usp-nav a,
.usp-nav__label {
    display: block;
    margin-top: 0.625em;
    padding: 0 0.6rem;
    color: inherit;
}

.usp-nav__label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.usp-nav__label::-webkit-details-marker {
    display: none;
}

.usp-nav__label:hover {
    color: var(--usp-link-hover);
}

/* The caret sits in the gutter, pointing right when the section is collapsed. */
.usp-nav__caret {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    margin-left: -0.6rem;
    fill: currentColor;
    rotate: -90deg;
    transition: rotate 0.2s;
}

.usp-nav details[open] > .usp-nav__label .usp-nav__caret {
    rotate: none;
}

.usp-nav a:hover {
    color: var(--usp-link-hover);
    text-decoration: none;
}

.usp-nav a[aria-current="page"] {
    color: var(--usp-link);
}

.usp-nav__title {
    padding: 0 0.6rem;
    font-weight: 700;
    color: var(--usp-ink-light);
}

/* table of contents */

.usp-toc__title {
    padding: 0 0.6rem;
    font-weight: 700;
    color: var(--usp-ink-light);
}

.usp-toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.usp-toc ul ul {
    padding-left: 0.8rem;
}

.usp-toc a {
    display: block;
    margin-top: 0.625em;
    padding: 0 0.6rem;
    color: inherit;
}

.usp-toc a:hover {
    color: var(--usp-link-hover);
    text-decoration: none;
}

.usp-toc a.usp-toc--active {
    color: var(--usp-link);
}

.usp-toc a.usp-toc--passed {
    color: var(--usp-ink-light);
}

/* content */

.usp-prose {
    overflow-wrap: break-word;
}

.usp-prose h1 {
    margin: 0 0 1.25em;
    color: var(--usp-ink-light);
    font-size: 2em;
    font-weight: 300;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.usp-prose h2 {
    margin: 1.6em 0 0.64em;
    font-size: 1.5625em;
    font-weight: 300;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.usp-prose h3 {
    margin: 1.6em 0 0.8em;
    font-size: 1.25em;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.5;
}

.usp-prose h2 + h3 {
    margin-top: 0.8em;
}

.usp-prose h4 {
    margin: 1em 0;
    font-size: 1em;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.usp-prose h5,
.usp-prose h6 {
    margin: 1.25em 0;
    color: var(--usp-ink-light);
    font-size: 0.8em;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.usp-prose h5 {
    text-transform: uppercase;
}

.usp-prose p {
    margin: 1em 0;
}

.usp-prose blockquote,
.usp-prose ol,
.usp-prose ul,
.usp-prose pre,
.usp-prose .highlight,
.usp-prose figure,
.usp-prose dl {
    margin: 1em 0;
}

.usp-prose ol,
.usp-prose ul {
    margin-left: 0.625em;
    padding: 0;
}

.usp-prose li {
    margin-left: 1.25em;
    margin-bottom: 0.5em;
}

.usp-prose li:last-child {
    margin-bottom: 0;
}

.usp-prose li > p {
    margin: 0.5em 0;
}

.usp-prose li ol,
.usp-prose li ul {
    margin: 0.5em 0 0.5em 0.625em;
}

.usp-prose > :first-child {
    margin-top: 0;
}

.usp-prose > :last-child {
    margin-bottom: 0;
}

.usp-prose img,
.usp-prose svg,
.usp-prose video {
    max-width: 100%;
    height: auto;
}

.usp-prose code {
    padding: 0 0.2941176471em;
    background-color: var(--usp-code-bg);
    border-radius: 0.1rem;
    color: var(--usp-code-ink);
    font-family: var(--usp-code-font);
    font-size: 0.85em;
    word-break: break-word;
}

.usp-prose a:hover code {
    background-color: var(--usp-link-hover-bg);
    color: var(--usp-link-hover);
}

.usp-prose pre,
.usp-prose .highlight {
    background-color: var(--usp-code-bg);
    border-radius: 0.1rem;
    color: var(--usp-code-ink);
    line-height: 1.4;
}

.usp-prose pre > code {
    display: block;
    padding: 0.7720588235em 1.1764705882em;
    overflow: auto;
    background: none;
    word-break: normal;
}

/* A highlighted block wraps its pre - with line numbers, two of them in a
   table - so the wrapper is what carries the margin. */
.usp-prose .highlight pre {
    margin: 0;
}

/* The generated palette brings a background of its own; the theme's wins, which
   keeps highlight.css exactly as hugo gen chromastyles writes it. */
.usp-prose .highlight .chroma {
    background-color: var(--usp-code-bg);
}

.usp-prose blockquote {
    padding-left: 0.6rem;
    border-left: 0.2rem solid var(--usp-ink-lighter);
    color: var(--usp-ink-light);
}

.usp-prose hr {
    margin: 1.5em 0;
    border: 0;
    border-bottom: var(--usp-hairline) solid var(--usp-ink-lightest);
}

.usp-table {
    margin: 1em 0;
    max-width: 100%;
    overflow: auto;
}

.usp-prose table {
    border-collapse: collapse;
    background-color: var(--usp-paper);
    border: var(--usp-hairline) solid var(--usp-line);
    border-radius: 0.1rem;
    font-size: 0.64rem;
}

.usp-prose th,
.usp-prose td {
    padding: 0.9375em 1.25em;
    text-align: left;
    vertical-align: top;
}

.usp-prose td {
    border-top: var(--usp-hairline) solid var(--usp-line);
}

.usp-prose th {
    min-width: 5rem;
    font-weight: 700;
}

.usp-prose tbody tr:hover {
    background-color: var(--usp-row-hover);
}

/* admonitions */

.usp-admonition {
    margin: 1em 0;
    padding: 0.6rem 0.8rem;
    border-left: 0.2rem solid var(--usp-hint);
    border-radius: 0.1rem;
    background-color: var(--usp-hint-bg);
    font-size: 0.75rem;
}

.usp-admonition > :first-child {
    margin-top: 0;
}

.usp-admonition > :last-child {
    margin-bottom: 0;
}

.usp-admonition__title {
    margin: 0 0 0.3em;
    font-weight: 700;
    color: var(--usp-hint);
}

.usp-admonition--warning {
    border-color: var(--usp-warning);
    background-color: var(--usp-warning-bg);
}

.usp-admonition--warning .usp-admonition__title {
    color: var(--usp-warning);
}

.usp-admonition--danger {
    border-color: var(--usp-danger);
    background-color: var(--usp-danger-bg);
}

.usp-admonition--danger .usp-admonition__title {
    color: var(--usp-danger);
}

.usp-admonition--note {
    border-color: var(--usp-note);
    background-color: var(--usp-note-bg);
}

.usp-admonition--note .usp-admonition__title {
    color: var(--usp-note);
}

/* footer */

.usp-footer {
    background-color: var(--usp-footer-bg);
    color: var(--usp-footer-ink);
    font-size: 0.64rem;
}

.usp-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    max-width: var(--usp-page-width);
    margin: 0 auto;
    padding: 0.2rem;
}

.usp-footer__copyright {
    margin: auto 0.6rem;
    padding: 0.4rem 0;
}

.usp-footer a {
    color: inherit;
    text-decoration: underline;
}

.usp-footer a:hover {
    color: var(--usp-header-ink);
}

.usp-social {
    display: inline-flex;
    gap: 0.2rem;
    margin: 0 0.4rem;
    padding: 0.6rem 0;
}

.usp-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    color: var(--usp-footer-ink-faint);
}

.usp-social a:hover {
    color: var(--usp-header-ink);
}

.usp-social svg {
    width: 0.8rem;
    height: 0.8rem;
    fill: currentColor;
}

/* 404 page */

.usp-error {
    flex-grow: 1;
    background: url("../images/404-error-space.jpg") center / cover no-repeat;
    color: var(--usp-paper);
}

.usp-error__inner {
    max-width: var(--usp-page-width);
    margin: 0 auto;
    padding: 2.5rem 0.8rem;
}

.usp-error h1 {
    margin: 0 0 1.25em;
    font-size: clamp(2rem, 7vw, 4.5rem);
    font-weight: 100;
    letter-spacing: -0.0111em;
    line-height: 1.0667;
    text-transform: uppercase;
}

.usp-error h1 span {
    color: #f3f;
}

.usp-error p {
    margin: 1em 0;
    font-size: clamp(1.2rem, 3.3vw, 2.1rem);
    font-weight: 200;
    line-height: 1.4286;
}

/* breakpoints */

/* No room for three lanes: the navigation becomes a drawer, and the header drops
   the logo. */
@media screen and (max-width: 76.234375em) {
    :root {
        --usp-header-height: 2.4rem;
    }

    .usp-header__logo {
        display: none;
    }

    .usp-header__drawer {
        display: block;
    }

    .usp-layout {
        grid-template-columns: minmax(0, 1fr) var(--usp-sidebar-width);
    }

    .usp-content {
        grid-column: 1;
        grid-row: 1;
        padding-left: 0.8rem;
    }

    .usp-toc {
        grid-column: 2;
        grid-row: 1;
    }

    .usp-nav-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 15;
        width: min(14rem, 80vw);
        height: 100%;
        max-height: none;
        padding: 0.8rem;
        overflow-y: auto;
        background-color: var(--usp-paper);
        box-shadow: 0 0 0.8rem #0000004d;
        transform: translateX(-100%);
        transition: transform 0.2s;
    }

    #__drawer:checked ~ .usp-layout .usp-nav-wrapper {
        transform: none;
    }

    #__drawer:checked ~ .usp-overlay {
        opacity: 1;
        visibility: visible;
    }

    .usp-overlay {
        position: fixed;
        inset: 0;
        z-index: 14;
        background-color: #0006;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s, visibility 0.2s;
    }
}

/* One column: the table of contents moves above the content, the search
   collapses into a dialog. */
@media screen and (max-width: 59.984375em) {
    .usp-search {
        display: none;
    }

    .usp-search-compact {
        display: flex;
    }

    .usp-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .usp-toc {
        position: static;
        grid-column: 1;
        grid-row: 1;
        max-height: none;
        margin: 0 0.8rem;
        padding-bottom: 0.8rem;
        border-bottom: var(--usp-hairline) solid var(--usp-line);
    }

    .usp-content {
        grid-column: 1;
        grid-row: 2;
        padding: 1rem 0.8rem 1.2rem;
    }
}

/* The copyright takes a line of its own. */
@media screen and (max-width: 44.984375em) {
    .usp-footer__copyright {
        width: 100%;
    }

    .usp-social {
        padding: 0.2rem 0 0.6rem;
    }
}

@media screen and (min-width: 76.25em) {
    .usp-overlay {
        display: none;
    }
}

/* Wide viewports scale the root up, as the reference does. */
@media screen and (min-width: 100em) {
    html {
        font-size: 137.5%;
    }
}

@media screen and (min-width: 125em) {
    html {
        font-size: 150%;
    }
}
