/* Classic academic theme, shared by every page */

:root {
    --text: #222;
    --muted: #666;
    --accent: #1f3a68;
    --accent-hover: #2f5596;
    --rule: #e5e5e5;
    --bg: #fff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.65;
}

a {
    color: var(--accent);
}

a:hover {
    color: var(--accent-hover);
}

/* Header: name on the left, menu on the right */
.site-header {
    border-bottom: 1px solid var(--rule);
}

.site-header .inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 22px 24px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px 24px;
}

.site-name {
    font-size: 24px;
    color: var(--text);
    text-decoration: none;
}

.site-name:hover {
    color: var(--text);
}

.site-nav a {
    margin-left: 22px;
    font-size: 17px;
    text-decoration: none;
}

.site-nav a:first-child {
    margin-left: 0;
}

.site-nav a:hover,
.site-nav a.active {
    text-decoration: underline;
    text-underline-offset: 5px;
}

/* Page content */
main {
    max-width: 860px;
    margin: 0 auto;
    padding: 36px 24px 60px;
}

h1 {
    font-size: 30px;
    font-weight: normal;
    margin: 0 0 24px;
}

h2 {
    font-size: 21px;
    font-weight: normal;
    margin: 0 0 8px;
}

/* Home page */
.about {
    display: flex;
    gap: 36px;
    align-items: flex-start;
}

.about img {
    width: 240px;
    height: auto;
    border-radius: 4px;
    flex-shrink: 0;
}

.about p {
    margin-top: 0;
}

/* Research page */
.paper {
    padding-bottom: 26px;
    margin-bottom: 26px;
    border-bottom: 1px solid var(--rule);
}

.paper:last-child {
    border-bottom: none;
}

.paper .coauthors {
    color: var(--muted);
    font-style: italic;
    margin: 0 0 10px;
}

.paper .abstract {
    font-size: 16px;
    margin: 0 0 10px;
}

.paper .links {
    font-size: 16px;
}

/* Teaching page */
.teaching h2 {
    margin-top: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--rule);
}

.course {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
}

.course-term {
    color: var(--muted);
    white-space: nowrap;
}

/* CV page */
.cv-download {
    margin: 0 0 20px;
}

.cv-embed {
    width: 100%;
    height: 85vh;
    border: 1px solid var(--rule);
}

footer {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 24px 40px;
    color: var(--muted);
    font-size: 14px;
    border-top: 1px solid var(--rule);
}

/* Phones */
@media (max-width: 640px) {
    body {
        font-size: 17px;
    }

    .site-nav a {
        margin-left: 0;
        margin-right: 16px;
    }

    .about {
        flex-direction: column;
        gap: 20px;
    }

    .about img {
        width: 70%;
        max-width: 260px;
    }

    .course {
        flex-direction: column;
        gap: 0;
    }

    .cv-embed {
        height: 70vh;
    }
}

/* Research page sections */
h2.section {
    margin: 36px 0 18px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--rule);
}

h1 + h2.section {
    margin-top: 0;
}

h3 {
    font-size: 19px;
    font-weight: normal;
    margin: 0 0 6px;
}

.paper .citation {
    font-size: 16px;
    margin: 0;
}

.paper:has(+ h2.section) {
    border-bottom: none;
    margin-bottom: 0;
}

.teaching .course + h2 {
    margin-top: 32px;
}
