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

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

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    line-height: 1.65;
    color: #000;
    background-color: #fff;
}

h1, h2 {
    font-family: 'Satoshi', 'Space Grotesk', sans-serif;
    font-weight: 800;
}

nav .name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}

a {
    color: #1a1a1a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover {
    color: #555;
}

/* ===== Page Layout ===== */
.page-wrapper {
    width: 80%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 0;
}

/* ===== Navigation ===== */
nav {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 48px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

nav .name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

nav .name a {
    text-decoration: none;
    color: #1a1a1a;
}

nav .links {
    display: flex;
    gap: 6px;
    font-size: 1rem;
}

nav .links a {
    text-decoration: none;
    color: #555;
    transition: color 0.2s;
}

nav .links a:hover {
    color: #1a1a1a;
}

/* ===== Two-Column Layout ===== */
.content-wrapper {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

/* ===== Sidebar (Left Panel) ===== */
.sidebar {
    flex: 0 0 34%;
    min-width: 220px;
    position: sticky;
    top: 48px;
}

.sidebar img {
    width: 50%;
    border-radius: 4px;
    display: block;
    margin: 0 auto 30px;
}

.sidebar .bio p {
    margin-bottom: 10px;
    color: #1a1a1a;
    font-size: 0.95rem;
}

.sidebar .bio .bio-spacer {
    margin-bottom: 20px;
}

.sidebar .bio {
    text-align: left;
}

.sidebar .contact {
    font-size: 0.9rem;
    color: #333;
    margin-top: 16px;
    text-align: center;
}

.sidebar .contact a {
    color: #333;
}

.sidebar .contact a:hover {
    color: #1a1a1a;
}

.social-links {
    margin-top: 10px;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

.teaching-year {
    margin-bottom: 10px;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.teaching-entry {
    margin-bottom: 5px;
}

.teaching-entry:last-child {
    margin-bottom: 0;
}

.teaching-subsection {
    margin-top: 8px;
    margin-bottom: 2px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.teaching-course-list {
    margin: 0 0 8px 20px;
    padding: 0;
}

.teaching-course-list li {
    margin-bottom: 2px;
}

.social-links a {
    color: #555;
    text-decoration: none;
}

.social-links a:hover {
    color: #1a1a1a;
}

/* ===== Main Content (Right Panel) ===== */
.main-content {
    flex: 1;
    min-width: 0;
}

/* ===== Research Sections ===== */
.section {
    margin-bottom: 44px;
}

.section h2 {
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #000;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

/* ===== Paper Entries ===== */
.paper {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

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

.paper-title {
    font-weight: 600;
    font-size: 1.08rem;
    margin-bottom: 4px;
    line-height: 1.4;
}

.paper-meta {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.5;
}

.paper-meta a {
    color: #333;
}

.paper-meta a:hover {
    color: #1a1a1a;
}

.paper-meta em {
    font-style: italic;
}

.paper-links {
    font-size: 0.9rem;
    margin-top: 8px;
    display: flex;
    gap: 10px;
}

.paper-links a {
    color: #555;
    text-decoration: none;
}

.paper-links a:hover {
    color: #1a1a1a;
}

/* ===== Collapsible Abstracts ===== */
.paper-details {
    margin-top: 8px;
}

.paper-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
}

.paper-actions .paper-details {
    margin-top: 0;
}

.paper-actions .paper-links {
    margin-top: 0;
}

.paper-actions .paper-details[open] {
    flex: 1 0 100%;
}

.paper-details summary.paper-links {
    cursor: pointer;
    list-style: none;
    display: flex;
    gap: 10px;
    font-size: 0.95rem;
}

.paper-details summary.paper-links::-webkit-details-marker {
    display: none;
}

.paper-details summary.paper-links::marker {
    display: none;
    content: "";
}

.paper-details summary.paper-links a,
.paper-details summary.paper-links .abstract-toggle {
    color: #555;
    text-decoration: none;
}

.paper-details summary.paper-links a:hover,
.paper-details summary.paper-links .abstract-toggle:hover {
    color: #1a1a1a;
}

.paper-details[open] summary {
    margin-bottom: 8px;
}

.abstract-text {
    background: #f7f7f7;
    padding: 14px 18px;
    border-left: 3px solid #ccc;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #1a1a1a;
}

/* ===== Footer ===== */
footer {
    margin-top: 52px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.85rem;
    color: #888;
}

footer a {
    color: #888;
}

footer a:hover {
    color: #555;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .page-wrapper {
        width: 100%;
        padding: 24px 20px;
    }

    nav {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 32px;
    }

    .content-wrapper {
        flex-direction: column;
        gap: 32px;
    }

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

    .sidebar img {
        width: clamp(160px, 45vw, 240px);
    }

    .section h2 {
        font-size: 1rem;
    }
}
