/* MantisIDE skin for the MicroPython docs (sphinx_rtd_theme). Colours only, the text is untouched. */

:root {
    --m-bg: #f1f1ee; --m-surface: #ffffff; --m-side: #e8e8e4; --m-line: #dcdcd6; --m-text: #0b0c0b; --m-text-2: #4a504b; --m-text-3: #6b716c;
    --m-brand: #12803a; --m-brand-soft: rgba(19, 128, 58, 0.1); --m-code: #f6f6f3; --m-code-line: #e4e4df;
    --m-note: #0e7490; --m-warn: #b45309; --m-danger: #b42318;
    --m-display: 'Geist', 'Segoe UI', sans-serif; --m-ui: 'Geist', -apple-system, 'Segoe UI', Roboto, sans-serif;
    --m-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
    --m-bar: 69px;
}
html[data-theme="dark"] {
    --m-bg: #000000; --m-surface: #0c0d0c; --m-side: #060706; --m-line: #222522; --m-text: #eceee9; --m-text-2: #a4aba5; --m-text-3: #7b827c;
    --m-brand: #5ee06a; --m-brand-soft: rgba(94, 224, 106, 0.12); --m-code: #0c0d0c; --m-code-line: #222522;
    --m-note: #67d4e8; --m-warn: #fbbf24; --m-danger: #ff8a80;
    color-scheme: dark;
}

/* ---------- site bar (same as the rest of MantisIDE, see css/site-bar.css) ---------- */
.site-bar {
    --sb-bg: #000000;
    --sb-capsule: rgba(12, 13, 12, 0.94);
    --sb-line: rgba(236, 239, 233, 0.18);
    --sb-edge: rgba(236, 239, 233, 0.09);
    --sb-text: #eceee9;
    --sb-text-2: #a4aba5;
    --sb-hover: rgba(236, 239, 233, 0.08);
    --sb-brand: #5ee06a;
    --sb-on-brand: #021006;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 400;
    background: var(--sb-bg);
    border-bottom: 1px solid var(--sb-edge);
    font-family: 'Geist', -apple-system, 'Segoe UI', sans-serif;
}
:root:not([data-theme='dark']) .site-bar {
    --sb-bg: #f1f1ee;
    --sb-capsule: rgba(255, 255, 255, 0.96);
    --sb-line: rgba(10, 12, 10, 0.18);
    --sb-edge: rgba(10, 12, 10, 0.1);
    --sb-text: #0b0c0b;
    --sb-text-2: #4a504b;
    --sb-hover: rgba(10, 12, 10, 0.06);
    --sb-brand: #12803a;
    --sb-on-brand: #ffffff;
}
.site-bar-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    width: min(1180px, 100% - 40px);
    height: 68px;
    margin: 0 auto;
}
.site-brand {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--sb-text);
    text-decoration: none;
    font-family: 'Doto', 'Geist Mono', monospace;
    font-weight: 800;
    font-variation-settings: 'ROND' 100;
    font-size: 22px;
    line-height: 1;
    white-space: nowrap;
}
.site-brand img { display: block; border-radius: 8px; box-shadow: 0 0 0 1px rgba(94, 224, 106, 0.25), 0 0 18px -3px rgba(94, 224, 106, 0.55); }
.site-links {
    display: flex;
    max-width: 100%;
    padding: 4px;
    border: 1px solid var(--sb-line);
    border-radius: 999px;
    background: var(--sb-capsule);
    overflow-x: auto;
    scrollbar-width: none;
}
.site-links::-webkit-scrollbar { display: none; }
.site-links a {
    padding: 7px 15px;
    border-radius: 999px;
    color: var(--sb-text-2);
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}
.site-links a:hover { color: var(--sb-text); background: var(--sb-hover); }
.site-links a[aria-current] { color: var(--sb-on-brand); background: var(--sb-brand); }
.site-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.site-theme {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--sb-line);
    border-radius: 999px;
    background: transparent;
    color: var(--sb-text-2);
    cursor: var(--cur-hand, pointer), pointer;
}
.site-theme:hover { color: var(--sb-text); }
.site-theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.site-cta {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--sb-brand);
    color: var(--sb-on-brand);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.site-bar :focus-visible { outline: 2px solid var(--sb-brand); outline-offset: 3px; }
@media (max-width: 1100px) {
    .site-bar-inner { grid-template-columns: auto minmax(0, 1fr) auto; }
    .site-links { justify-self: center; }
}
@media (max-width: 760px) {
    .site-bar-inner { gap: 10px; width: calc(100% - 24px); }
    .site-brand span, .site-cta { display: none; }
}

.wy-nav-side { top: var(--m-bar); }
.wy-nav-content-wrap { margin-top: var(--m-bar); }
.wy-nav-top { top: 0; }
@media (max-width: 768px) { .wy-nav-content-wrap { margin-top: var(--m-bar); }  }

/* inside the Full IDE panel: no site bar */
html.is-embedded .site-bar { display: none; }
html.is-embedded .wy-nav-side { top: 0; }
html.is-embedded .wy-nav-content-wrap { margin-top: 0; }

