/* Colors and sizes follow the dark mode markdown preview of Visual Studio Code. */
:root {
    color-scheme: dark;
    --success: #89d185;
    --scroll-thumb:rgba(121, 121, 121, 0.4);
    --scroll-thumb-hover: rgba(121, 121, 121, 0.7);
    --bg: #121314;
    --bar-bg: #121314;
    --bar-border: #494949;
    --text: #bbbebf;
    --link: #48a0c7;
    --code: #d7ba7d;
    --pre-code: #d4d4d4;
    --pre-bg: rgba(10, 10, 10, 0.4);
    --line: rgba(255, 255, 255, 0.18);
    --line-strong: rgba(255, 255, 255, 0.69);
    --dashed: #494949;
    --quote-bg: rgba(127, 127, 127, 0.1);
    --quote-border: rgba(0, 122, 204, 0.5);
    --button-bg: #0e639c;
    --button-hover: #1177bb;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", system-ui, "Ubuntu", "Droid Sans", sans-serif;
    font-size: 14px;
    line-height: 22px;
    word-wrap: break-word;
}

/* Top bar with the GitHub button */
.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 6px 16px;
    background: var(--bar-bg);
    border-bottom: 1px solid var(--bar-border);
}

.github-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px;
    background: var(--button-bg);
    color: #ffffff;
    border-radius: 2px;
    font-size: 13px;
    line-height: 20px;
    text-decoration: none;
}

.github-button:hover {
    background: var(--button-hover);
    color: #ffffff;
    text-decoration: none;
}

.github-button:focus-visible,
a:focus-visible {
    outline: 1px solid #007fd4;
    outline-offset: 1px;
}

/* Content */
.content {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 26px 60px;
}

a {
    color: var(--link);
    text-decoration: none;
}

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

/* Headings: dashed lines from resources/styles/style.css */
h1, h2, h3, h4, h5, h6 {
    border-bottom: 1px dashed var(--dashed);
    width: 100%;
    display: block;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 16px;
    padding-bottom: 0.3em;
    line-height: 1.25;
}

h1 { font-size: 2em; margin-top: 0; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.25em; }
h4 { font-size: 1em; }
h5 { font-size: 0.875em; }
h6 { font-size: 0.85em; }

p, ul, ol, blockquote, pre, table {
    margin-top: 0;
    margin-bottom: 16px;
}

ul, ol {
    padding-left: 2em;
}

li > ul, li > ol {
    margin-bottom: 0;
}

hr {
    border: 0;
    border-bottom: 2px solid var(--line);
    margin: 24px 0;
}

img {
    max-width: 100%;
}

/* Tables: full width from resources/styles/style.css */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    border-bottom: 1px solid var(--line-strong);
}

th, td {
    padding: 5px 10px;
}

td {
    border-bottom: 1px solid var(--line);
}

tr:last-child > td {
    border-bottom: none;
}

/* Code */
code {
    font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace;
    font-size: 1em;
    color: var(--code);
}

pre {
    padding: 16px;
    overflow: auto;
    background: var(--pre-bg);
    border-radius: 3px;
    line-height: 1.45;
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
}

pre::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

pre::-webkit-scrollbar-track,
pre::-webkit-scrollbar-corner {
    background: transparent;
}

pre::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 5px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-thumb-hover);
}

/* Copy button, added by the script in the default layout */
.code-block {
    position: relative;
}

.copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.copy-button svg {
    width: 16px;
    height: 16px;
}

.copy-button.copied {
    color: var(--success);
}

.code-block:hover .copy-button,
.copy-button:focus-visible {
    opacity: 1;
}

.copy-button:hover {
    background: var(--quote-bg);
    border-color: var(--line-strong);
}

@media (hover: none) {
    .copy-button {
        opacity: 1;
    }
}

pre code {
    color: var(--pre-code);
    background: none;
    padding: 0;
    white-space: pre;
}

kbd {
    padding: 1px 6px;
    border: 1px solid var(--line);
    border-bottom-color: var(--line-strong);
    border-radius: 3px;
    font-size: 0.9em;
}

blockquote {
    margin: 0 0 16px 5px;
    padding: 0 16px 0 10px;
    background: var(--quote-bg);
    border-left: 5px solid var(--quote-border);
    border-radius: 2px;
}

/* Syntax highlighting (Rouge) with the Dark+ token colors */
.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs, .highlight .cp, .highlight .cd { color: #6a9955; font-style: normal; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kc, .highlight .ow { color: #569cd6; }
.highlight .kt, .highlight .nc, .highlight .nn, .highlight .no { color: #4ec9b0; }
.highlight .nf, .highlight .fm, .highlight .nx { color: #dcdcaa; }
.highlight .na, .highlight .nb, .highlight .nv, .highlight .vi, .highlight .vg, .highlight .vc, .highlight .py { color: #9cdcfe; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .sh, .highlight .sx, .highlight .ss { color: #ce9178; }
.highlight .se, .highlight .si, .highlight .sr { color: #d7ba7d; }
.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .il { color: #b5cea8; }
.highlight .nt { color: #569cd6; }
.highlight .o, .highlight .p { color: #d4d4d4; }
.highlight .err { color: #f44747; }

@media (max-width: 600px) {
    .content {
        padding: 16px 16px 40px;
    }
}
