html {
    font-family: sans-serif;
}

html,
body {
    height: 100%;
}

:root {
    --heading-color: #000000;
    --body-text-color: #202122;
    --body-link-color: #36c;
    --blockquote-text-color: #78888e;

    --contents-heading-color: #202122;

    --code-bg-color: #f3f6fa;
    --code-text-color: #567482;
    --code-filename-bg-color: #e3e7eb;

    --border-color: #dce6f0;
    --table-border-color: #e9ebec;
    --hr-border-color: #eff0f1;
}

/* Small Screen */
@media (max-width: 1000px) {
    body.noscroll {
        overflow: hidden;
    }

    .page-header {
        position: sticky;
        /* height: 60px; */
        top: 0;
        left: 0;
        right: 0;
        background-color: white;
        z-index: 1;
    }

    .sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: white;
        padding-left: 25px;
        z-index: 1;
        overflow-y: auto;
    }

    .sidebar.hidden {
        display: none;
    }

    .main-content h1,
    .main-content h2 {
        scroll-margin-top: 5rem;
    }
}

/* Large Screen */
@media (min-width: 1000px) {
    .page-wrapper {
        max-width: 1300px;
        margin: auto;
    }

    .content-wrapper {
        display: flex;
        gap: 10px;
    }

    .sidebar {
        display: block;
        flex: 1;
        position: sticky;
        top: 0;
        max-height: 100vh;
        overflow-y: auto;
    }

    .main-content {
        flex: 3;
        min-width: 0;
    }

    .hamburger {
        display: none;
    }
}

.page-header {
    display: flex;
    justify-content: left;
    align-items: center;
    border-bottom: solid 1px var(--border-color);
}

.content-wrapper {
    font-size: 1.2rem;
}

.navigation {
    display: flex;
    flex-grow: 1;
    gap: 1rem;
    justify-content: right;
    list-style-type: none;
    font-size: 1.2rem;
}

.main-content {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    color: var(--body-text-color);
}

.main-content h1,
.main-content h2,
.main-content h3 {
    color: var(--heading-color);
}

.page-footer {
    display: flex;
    justify-content: right;
    padding: 20px 0;
    border-top: solid 1px var(--border-color);
    gap: 1rem;
    font-size: 1.2rem;
}

code,
pre {
    font-family: monospace, monospace;
}

code {
    color: var(--code-text-color);
    background-color: var(--code-bg-color);
    border-radius: 0.3rem;
    padding: 1px 4px;
}

pre {
    background-color: var(--code-bg-color);
    border: solid 1px var(--border-color);
    border-radius: 0.3rem;
    padding: 10px;
    overflow: auto;

    >code {
        padding: 0;
        border: 0;
    }
}

.codeblock-with-filename>p {
    margin: 0;
    background-color: var(--code-filename-bg-color);
    border-top: solid 1px var(--border-color);
    border-left: solid 1px var(--border-color);
    border-right: solid 1px var(--border-color);
    border-top-left-radius: 0.3rem;
    border-top-right-radius: 0.3rem;
    padding: 10px;
}

.codeblock-with-filename pre {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    ;
    margin-top: 0;
}

blockquote {
    padding: 0 1rem;
    margin-left: 0;
    color: var(--blockquote-text-color);
    border-left: 0.3rem solid var(--border-color);
}

.table-wrapper {
    overflow: auto;
}

table {
    display: block;
    max-width: 100%;
    margin: auto;
    overflow: auto;
    word-break: normal;
    border-collapse: collapse;
    border-spacing: 0;

    th {
        font-weight: bold;
    }

    th,
    td {
        padding: 0.5rem 1rem;
        border: 1px solid var(--table-border-color);
    }
}

.posts-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: auto;
    max-width: fit-content;
    font-size: 1.2rem;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.posts-heading {
    max-width: fit-content;
    padding-left: 1rem;
    margin: 0;
}

table.posts-table {
    display: block;
    border: none;
}

td.post-title {
    border: none;
}

.post-date {
    color: var(--body-text-color);
}

td.post-date {
    border: none;
    text-align: right;
}

details summary {
    cursor: pointer;
}

details summary>* {
    display: inline;
}

.details-content {
    border: solid 1px var(--border-color);
    border-radius: 0.3rem;
    padding: 0px 10px;
    background-color: var(--code-bg-color);
}

mjx-container[display="true"] {
    max-width: 100%;
    min-width: 0 ! important;
    overflow-x: auto;
    overflow-y: hidden;
}

.main-content img {
    display: block;
    margin: auto;
    max-width: 100%;
}

.main-content figcaption {
    text-align: center;
}

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

a:hover {
    text-decoration: underline;
}

/* Table of Contents */
.sidebar h2 {
    color: var(--contents-heading-color);
}

.primary-contents-list,
.secondary-contents-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style-type: none;
}

.primary-contents-list {
    padding-left: 0;
}

.secondary-contents-list {
    padding-top: 10px;
    padding-left: 15px;
}

li.toc-primary-active>a {
    color: var(--contents-heading-color);
}

li.toc-active>a {
    font-weight: bold;
    color: var(--contents-heading-color);
}

.about-wrapper {
    max-width: 1000px;
    margin: auto;
    font-size: 1.2rem;
}