@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&display=swap');

:root > * {
  --md-accent-fg-color:        #d6336c;
  --md-accent-fg-color--light: #e8608a;
  --md-accent-fg-color--dark:  #b52758;
}

body {
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-optical-sizing: auto;
}

p {
    font-size: 16px;
}

.highlight > pre > code {
    font-family: "Geist Mono", monospace;
    font-size: 13px;
}

/* Python code blocks — dark style (excludes doc signatures) */
.language-python.highlight:not(.doc-signature) {
    --md-code-bg-color: #0d0d0d;
    background: #0d0d0d;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.6rem;
}

.language-python.highlight:not(.doc-signature) > pre {
    background: #0d0d0d;
    margin: 0;
    padding: 1rem 1.25rem;
}

.language-python.highlight:not(.doc-signature) > pre > code {
    color: #e2e8f0;
    line-height: 1.7;
}

/* Pygments token colours for dark background */
.language-python.highlight:not(.doc-signature) .k,
.language-python.highlight:not(.doc-signature) .kn,
.language-python.highlight:not(.doc-signature) .kd,
.language-python.highlight:not(.doc-signature) .kr,
.language-python.highlight:not(.doc-signature) .kt { color: #c792ea; } /* keywords */

.language-python.highlight:not(.doc-signature) .nb,
.language-python.highlight:not(.doc-signature) .bp,
.language-python.highlight:not(.doc-signature) .nf,
.language-python.highlight:not(.doc-signature) .nd { color: #82aaff; } /* builtins, functions, decorators */

.language-python.highlight:not(.doc-signature) .nc { color: #ffcb6b; } /* class names */

.language-python.highlight:not(.doc-signature) .s,
.language-python.highlight:not(.doc-signature) .s1,
.language-python.highlight:not(.doc-signature) .s2,
.language-python.highlight:not(.doc-signature) .sa,
.language-python.highlight:not(.doc-signature) .sb,
.language-python.highlight:not(.doc-signature) .se,
.language-python.highlight:not(.doc-signature) .si,
.language-python.highlight:not(.doc-signature) .ss { color: #c3e88d; } /* strings */

.language-python.highlight:not(.doc-signature) .mi,
.language-python.highlight:not(.doc-signature) .mf,
.language-python.highlight:not(.doc-signature) .mh { color: #f78c6c; } /* numbers */

.language-python.highlight:not(.doc-signature) .c,
.language-python.highlight:not(.doc-signature) .c1,
.language-python.highlight:not(.doc-signature) .cm { color: #546e7a; font-style: italic; } /* comments */

.language-python.highlight:not(.doc-signature) .n,
.language-python.highlight:not(.doc-signature) .nn { color: #e2e8f0; } /* names */

.language-python.highlight:not(.doc-signature) .o,
.language-python.highlight:not(.doc-signature) .ow,
.language-python.highlight:not(.doc-signature) .p  { color: #89ddff; } /* operators, punctuation */

/* Line numbers */
.language-python.highlight:not(.doc-signature) [data-linenos]::before {
    background-color: #0d0d0d !important;
    color: #4b5563 !important;
    box-shadow: -.05rem 0 #1f2937 inset;
}

/* Left sidebar */
.md-nav__item .md-nav__link {
    font-size: 16px !important;
    font-weight: 400 !important;
    color: #374151 !important;
    transition: color 0.15s ease;
}

[data-md-color-scheme="slate"] .md-nav__item .md-nav__link {
    color: #d1d5db !important;
}

.md-nav__item .md-nav__link:hover {
    color: #374151 !important;
    font-weight: 500 !important;
}

[data-md-color-scheme="slate"] .md-nav__item .md-nav__link:hover {
    color: #ffffff !important;
    font-weight: 500 !important;
}

.md-nav__item .md-nav__link--active,
[data-md-color-scheme="slate"] .md-nav__item .md-nav__link--active {
    color: #d6336c !important;
    font-weight: 500 !important;
}

.md-nav__item .md-nav__link:active {
    color: #b52758 !important;
}

.md-nav__item .md-nav__link--passed,
[data-md-color-scheme="slate"] .md-nav__item .md-nav__link--passed {
    color: #d6336c !important;
}

/* TOC (On this page) */
.md-nav--secondary .md-nav__link {
    font-size: 14px !important;
}

.md-nav--secondary .md-nav__link--active {
    color: #d6336c !important;
    border-color: transparent;
}

.md-nav--secondary .md-nav__link:hover {
    color: #d6336c !important;
}

[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__link:hover {
    color: #ffffff !important;
}

/* Example boxes from docstrings */
details.example {
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    overflow: hidden;
}

[data-md-color-scheme="slate"] details.example {
    border-color: #374151 !important;
}

details.example > summary {
    background-color: #f9fafb !important;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 500;
}

.md-typeset details.example > summary:before {
    background-color: #9ca3af !important;
}

.md-typeset details.example > summary:after {
    color: #9ca3af !important;
}

[data-md-color-scheme="slate"] details.example > summary {
    background-color: #1f2937 !important;
    border-bottom-color: #374151;
}

/* Terminal macOS style for bash/shell code blocks */
.language-bash.highlight,
.language-shell.highlight,
.language-console.highlight {
    position: relative;
    padding-top: 1.6rem;
    margin-top: 0.6rem;
    background: #1e1e2e;
    border-radius: 12px;
    overflow: hidden;
}

/* Hide line numbers inside terminal blocks */
.language-bash.highlight [data-linenos]::before,
.language-shell.highlight [data-linenos]::before,
.language-console.highlight [data-linenos]::before {
    display: none;
}

.language-bash.highlight::before,
.language-shell.highlight::before,
.language-console.highlight::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.4rem;
    background: #2d2d3d;
    border-bottom: 1px solid #3d3d4d;
}

.language-bash.highlight::after,
.language-shell.highlight::after,
.language-console.highlight::after {
    content: "";
    position: absolute;
    top: 0.4rem;
    left: 0.75rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff5f57;
    box-shadow: 14px 0 0 #febc2e, 28px 0 0 #28c840;
}

.language-bash.highlight > pre,
.language-shell.highlight > pre,
.language-console.highlight > pre {
    background: #1e1e2e;
    margin: 0;
    padding: 0.7rem 1rem 0.7rem 0;
}

.language-bash.highlight > pre > code,
.language-shell.highlight > pre > code,
.language-console.highlight > pre > code {
    background: #1e1e2e;
    color: #cdd6f4;
}

/* Dark mode terminal — only override what differs from light */
[data-md-color-scheme="slate"] .language-bash.highlight,
[data-md-color-scheme="slate"] .language-shell.highlight,
[data-md-color-scheme="slate"] .language-console.highlight {
    background: #1a1a2e;
}

[data-md-color-scheme="slate"] .language-bash.highlight::before,
[data-md-color-scheme="slate"] .language-shell.highlight::before,
[data-md-color-scheme="slate"] .language-console.highlight::before {
    background: #252538;
    border-bottom-color: #333348;
}

/* Copy button */
.md-code__nav {
    background-color: transparent !important;
    padding: 0.3rem !important;
}

.md-code__button {
    width: 1.2em !important;
    height: 1.2em !important;
    color: #9ca3af !important;
}

.md-code__button:hover,
.md-code__button.focus-visible {
    color: #d6336c !important;
}

/* Copy button inside terminal blocks */
.language-bash.highlight .md-code__button,
.language-shell.highlight .md-code__button,
.language-console.highlight .md-code__button {
    color: #6b7280 !important;
}

.language-bash.highlight .md-code__button:hover,
.language-shell.highlight .md-code__button:hover,
.language-console.highlight .md-code__button:hover {
    color: #cdd6f4 !important;
}

/* Tables */
.md-typeset table:not([class]) {
    border-collapse: collapse;
    font-size: 14px;
    border: 1px solid #e5e7eb;
}

.md-typeset table:not([class]) th {
    background-color: #f3f4f6;
    color: #111827;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: center;
}

.md-typeset table:not([class]) th:last-child {
    border-right: none;
}

.md-typeset table:not([class]) td {
    padding: 0.4rem 12px;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    vertical-align: top;
    color: #374151;
}

.md-typeset table:not([class]) td:last-child {
    border-right: none;
}

.md-typeset table:not([class]) tr:last-child td {
    border-bottom: none;
}

.md-typeset table:not([class]) tbody tr:nth-child(odd) {
    background-color: #f9fafb;
}

/* Remove default hover */
.md-typeset table:not([class]) tbody tr:hover {
    background-color: transparent !important;
    box-shadow: none !important;
}

.md-typeset table:not([class]) tbody tr:nth-child(odd):hover {
    background-color: #f9fafb !important;
}

/* Dark mode */
[data-md-color-scheme="slate"] .md-typeset table:not([class]) {
    border-color: #374151;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
    background-color: #1f2937;
    color: #f9fafb;
    border-bottom-color: #374151;
    border-right-color: #374151;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) td {
    border-bottom-color: #374151;
    border-right-color: #374151;
    color: #d1d5db;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tbody tr:nth-child(odd) {
    background-color: #1f2937;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tbody tr:hover {
    background-color: transparent !important;
    box-shadow: none !important;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tbody tr:nth-child(odd):hover {
    background-color: #1f2937 !important;
}
