* {
    box-sizing: border-box;
}

html,
body {
    font-size: 16px;
    height: 100%;
    margin: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #191919;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 16px 16px, 32px 32px, 32px 32px;
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-wrap: break-word;
}

a {
    color: #007cbc;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 124, 188, 0.25);
}

a:hover {
    border-bottom: 1px solid #007cbc;
}

a:visited {
    color: #007cbc;
}

a.white {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.25);
}

a.white:hover {
    border-bottom-color: #fff;
}

a.white:visited {
    color: #fff;
}

a.external {
    padding-right: 0.9rem;
}

header {
    padding: 2rem 3rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: 2rem;
}

.header__left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem 1.4rem;
}

.header__logo {
    border-bottom: none;
    font-size: 2rem;
    font-weight: 700;
}

.header__logo img {
    height: 2.5rem;
    width: auto;
    display: block;
}

.header__logo:hover {
    text-decoration: none;
}

.header__title {
    border-bottom-color: transparent;
    font-size: 2.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.header__title:hover {
    border-bottom-color: rgba(255, 255, 255, 0.25);
}

.header__github {
    border-bottom-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    line-height: 1;
    font-weight: 600;
}

.header__github:hover {
    border-bottom-color: rgba(255, 255, 255, 0.25);
}

.header__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-left: auto;
    min-width: 0;
}

.header__search {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    min-width: 260px;
}

.header__search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.header__search-input {
    width: min(320px, 100%);
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    outline: none;
}

.header__search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.header__search-input:focus {
    border-color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.12);
}

.header__search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 30;
    width: min(420px, 100%);
    max-height: 22rem;
    overflow: auto;
    background: #fff;
    color: #191919;
    border: 1px solid #cfcfcf;
    border-radius: 0.5rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.header__search-results[hidden] {
    display: none;
}

.search-result {
    display: block;
    padding: 0.8rem 0.95rem;
    border-bottom: 1px solid #ececec;
    text-decoration: none;
    color: #191919;
}

.search-result:last-child {
    border-bottom: 0;
}

.search-result:hover {
    background: #f6f6f6;
    border-bottom-color: #ececec;
}

.search-result__title {
    display: block;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.search-result__summary {
    display: block;
    font-size: 0.9rem;
    color: #444;
}

.content {
    flex-grow: 1;
}

.content--reversed {
    background: #fff;
    color: #191919;
}

.documentation {
    padding: 3rem;
    display: flex;
}

.documentation__sidebar {
    margin-right: 2rem;
}

.documentation__sidebar ul {
    padding-left: 0;
    list-style: none;
}

.documentation__sidebar>ul>li {
    margin-bottom: 1rem;
}

.documentation__sidebar .documentation__sidebar__title {
    font-size: 1.25rem;
    font-weight: 700;
}

.documentation__sidebar ul ul {
    margin-top: 0.25rem;
}

.documentation__sidebar ul ul li {
    border-left: 1px solid #191919;
    padding-left: 0.75rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.documentation__sidebar ul ul li.active>a,
.documentation__sidebar ul ul li.active>a:visited {
    font-weight: 700;
    border-bottom: 1px solid #007cbc;
}

.documentation__sidebar .subsection-links {
    margin-top: 0.35rem;
    margin-bottom: 0.2rem;
}

.documentation__sidebar .subsection-links li {
    border-left: 1px solid rgba(25, 25, 25, 0.5);
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
}

.documentation__sidebar .subsection-links a {
    font-size: 0.9rem;
}

.documentation__sidebar .subsection-links a.subsection-h3 {
    font-size: 0.82rem;
    margin-left: 0.5rem;
}

.documentation__content {
    width: 60%;
    margin-left: 2rem;
}

.examples-page {
    background: #fff;
    color: #191919;
    padding: 1.25rem;
}

.examples-page h1,
.examples-page h2,
.examples-page h3,
.examples-page h4,
.examples-page h5,
.examples-page h6 {
    color: #191919;
}

.examples-page p,
.examples-page li,
.examples-page strong,
.examples-page em {
    color: #191919;
}

.examples-page a,
.examples-page a:visited {
    color: #007cbc;
    border-bottom-color: rgba(0, 124, 188, 0.25);
}

.examples-page a:hover {
    border-bottom-color: #007cbc;
}

.examples-page pre {
    background: #191919;
    color: #f5f5f5;
}

.examples-page pre code {
    color: #f5f5f5;
}

.documentation__content h1,
.documentation__content h2,
.documentation__content h3,
.documentation__content h4,
.documentation__content h5,
.documentation__content h6 {
    scroll-margin-top: 1rem;
}

.documentation__content h1 .zola-anchor,
.documentation__content h2 .zola-anchor,
.documentation__content h3 .zola-anchor,
.documentation__content h4 .zola-anchor,
.documentation__content h5 .zola-anchor,
.documentation__content h6 .zola-anchor {
    display: none;
}

.documentation__content blockquote {
    border-left: 10px solid #191919;
    padding: 0.25rem 0.5rem;
    margin-left: 0;
    font-style: italic;
}

.documentation__content iframe {
    width: 100%;
    min-height: 400px;
}

.documentation__content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.documentation__content th,
.documentation__content td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

.documentation__content th {
    background: #3a3a3a;
    color: #fff;
}

.documentation__content tr:nth-child(even) {
    background: #f9f9f9;
}

/* Keep legacy table styling on Python API page only. */
.python-api-page table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.python-api-page th,
.python-api-page td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

.python-api-page th {
    background: #3a3a3a;
    color: #fff;
}

.python-api-page tr:nth-child(even) {
    background: #f9f9f9;
}

img {
    max-width: 100%;
    height: auto;
}

pre {
    padding: 1rem;
    overflow: auto;
    background: #f5f5f5;
}

p code,
li code:not(pre code) {
    background-color: #f5f5f5;
    white-space: pre-wrap;
    padding: 5px;
    border-radius: 5px;
    font-size: 0.85rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.1), 0 2px 1px -1px rgba(0, 0, 0, 0.12);
}

footer {
    text-align: center;
    padding: 2rem 3rem;
}

@media only screen and (max-width: 1000px) {
    header {
        max-width: 90%;
        margin-inline: auto;
        justify-content: flex-start;
        padding: 1rem 0;
    }

    .header__github {
        margin-left: auto;
    }

    .header__logo {
        text-align: left;
        width: auto;
    }

    .header__left {
        gap: 0.8rem 1rem;
    }

    .documentation {
        flex-direction: column;
        padding: 2rem;
    }

    .documentation__content {
        width: 100%;
        margin-left: 0;
    }

    .documentation__sidebar {
        border-top: 1px solid #191919;
        order: 1;
        margin-right: 0;
        margin-top: 1rem;
        padding-top: 1rem;
    }
}