* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Public Sans";
    font-size: 14px;
    line-height: 23.8px;
    font-weight: 300;
    color: rgb(34, 41, 57);
    background-color: #f6f2ef;
    max-width: 700px;
    margin: 0 auto;
    padding: 4rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

nav {
    margin-bottom: 3rem;
    padding-top: 1rem;
}

nav a {
    text-decoration: none;
    color: rgb(15, 18, 25);
    margin-right: 2.5rem;
    font-size: 14px;
}

nav a:first-child {
    font-weight: 600;
}

nav a:hover {
    opacity: 0.7;
}

nav a.active {
    text-decoration: underline;
    text-underline-offset: 0.4em;
}

main {
    font-size: 14px;
    flex: 1;
}

main p {
    margin-bottom: 0.75rem;
}

main ul {
    list-style: none;
    margin-top: 2rem;
}

main ul li {
    margin-bottom: 0.5rem;
}

main a {
    color: rgb(15, 18, 25);
    text-decoration: none;
}

main a:hover {
    text-decoration: underline;
}

/* About page: links in the text are always underlined */
main.about p a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.3em;
}

main.about p a:hover {
    opacity: 0.7;
}

/* List styles */
/* A list that starts the page (e.g. Misc) sits as close to the nav as text does elsewhere */
main > ul:first-child,
main > ul.contact-list:first-child {
    margin-top: 0;
}

main ul.contact-list,
main ul.writing-list {
    margin-top: 2rem;
}

main ul.contact-list li,
main ul.writing-list li {
    display: flex;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

main ul.contact-list li .dash,
main ul.writing-list li .dash {
    margin-right: 0.5rem;
    color: rgb(15, 18, 25);
}

main ul.contact-list li .label-container {
    margin-right: auto;
    display: flex;
    flex-direction: column;
}

main ul.contact-list li .label,
main ul.writing-list li a .title {
    color: rgb(15, 18, 25);
}

main ul.contact-list li .description {
    color: #888888;
    font-size: 14px;
}

main ul.contact-list li a,
main ul.writing-list li a time {
    color: #888888;
    margin-left: auto;
    white-space: nowrap;
}

/* Linked labels in the Misc list (e.g. Bookshelf) sit on the left like the plain ones */
main ul.contact-list li .label-container a.label {
    margin-left: 0;
    color: rgb(15, 18, 25);
    white-space: normal;
}

main ul.writing-list li a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    width: 100%;
    flex: 1;
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
    }
    
    /* name on the left, page links on the right, all on one row */
    nav {
        display: flex;
        align-items: baseline;
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    nav a {
        margin-right: 0;
        margin-left: 1.25rem;
    }

    nav a:first-child {
        margin-left: 0;
        margin-right: auto;
    }
}


/* Article pages (writing/ and misc/) */
.post header {
    margin-bottom: 1.75rem;
}

.post h1 {
    font-size: 20px;
    line-height: 1.3;
    font-weight: 500;
    color: rgb(15, 18, 25);
}

.post header time {
    color: #888888;
}

.post h2 {
    font-size: 15px;
    font-weight: 600;
    color: rgb(15, 18, 25);
    margin: 2rem 0 0.75rem;
}

.post h3,
.post h4 {
    font-size: 14px;
    font-weight: 600;
    color: rgb(15, 18, 25);
    margin: 1.5rem 0 0.5rem;
}

.post h4 {
    font-weight: 500;
    font-style: italic;
}

.post p {
    margin-bottom: 0.9rem;
}

main .post ul,
main .post ol {
    list-style: disc;
    margin: 0.5rem 0 1rem;
    padding-left: 1.25rem;
}

main .post ol {
    list-style: decimal;
}

.post strong {
    font-weight: 600;
}

main .post li {
    margin-bottom: 0.35rem;
}

main .post a {
    text-decoration: underline;
    text-decoration-color: rgba(15, 18, 25, 0.3);
    text-underline-offset: 0.2em;
}

main .post a:hover {
    text-decoration-color: currentColor;
}

.post sup {
    line-height: 0;
    font-size: 0.75em;
}

main .post sup a,
main .post a.fn-back {
    text-decoration: none;
}

main .post ol.footnotes {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(15, 18, 25, 0.12);
    font-size: 13px;
    color: #555555;
}

.post img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

/* Papers list (misc/papers.html) */
main .post ul.papers {
    list-style: none;
    padding-left: 0;
}

main .post ul.papers li {
    margin-bottom: 0.6rem;
}

main .post ul.papers a {
    text-decoration: none;
}

main .post ul.papers a:hover {
    text-decoration: underline;
}

/* Timeline layout for the writing page (writing-timeline.html) */
main ol.timeline {
    list-style: none;
}

ol.timeline li {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    column-gap: 0.75rem;
    align-items: baseline;
    margin-bottom: 0.6rem;
}

ol.timeline time {
    color: #888888;
    white-space: nowrap;
}

ol.timeline .entry a {
    color: rgb(15, 18, 25);
    text-decoration: none;
}

ol.timeline .entry a:hover {
    text-decoration: underline;
}

ol.timeline .entry p {
    color: #888888;
    margin: 0.1rem 0 0;
}

@media (max-width: 600px) {
    ol.timeline li {
        grid-template-columns: 4.5rem 1fr;
        column-gap: 0.75rem;
    }
}

