/* =========================================
   Academic Pages — Static HTML Theme
   Based on academicpages.github.io
   ========================================= */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --masthead-height: 64px;
    --sidebar-width: 260px;
    --primary: #3d85c6;
    --primary-dark: #2b6399;
    --text: #333;
    --text-muted: #6b7280;
    --bg: #fff;
    --bg-alt: #f3f5f9;
    --border: #e5e7eb;
    --link: #3d85c6;
    --link-hover: #2b6399;
    --badge-spotlight: #d97706;
    --badge-oral: #059669;
    --badge-award: #dc2626;
    --font-sans: 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Noto Serif', Georgia, serif;
    --max-width: 1280px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color .2s;
}
a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

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

/* ---------- Masthead ---------- */
.masthead {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--masthead-height);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.masthead__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    padding: 0 1.5rem;
}

.masthead__menu {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 2rem;
}

.site-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.site-title:hover {
    color: var(--primary);
    text-decoration: none;
}

.visible-links {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    margin-left: auto;
}

.visible-links a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    border-radius: 4px;
    transition: background .2s, color .2s;
}
.visible-links a:hover,
.visible-links a.active {
    background: var(--bg-alt);
    color: var(--primary);
    text-decoration: none;
}

.navicon-button {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text);
    margin-left: auto;
    padding: 0.5rem;
}

.mobile-nav {
    display: none;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem;
}
.mobile-nav.open {
    display: flex;
}
.mobile-nav a {
    padding: 0.75rem 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
.mobile-nav a:last-child {
    border-bottom: none;
}
.mobile-nav a:hover {
    color: var(--primary);
    text-decoration: none;
}

/* ---------- Layout ---------- */
#main {
    display: flex;
    max-width: var(--max-width);
    margin: calc(var(--masthead-height) + 2rem) auto 2rem;
    padding: 0 1.5rem;
    gap: 2.5rem;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--masthead-height) + 2rem);
    align-self: flex-start;
}

.author-profile {
    text-align: center;
}

.author__avatar img {
    display: block;
    margin: 0 auto 1rem;
    width: 175px;
    height: 175px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.author__name {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.author__pronouns {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    font-style: italic;
}

.author__bio {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.author__urls {
    text-align: left;
}

.social-icons {
    list-style: none;
}

.author__urls .social-icons li {
    font-size: 0.85rem;
    padding: 0.3rem 0;
    color: var(--text-muted);
}

.author__urls .social-icons a {
    color: var(--text-muted);
}
.author__urls .social-icons a:hover {
    color: var(--primary);
    text-decoration: none;
}

.icon-pad-right {
    margin-right: 0.5rem;
    width: 1.25em;
    text-align: center;
}

/* ---------- Page Content ---------- */
.page {
    flex: 1;
    min-width: 0;
}

.page__inner-wrap {
    max-width: 48rem;
}

.page__title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.page__content {
    font-size: 1rem;
    line-height: 1.75;
}

.page__content p {
    margin-bottom: 1rem;
}

.page__content h2 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.page__content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

.page__content ul,
.page__content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.page__content li {
    margin-bottom: 0.5rem;
}

.page__content strong {
    font-weight: 600;
}

/* News list */
.news-list {
    list-style: none;
    padding-left: 0;
}
.news-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.news-list li:last-child {
    border-bottom: none;
}
.news-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-right: 0.3rem;
}

/* Publication highlights */
.pub-highlights {
    list-style: none;
    padding-left: 0;
}
.pub-highlights li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.pub-highlights li:last-child {
    border-bottom: none;
}
.pub-authors {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.pub-venue {
    font-size: 0.9rem;
}
.pub-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fff;
    margin-left: 0.5rem;
    vertical-align: middle;
}
.pub-badge.spotlight { background: var(--badge-spotlight); }
.pub-badge.oral { background: var(--badge-oral); }
.pub-badge.award { background: var(--badge-award); }

/* ---------- Archive Layout ---------- */
.archive__items {
    list-style: none;
    padding: 0;
}

.archive__item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}
.archive__item:last-child {
    border-bottom: none;
}

.archive__item-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.archive__item-title a {
    color: var(--text);
}
.archive__item-title a:hover {
    color: var(--primary);
    text-decoration: none;
}

.archive__item-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.archive__item-meta i {
    width: 1em;
    text-align: center;
    margin-right: 0.25rem;
}

.archive__item-excerpt {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.archive__item-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.3rem 0.65rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background .2s, color .2s;
}
.btn--primary {
    background: var(--primary);
    color: #fff;
}
.btn--primary:hover {
    background: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}
.btn--outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn--outline:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

/* Highlights — inline pills */
.highlights-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1rem 0 1.5rem;
}

.hi-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text);
}

.hi-pill i {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Experience details list */
.experience-details {
    font-size: 0.9rem;
    padding-left: 1.25rem;
    margin: 0.5rem 0;
    color: var(--text);
}

.experience-details li {
    margin-bottom: 0.4rem;
}

/* Year group */
.archive-year {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--primary);
    color: var(--text);
}
.archive-year:first-of-type {
    margin-top: 0;
}

/* ---------- CV Layout ---------- */
.cv-section {
    margin-bottom: 2rem;
}

.cv-section h2 {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.cv-entry {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}
.cv-entry:last-child {
    border-bottom: none;
}

.cv-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 100px;
    padding-top: 0.1rem;
}

.cv-details h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.cv-details .cv-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.cv-details p,
.cv-details ul {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.cv-details ul {
    padding-left: 1.25rem;
}

.cv-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cv-skill-tag {
    display: inline-block;
    background: var(--bg-alt);
    color: var(--text);
    font-size: 0.82rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.cv-download {
    margin-bottom: 2rem;
}

/* ---------- Footer ---------- */
.page__footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    margin-top: 3rem;
}

.page__footer-follow {
    max-width: var(--max-width);
    margin: 0 auto 1rem;
}

.page__footer-follow .social-icons {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.85rem;
}
.page__footer-follow .social-icons a {
    color: var(--text-muted);
}
.page__footer-follow .social-icons a:hover {
    color: var(--primary);
    text-decoration: none;
}
.page__footer-follow .social-icons li {
    list-style: none;
}

.page__footer-copyright {
    max-width: var(--max-width);
    margin: 0 auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    .author__avatar img {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 768px) {
    .visible-links {
        display: none;
    }
    .navicon-button {
        display: block;
    }

    #main {
        flex-direction: column;
        margin-top: calc(var(--masthead-height) + 1rem);
    }

    .sidebar {
        width: 100%;
        position: static;
    }

    .author-profile {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 1.25rem;
        text-align: left;
    }

    .author__avatar img {
        width: 100px;
        height: 100px;
    }

    .author__content {
        flex: 1;
        min-width: 200px;
    }

    .author__urls {
        width: 100%;
    }

    .author__urls .social-icons {
        display: flex;
        flex-wrap: wrap;
        gap: 0 1.5rem;
    }

    .page__title {
        font-size: 1.6rem;
    }

    .cv-entry {
        flex-direction: column;
        gap: 0.25rem;
    }
    .cv-date {
        min-width: auto;
    }

    .archive__item-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}
