body {
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    background-color: #f0f0f0;
    font-family: sans-serif;
}


article {
    background: white;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    border-radius: 10px
}

@media (max-width: 800px) {
    article {
        margin-top: initial;
        margin-bottom: initial;
    }
}

.sticky-sidebar {
    position: fixed;
    background: white;
    right: calc(50vw + 440px);
    padding: 20px;
    border-radius: 10px;
    max-width: 300px;
}

@media (max-width: 1060px) {
    .sticky-sidebar {
        display: none;
    }
}

.sticky-sidebar h3 {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.toc {
    margin: 0;
    padding: 0;
    list-style: none;
}

.toc ul {
    list-style: none;
    padding-left: 25px;
}

.toc a {
    text-decoration: none;
}

.toc a:hover {
    text-decoration: underline;
}

h1 {
    margin-top: 0;
    font-size: 2em;
}

div.yl {
    background-color: #fff3ff;
}

div.lem {
    background-color: #f3fff3;
}

div.yl, div.lem, details {
    padding: 0.5em;
    margin-bottom: 1em;
    margin-top: 1em;
    border-radius: 3px;
}

div.yl > *:first-child,
div.lem > *:first-child,
details > *:first-child,
.tab-content > *:first-child {
    margin-top: 0;
}

div.yl > *:last-child,
div.lem > *:last-child,
details > *:last-child,
.tab-content > *:last-child {
    margin-bottom: 0;
}

pre {
    overflow-x: scroll;
}

:not(pre) > code {
    font-size: 10pt;
    background-color: #f8f8f8;
}

/* not the ideal solution, on small screens and windows, inline code should still not exceed the page width */
/* it's fine on large screens where there is always enough space to put a thing in */
@media (min-width: 800px) {
    :not(pre) > code {
        white-space: nowrap;
    }
}

img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
}

.side-by-side, .side-by-side > p {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
}

.slide .side-by-side, .slide .side-by-side > p {
    flex-wrap: nowrap;
}

.side-by-side img {
    margin-left: 20px;
    margin-right: 20px;
    min-width: 0;
}

@media (max-width: 600px) {
    .side-by-side, .side-by-side > p {
        flex-direction: column;
    }

    .side-by-side img {
        margin-left: 0;
        margin-right: 0;
    }

    .slide-area {
        height: unset !important;
    }
}

.slideshow {
    display: grid;
    grid-template-columns: 45px auto 45px;
    grid-template-rows: auto;
    grid-template-areas:
    ". counter ."
    "prev slide next";
    padding-left: 25px;
    padding-right: 25px;
    row-gap: 10px;
    column-gap: 10px;
}

.slide-counter-area {
    grid-area: counter;
}

.slide-area {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-area: slide;
}

.slide {
    position: fixed;
    z-index: -2;
}

.slide.active {
    position: revert;
    z-index: revert;
    display: block;
}

/* this is so dumb but it's the only way i could get rid of these annoying flickers with slides */
.wall {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    z-index: -1;
}

.prev-area {
    grid-area: prev;
    align-items: flex-end;
    padding: 0;
}

.next-area {
    grid-area: next;
    align-items: flex-start;
    border-radius: 0 3px 3px 0;
    padding: 0;
}

.prev-area, .next-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: none;
}

.prev, .next {
    background-color: rgba(0, 0, 0, 0.15);
    cursor: pointer;
    font-weight: bold;
    font-size: 24px;
    color: white;
    padding: 0.5em 0.8em;
    border: none;
}

.prev {
    border-radius: 3px 0 0 3px;
}

.next {
    border-radius: 0 3px 3px 0
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

@media (max-width: 600px) {
    .slideshow {
        grid-template-columns: auto 4em auto;
        grid-template-areas:
        "slide slide slide"
        "prev counter next";
        padding-left: 0;
        padding-right: 0;
    }

    .slide-counter-area {
        display: flex;
        justify-content: center;
        align-items: center;
        white-space: nowrap;
    }

    .prev-area, .next-area {
        align-items: stretch;
    }
}

table, td, th {
    border: 1px solid black;
}

table {
    border-collapse: collapse;
    margin-left: auto;
    margin-right: auto;
}

td, th {
    text-align: center;
    padding: 4px;
}

blockquote {
    margin-left: 1.5em;
    font-style: italic;
    color: #555;
}

summary {
    cursor: pointer;
}

details {
    background: aliceblue;
}

.tab-group {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
}

.tab-selector {
    display: flex;
    gap: 5px;
}

.tab-button {
    display: block;
    cursor: pointer;
    background: white;
    color: #333;
    border: none;

    font-size: 1em;
    padding: 0.4em 0.6em 0.4em 0.6em;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

.tab-button.selected, .tab-button:hover {
    color: black;
    background: #f8f8f8;
}

.tab-content {
    background: #f8f8f8;
    padding: 0.5em;
    border-radius: 0 3px 3px 3px;
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content p:first-child {
    margin-top: 0;
}

.tab-content p:last-child {
    margin-bottom: 0;
}

pre[class*="language-"],
code[class*="language-"] {
    font-size: 14px;
    text-shadow: none;
}

pre[class*="language-"] {
    background: #f8f8f8;
    margin: 1em 0;
    border-radius: 3px;
}

.language-css .token.string, .style .token.string, .token.entity, .token.operator, .token.url {
    background: none;
}

pre.language-output {
    max-height: 32em;
}

.katex {
    font-size: 1.1em;
}

.math {
    overflow-x: scroll;
}

@media (min-width: 800px) {
    .math {
        white-space: nowrap;
    }
}

.highlight {
    background-color: pink;
}
