@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap");

body {
    background-color: blanchedalmond;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 1.125rem;
    margin: 0 1em;
}

header {
    height: 100px;
}

.github {
    float: right;
    margin: 1em;
}

.intro, .posts, .content, .subintro {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.subintro {
    margin-bottom: 3em;
}

.post {
    display: block;
    color: inherit;
    text-decoration: none;
    margin-bottom: 1.5em;
}

.post h2 {
    margin: 0;
}

.post time {
    font-size: 0.85em;
    opacity: 0.6;
}

.post p {
    margin: 0.25em 0 0;
}


/* stay on screen while scrolling */
.back, .top {
    position: fixed;
    padding: 0.25em 0.5em;
    background-color: blanchedalmond;
}

.back {
    top: 1em;
    left: 1em;
}

.top {
    bottom: 1em;
    right: 1em;
}

.content img {
    max-width: 100%;
}

/* wide tables scroll sideways instead of stretching the page */
.content table {
    display: block;
    overflow-x: auto;
}

.content pre {
    overflow-x: auto;
    padding: 0.75em 1em;
}

.toc {
    position: fixed;
    left: 1em;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: none;
    font-size: 0.85em;
}

.toc ul {
    list-style: none;
    margin: 0;
    padding-left: 1em;
}

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

.toc a {
    display: block;
    padding: 0.2em 0;
    color: inherit;
    text-decoration: none;
    opacity: 0.5;
}

.toc a.active {
    opacity: 1;
    font-weight: bold;
}

/* no room next to the column on narrow screens */
@media (max-width: 1300px) {
    .toc {
        display: none;
    }
}

/* phones */
@media (max-width: 700px) {
    header {
        height: 60px;
    }

    h1 {
        font-size: 1.6em;
    }

    h2, .post h2 {
        font-size: 1.3em;
    }
}