/* ---------- page ---------- */
body, .wy-body-for-nav { background: var(--m-bg); color: var(--m-text); font-family: var(--m-ui); }
.wy-nav-content-wrap { background: var(--m-bg); }
.wy-nav-content { background: var(--m-surface); max-width: 920px; color: var(--m-text); }
.rst-content { color: var(--m-text); font-size: 16px; line-height: 1.65; }
.rst-content p, .rst-content li, .rst-content dd { color: var(--m-text); }
h1, h2, h3, h4, h5, .rst-content .toctree-wrapper > p.caption { font-family: var(--m-display); color: var(--m-text); letter-spacing: -0.02em; }
.rst-content h1 { font-size: 34px; font-weight: 800; }
.rst-content h2 { font-size: 25px; font-weight: 700; padding-top: 6px; border-top: 1px solid var(--m-line); }
.rst-content h3 { font-size: 20px; font-weight: 700; }
a, a:visited { color: var(--m-brand); }
a:hover { color: var(--m-brand); text-decoration: underline; }
hr { border-top-color: var(--m-line); }
.headerlink { color: var(--m-text-3) !important; }

/* sidebar */
.wy-nav-side { background: var(--m-side); border-right: 1px solid var(--m-line); }
.wy-side-nav-search { background: var(--m-side); border-bottom: 1px solid var(--m-line); }
.wy-side-nav-search > a, .wy-side-nav-search .wy-dropdown > a { color: var(--m-text); font-family: var(--m-display); font-weight: 700; }
.wy-side-nav-search > div.version { color: var(--m-text-3); }
.wy-side-nav-search input[type=text] { border: 1px solid var(--m-line); border-radius: 10px; background: var(--m-surface); color: var(--m-text); box-shadow: none; padding: 8px 12px; font-family: var(--m-ui); }
.wy-side-nav-search input[type=text]:focus { border-color: var(--m-brand); outline: none; }
.wy-menu-vertical p.caption { color: var(--m-brand); font-family: var(--m-ui); letter-spacing: 0; text-transform: none; font-size: 13px; }
.wy-menu-vertical a { color: var(--m-text-2); font-family: var(--m-ui); }
.wy-menu-vertical a:hover { background: var(--m-brand-soft); color: var(--m-text); }
.wy-menu-vertical li.current { background: var(--m-surface); }
.wy-menu-vertical li.current > a, .wy-menu-vertical li.on a { background: var(--m-surface); color: var(--m-text); font-weight: 600; border: 0; }
.wy-menu-vertical li.toctree-l1.current > a { border-left: 3px solid var(--m-brand); }
.wy-menu-vertical li.current a { border-right: 0; color: var(--m-text-2); }
.wy-menu-vertical li.toctree-l2 a, .wy-menu-vertical li.toctree-l3 a, .wy-menu-vertical li.toctree-l4 a { background: transparent !important; }
.wy-menu-vertical li.current a:hover { background: var(--m-brand-soft) !important; }
.wy-menu-vertical a button.toctree-expand, .wy-menu-vertical li.current > a button.toctree-expand { color: var(--m-text-3); }
.wy-nav-top { background: var(--m-surface); border-bottom: 1px solid var(--m-line); }
.wy-nav-top a { color: var(--m-text); font-family: var(--m-display); }
.wy-nav-top i { color: var(--m-brand); }
.rst-versions { display: none; } /* version picker points at docs.micropython.org; the banner links there instead */

/* breadcrumbs, prev/next, footer */
.wy-breadcrumbs li, .wy-breadcrumbs a { color: var(--m-text-3); }
.rst-footer-buttons .btn { background: var(--m-surface) !important; border: 1px solid var(--m-line) !important; color: var(--m-text) !important; border-radius: 10px; box-shadow: none; font-family: var(--m-ui); }
.rst-footer-buttons .btn:hover { border-color: var(--m-brand) !important; }
footer { color: var(--m-text-3); }
footer hr { border-color: var(--m-line); }

