/* Academic homepage layout */

:root {
    --text-color: #333;
    --link-color: #219ab3;
    --link-hover: #11505d;
    --award-color: darkorange;
    --max-width: 950px;
    --thumb-width: 280px;
    --thumb-height: 130px;
    --thumb-ratio: 280 / 130;
    --gap: 10px;
    --page-padding: 1.25rem;
    --font-body: 0.9375rem;
    --font-small: 0.875rem;
    --font-h1: 1.75rem;
    --font-h2: 1.5rem;
    --font-h3: 1.2rem;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: Lora, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: var(--font-body);
    color: var(--text-color);
    background-color: #fff;
    margin: 0;
    line-height: 1.5;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover,
a:focus {
    color: var(--link-hover);
}

.page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem var(--page-padding) 2rem;
    width: 100%;
}

/* Profile header */

.profile-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.profile-photo {
    flex: 0 1 auto;
    min-width: 0;
}

.profile-photo img {
    width: 400px;
    max-width: 100%;
    height: auto;
    display: block;
}

.profile-info {
    flex: 1 1 240px;
    min-width: 0;
}

.profile-info h1 {
    font-size: clamp(1.35rem, 4.5vw, var(--font-h1));
    margin: 0 0 10px;
    font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.2;
}

.profile-info p {
    font-size: var(--font-body);
    margin: 0;
}

/* Sections */

section {
    margin-bottom: 1.5rem;
}

section > h2 {
    font-size: clamp(1.2rem, 3.5vw, var(--font-h2));
    margin: 0 0 0.25rem;
    font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.section-note {
    margin: 0 0 1rem;
    font-size: var(--font-small);
}

/* About */

.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
}

.about-text {
    flex: 1 1 300px;
    min-width: 0;
    font-size: var(--font-body);
}

.about-text p {
    margin: 0 0 1rem;
}

.about-aside {
    flex: 0 1 auto;
    min-width: 0;
    text-align: center;
    margin: 0 auto;
}

.about-aside img {
    width: 250px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.about-aside p {
    font-size: var(--font-small);
    margin: 0.5rem 0 0;
}

.internship-note {
    text-align: center;
    font-size: var(--font-body);
    margin-top: 1rem;
}

hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 1.5rem 0;
}

/* Publications */

.year-group {
    margin-bottom: 0.5rem;
}

.year-group > h3 {
    font-size: clamp(1rem, 3vw, var(--font-h3));
    margin: 1rem 0 0.75rem;
    font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.pub-entry {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
    margin-bottom: 1.25rem;
    align-items: flex-start;
}

.pub-thumb {
    flex: 0 0 var(--thumb-width);
    width: var(--thumb-width);
    max-width: var(--thumb-width);
    height: var(--thumb-height);
    min-width: 0;
    overflow: hidden;
    border-radius: 2px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pub-thumb a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.pub-thumb img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center;
    display: block;
    border-radius: 2px;
}

.pub-details {
    flex: 1 1 200px;
    min-width: 0;
    line-height: 1.45;
    font-size: var(--font-small);
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

.pub-title,
.pub-authors,
.pub-venue {
    display: block;
    margin-bottom: 0.35em;
}

.pub-venue {
    margin-bottom: 0;
}

.pub-details p {
    margin: 0;
}

.pub-award {
    color: var(--award-color);
}

.pub-venue img.award-star,
.pub-award img,
img.award-star {
    height: 1em;
    width: auto;
    max-width: none;
    vertical-align: -0.1em;
    display: inline;
}

/* Awards list */

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

.awards-list li {
    font-size: var(--font-body);
    margin: 5px 0 0;
}

.award-paper {
    font-size: var(--font-small);
    margin: 0 0 0.75rem 45px;
    font-style: italic;
}

/* Service lists */

.service-list {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0.25rem 0 1rem;
}

.service-list li {
    font-size: var(--font-body);
    margin: 0;
}

.service-heading {
    font-size: var(--font-body);
    margin: 0;
}

/* Footer */

.site-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    font-size: 0.8125rem;
}

/* Tablet */

@media (max-width: 768px) {
    :root {
        --thumb-width: 220px;
        --thumb-height: 102px;
        --page-padding: 1rem;
    }

    .pub-entry {
        gap: 0.75rem;
    }
}

/* Mobile */

@media (max-width: 640px) {
    :root {
        --thumb-width: 100%;
        --thumb-height: auto;
        --page-padding: 0.875rem;
    }

    .page {
        padding-top: 0.75rem;
        padding-bottom: 1.5rem;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }

    .profile-photo {
        width: 100%;
    }

    .profile-photo img {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .profile-info {
        width: 100%;
    }

    .about-content {
        flex-direction: column;
    }

    .about-text {
        font-size: var(--font-body);
    }

    .about-aside {
        width: 100%;
    }

    .about-aside img {
        max-width: 200px;
    }

    .internship-note {
        text-align: left;
    }

    .internship-note br {
        display: none;
    }

    .pub-entry {
        flex-direction: column;
        margin-bottom: 1.5rem;
    }

    .pub-thumb {
        flex: none;
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: var(--thumb-ratio);
        text-align: center;
    }

    .pub-thumb img {
        width: 100%;
        height: 100%;
        margin: 0;
    }

    .pub-details {
        width: 100%;
        font-size: var(--font-small);
    }

    .pub-title {
        font-size: 0.9375rem;
        line-height: 1.35;
    }

    .award-paper {
        margin-left: 0;
        padding-left: 1rem;
    }

    .service-list {
        padding-left: 1.25rem;
    }

    section {
        margin-bottom: 1.25rem;
    }

    hr {
        margin: 1rem 0;
    }
}

/* Small phones */

@media (max-width: 380px) {
    :root {
        --page-padding: 0.75rem;
    }

    .profile-info h1 {
        font-size: 1.35rem;
    }

    .profile-photo img {
        max-width: 100%;
    }
}

/* Touch devices: slightly larger tap targets for links in pub entries */

@media (hover: none) and (pointer: coarse) {
    .pub-venue a,
    .profile-info a {
        padding: 0.1em 0;
    }
}
