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

:root {
    --text-color: #333;
    --link-color: #0066cc;
    --link-hover: #004499;
    --bg-color: #fff;
    --border-color: #e0e0e0;
    --light-gray: #f5f5f5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 17px;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.banner {
    width: 67%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-bottom: 1px solid #000;
}

.site-title {
    padding: 1.5rem 0 0.5rem;
}

.site-title h1 {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.site-title h1 a {
    color: var(--text-color);
}

.site-title h1 a:hover {
    text-decoration: none;
}

.tagline {
    font-style: italic;
    color: #666;
    font-size: 0.95rem;
}

/* Navigation */
nav {
    padding: 1rem 0;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    font-size: 1rem;
    color: var(--text-color);
    padding: 0.25rem 0;
}

nav a:hover {
    color: var(--link-color);
    text-decoration: none;
}

nav a.active {
    border-bottom: 2px solid var(--link-color);
}

/* Main Content with Sidebar */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3rem;
    align-items: start;
}

.main-content {
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar h2 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.sidebar li {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.sidebar .special-collab {
    font-style: italic;
    color: #666;
}

/* Main Content */
main {
    padding: 1rem 0 3rem;
}

h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

h2:first-child {
    margin-top: 0;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

p {
    margin-bottom: 1rem;
}

/* Lists */
ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Publications */
.publication {
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--border-color);
}

.publication-title {
    font-weight: 500;
}

.publication-authors {
    font-size: 0.95rem;
    color: #555;
}

.publication-venue {
    font-size: 0.9rem;
    color: #777;
    font-style: italic;
}

.publication details {
    margin-top: 0.5rem;
}

.publication summary {
    font-size: 0.9rem;
    color: var(--link-color);
    cursor: pointer;
    user-select: none;
}

.publication summary:hover {
    color: var(--link-hover);
}

.publication .description {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

/* Collaborators (old inline style, kept for other pages) */
.collaborators-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    list-style: none;
    padding-left: 0;
}

.collaborators-list li {
    margin-bottom: 0.25rem;
}

/* Blog Styles */
.blog-post-preview {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.blog-post-preview:last-child {
    border-bottom: none;
}

.post-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.post-title a {
    color: var(--text-color);
}

.post-title a:hover {
    color: var(--link-color);
}

.post-date {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 0.75rem;
}

.post-excerpt {
    color: #555;
}

/* Individual Blog Post */
article.blog-post {
    max-width: 100%;
}

article.blog-post h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

article.blog-post .post-date {
    margin-bottom: 2rem;
}

article.blog-post h2 {
    font-size: 1.3rem;
    margin-top: 2rem;
}

article.blog-post h3 {
    font-size: 1.1rem;
}

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

article.blog-post pre {
    background: var(--light-gray);
    padding: 1rem;
    overflow-x: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

article.blog-post code {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 0.9rem;
}

article.blog-post blockquote {
    border-left: 3px solid var(--border-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: #555;
    font-style: italic;
}

/* Math (for MathJax/KaTeX) */
.math-display {
    overflow-x: auto;
    margin: 1rem 0;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 2rem;
    color: #777;
    font-size: 0.9rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem 2rem;
        padding-top: 2rem;
        border-top: 1px solid var(--border-color);
        margin-top: 2rem;
    }

    .sidebar h2 {
        grid-column: span 2;
        margin-bottom: 0.5rem;
    }

    .sidebar h2:nth-of-type(2) {
        grid-column: span 2;
        margin-top: 1rem;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    .container, .container-narrow {
        padding: 0 15px;
    }

    nav ul {
        gap: 1.25rem;
    }

    .site-title h1 {
        font-size: 1.6rem;
    }

    article.blog-post h1 {
        font-size: 1.5rem;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar h2,
    .sidebar h2:nth-of-type(2) {
        grid-column: span 1;
    }

}