/* code */
code, .rst-content code, .rst-content tt, .rst-content code.literal {
    font-family: var(--m-mono); background: var(--m-code); border: 1px solid var(--m-code-line); color: var(--m-text); border-radius: 6px; padding: 1px 5px; font-size: 0.86em;
}
.rst-content code.xref, .rst-content a code { color: var(--m-brand); }
.rst-content div[class^=highlight], .rst-content pre.literal-block { background: var(--m-code); border: 1px solid var(--m-code-line); border-radius: 12px; }
.rst-content div[class^=highlight] pre, .rst-content pre.literal-block { font-family: var(--m-mono); font-size: 13.5px; line-height: 1.6; color: var(--m-text); background: transparent; }
.highlight { background: transparent !important; }
.highlight .k, .highlight .kn, .highlight .kd, .highlight .kc, .highlight .ow { color: #7c3aed; font-weight: 500; }
.highlight .nf, .highlight .nc { color: #0f6e33; font-weight: 600; }
.highlight .nb, .highlight .bp { color: #0e7490; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sd, .highlight .sa { color: #b45309; }
.highlight .mi, .highlight .mf, .highlight .mh { color: #c2410c; }
.highlight .c, .highlight .c1, .highlight .cm { color: #84958a; font-style: italic; }
.highlight .o { color: var(--m-text-2); }
.highlight .gp { color: var(--m-brand); font-weight: 600; }
.highlight .go { color: var(--m-text-2); }
html[data-theme="dark"] .highlight .k, html[data-theme="dark"] .highlight .kn, html[data-theme="dark"] .highlight .kd, html[data-theme="dark"] .highlight .kc, html[data-theme="dark"] .highlight .ow { color: #c792ea; }
html[data-theme="dark"] .highlight .nf, html[data-theme="dark"] .highlight .nc { color: #8ff08a; }
html[data-theme="dark"] .highlight .nb, html[data-theme="dark"] .highlight .bp { color: #67d4e8; }
html[data-theme="dark"] .highlight .s, html[data-theme="dark"] .highlight .s1, html[data-theme="dark"] .highlight .s2, html[data-theme="dark"] .highlight .sd, html[data-theme="dark"] .highlight .sa { color: #f2c97d; }
html[data-theme="dark"] .highlight .mi, html[data-theme="dark"] .highlight .mf, html[data-theme="dark"] .highlight .mh { color: #f78c6c; }
html[data-theme="dark"] .highlight .c, html[data-theme="dark"] .highlight .c1, html[data-theme="dark"] .highlight .cm { color: #5f7d68; }

/* API entries (class / function / method headings) */
.rst-content dl:not(.docutils) dt, html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt {
    background: var(--m-brand-soft); color: var(--m-text); border-top: 3px solid var(--m-brand); border-radius: 0 0 8px 8px; font-family: var(--m-mono); font-size: 14px;
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.field-list) > dt {
    background: transparent; border-top: 0; border-left: 3px solid var(--m-line); border-radius: 0;
}
.rst-content dl .sig-name, .rst-content .sig-name.descname { color: var(--m-text); }
.rst-content dl .sig-prename { color: var(--m-text-2); }
.rst-content dl em.property, .rst-content .sig-paren { color: var(--m-text-3); }

/* notes and warnings */
.rst-content .admonition, .rst-content .note, .rst-content .warning, .rst-content .important, .rst-content .tip, .rst-content .hint, .rst-content .caution, .rst-content .danger, .rst-content .attention, .rst-content .seealso {
    background: var(--m-surface); border: 1px solid var(--m-line); border-left: 4px solid var(--m-note); border-radius: 10px; color: var(--m-text);
}
.rst-content .admonition-title { background: transparent !important; color: var(--m-note) !important; font-family: var(--m-ui); font-weight: 700; padding-left: 0 !important; }
.rst-content .warning, .rst-content .caution, .rst-content .attention, .rst-content .important { border-left-color: var(--m-warn); }
.rst-content .warning .admonition-title, .rst-content .caution .admonition-title, .rst-content .attention .admonition-title, .rst-content .important .admonition-title { color: var(--m-warn) !important; }
.rst-content .danger { border-left-color: var(--m-danger); }
.rst-content .danger .admonition-title { color: var(--m-danger) !important; }
.wy-alert, .wy-alert.wy-alert-danger { background: var(--m-surface); border: 1px solid var(--m-line); border-left: 4px solid var(--m-warn); border-radius: 10px; color: var(--m-text); }
.wy-alert-title, .wy-alert.wy-alert-danger .wy-alert-title { background: transparent; color: var(--m-warn); }

/* tables */
.rst-content table.docutils, .wy-table-bordered-all { border: 1px solid var(--m-line); }
.rst-content table.docutils td, .rst-content table.docutils th { border-color: var(--m-line) !important; color: var(--m-text); background: transparent !important; }
.rst-content table.docutils thead th { background: var(--m-brand-soft) !important; }
.rst-content table.docutils tr:nth-child(2n-1) td { background: color-mix(in srgb, var(--m-surface) 70%, var(--m-bg)) !important; }

/* search results */
#search-results .search li { border-color: var(--m-line); }
#search-results .context { color: var(--m-text-2); }
.highlighted { background: var(--m-brand-soft); color: var(--m-text); }

/* our banners */
.mantis-version { margin: 0 0 18px; padding: 10px 14px; border: 1px solid var(--m-line); border-left: 4px solid var(--m-brand); border-radius: 10px; font-size: 14px; color: var(--m-text-2); background: var(--m-surface); }
.mantis-version strong { color: var(--m-text); }
.mantis-version a { margin-left: 6px; }
.mantis-credit { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--m-line); font-size: 13px; color: var(--m-text-3); line-height: 1.55; }
.mantis-credit p { color: var(--m-text-3); }

/* the credit now sits at the end of the page text */
.rst-content .mantis-credit { margin-top: 32px; /* moved under the text by a script in layout.html */ padding-top: 16px; border-top: 1px solid var(--m-line); }
