:root {
    font-family: "Noto Sans", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    line-height: 1.5em;
    background-color: var(--background-primary);
    color: var(--foreground-primary);
}

a {
    color: var(--link-unvisited);
    font-family: "JetBrains Mono", monospace;
    text-underline-offset: 0.35em;
    font-size: 0.9em;
}

a.headerlink {
    margin-left: 0.25em;
    color: var(--link-unvisited);
    text-decoration: none;
}

a:hover {
    background-color: var(--link-unvisited);
    color: var(--foreground-primary);
}

a:visited {
    color: var(--link-visited);
}

a:visited:hover {
    background-color: var(--link-visited);
    color: var(--foreground-primary);
}

aside.footnote {
    margin-bottom: 1em;
}

aside.footnote p {
    display: inline;
}

body {
    max-width: 800px;
    margin: 0 auto;
    padding: 1em;
}

blockquote {
    font-style: italic;
}

div.highlight {
    margin: 0;
    padding: 0.75em;
}

div.highlight pre {
    overflow-x: scroll;
}

figure {
    margin: 1em;
}

footer {
    margin: 3em 0 0 0;
    padding: 0;
}

footer p {
    text-align: center;
    margin: 0 0 0.5em 0;
    padding: 0;
}

footer pre {
    width: max-content;
    margin: 0 auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "JetBrains Mono", monospace;
    font-size: 1.1em;
    font-weight: 700;
    margin-block-start: 1em;
    margin-block-end: 0;
}

h1::before {
    content: "# ";
}

h2::before {
    content: "## ";
}

h3::before {
    content: "### ";
}

h4::before {
    content: "#### ";
}

h5::before {
    content: "##### ";
}

h6::before {
    content: "###### ";
}

.hll {
    border-right-width: 1em;
    border-right-style: solid;
    padding-right: 1em;
    border-right-color: var(--new-code);
}

img {
    max-width: 100%;
    border-width: 1px;
    border-style: solid;
}

code.literal {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9em;
    padding: 0.1em 0.2em;
    background-color: var(--background-secondary);
    color: var(--foreground-secondary);
    font-weight: 500;
}

nav {
    margin: 0;
    padding: 0;
}

nav ul {
    align-items: center;
    display: flex;
    margin: 0;
    padding: 0;
    column-gap: 1em;
}

nav ul li {
    align-items: center;
    display: inline-flex;
    height: 1.75em;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

nav ul li a {
    height: 1.25em;
    margin: 0;
    padding: 0;
}

nav ul li img {
    border: none;
    height: 1.5em;
    margin: 0;
    padding: 0;
}

.nav-right {
    margin-left: auto;
}

ol.arabic {
    margin-block-start: 0;
    padding-inline-start: 1.5em;
}

p {
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
}

p code {
    padding: 0.1em;
}

.post {
    background-color: var(--background-primary);
    display: flex;
    flex-direction: column;
}

.post h2 {
    margin-top: 0;
}

.post p {
    margin: 0.25em 0;
}

.post-tag {
    font-family: "JetBrains Mono", monospace;
}

.post-metadata {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
}

.post-tags {
    display: flex;
    gap: 0.5em;
}

.posts-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2em;
}

.posts-container a.headerlink {
    display: none;
}

.posts-container h1::before {
    content: none;
}

.posts-container h2::before {
    content: none;
}

.posts-container h3::before {
    content: none;
}

.posts-container h4::before {
    content: none;
}

.posts-container h5::before {
    content: none;
}

.posts-container h6::before {
    content: none;
}

pre {
    font-family: "JetBrains Mono", monospace;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0;
    padding: 0;
    font-size: 0.9em;
}

pre::-webkit-scrollbar {
    display: none;
}

#skip {
    position: absolute;
    top: -1000%;
    left: -1000%;
}

#skip:focus {
    top: 10px;
    left: 10px;
}

table {
    table-layout: fixed;
    margin: 0;
    padding: 0;
    border: 0;
    width: 100%;
}

tbody {
    margin: 0;
    padding: 0;
    border: 0;
}

thead {
    margin: 0;
    padding: 0;
    border: 0;
}

td {
    margin: 0;
    padding: 0.5em;
    border: 0;
    overflow-x: clip;
}

th {
    margin: 0;
    padding: 0.5em;
    border: 0;
    overflow-x: clip;
}

tr {
    margin: 0;
    padding: 0;
    border: 0;
}

/* TOC styles using <nav id="toc"> */
#toc {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 80vw;
    height: 100vh;
    padding: 1em;
    background-color: var(--background-secondary);
    border-left: 1px solid var(--border-color);
    z-index: 2000; /* Ensure it overlays everything, including headers */
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    overflow-y: auto; /* Allow independent scrolling for long TOCs */
    /* Slide from Right Transition */
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

#toc:target {
    transform: translateX(0);
}

/* Overrides to reset global 'nav' styles for the TOC vertical list */
#toc ul {
    display: block; /* Reset from inline-flex */
    margin: 0;
    padding-left: 1em;
}

#toc > ul {
    padding-left: 0;
}

#toc li {
    display: list-item; /* Reset from inline-flex */
    height: auto; /* Reset fixed height from main nav */
}

#toc a {
    height: auto; /* Reset fixed height from main nav */
}

/* TOC Header and Close button */
.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: "JetBrains Mono", monospace;
    font-weight: bold;
    margin-bottom: 1em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5em;
}

.toc-close {
    text-decoration: none;
    font-weight: bold;
    padding: 0.2em 0.5em;
}

.toc-close:hover {
    background-color: var(--link-unvisited);
    color: var(--foreground-primary);
}

.toctree-l1 {
    padding-bottom: 1em;
}

ul.simple {
    margin-block-start: 0;
    padding-inline-start: 1.5em;
}

ul li p {
    margin-top: 0.5em;
    margin-bottom: 0;
}

@media (min-width: 600px) {
    .posts-container {
        grid-template-columns: 1fr 1fr;
    }
}


