/* General Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #2980b9;
    --bg-color: #ffffff;
    --text-color: #333333;
    --light-gray: #f8f9fa;
    --border-color: #e0e0e0;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
}

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

a:hover {
    text-decoration: underline;
}

/* Navigation */
nav {
    background-color: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav .logo {
    font-size: 1.2rem;
    font-weight: bold;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

nav ul li a {
    color: white;
    font-weight: 500;
    transition: opacity 0.3s;
}

nav ul li a:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* Main Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 2rem 2rem 2rem;
}

section {
    margin-bottom: 4rem;
    scroll-margin-top: 80px; /* Invisible offset for the sticky header */
}

h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    margin-top: 0; /* Removes default spacing above the text */
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 1.5rem;
}

/* About Section */
.intro-block {
    /* We use overflow: hidden as a "clearfix" so the container wraps around the floating image properly */
    overflow: hidden; 
}

.profile-pic {
    width: 250px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    float: left;          /* This tells the image to sit on the left and let text wrap around it */
    margin: 0 2rem 1rem 0; /* This adds space to the right and bottom so text doesn't touch the image */
}

.links-bar {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    clear: both; /* Ensures the buttons drop below the floating image if the text is short */
}

.links-bar a {
    background-color: var(--light-gray);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.links-bar a:hover {
    background-color: #e2e6ea;
    text-decoration: none;
}

/* List Layout for Publications & Teaching */
.grid-list {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.grid-list:last-child {
    border-bottom: none;
}

.grid-year {
    font-weight: bold;
    color: var(--secondary-color);
}

.grid-details p {
    margin: 0 0 0.5rem 0;
}

.grid-title {
    font-weight: bold;
    font-size: 1.1rem;
}

.grid-authors {
    font-style: italic;
}

.tag {
    display: inline-block;
    background: var(--light-gray);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-right: 5px;
    color: var(--text-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .intro-block {
        flex-direction: column;
    }
    .grid-list {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    nav {
        flex-direction: column;
        gap: 1rem;
    }
}

.pronouns {
    color: var(--secondary-color);
    font-size: 1rem;
    font-style: italic;
    margin-top: -0.8rem; /* Pulls it up closer to your name */
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

/* Year Card Container Styles */
.year-card {
    background-color: #f8fafa; /* Light grey/blue background */
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    border: 1px solid #eef0f2;
}

.year-pill-container {
    flex-shrink: 0;
    width: 100px;
}

.year-pill {
    background-color: #e0e7ff; /* Light indigo pill */
    color: #1e3a8a; /* Dark blue text */
    font-weight: 700;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    display: inline-block;
    font-size: 1rem;
    text-align: center;
}

.papers-group {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Spacing between multiple papers in the same year */
    width: 100%;
}

.paper-item p {
    margin: 0 0 0.5rem 0;
}

.paper-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827; /* Darker heading color */
    margin-bottom: 0.5rem;
}

.paper-authors {
    color: #4b5563;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.paper-journal {
    color: #4b5563;
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* Updated Tags to match the screenshot's light blue style */
.tag-container {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.tag {
    display: inline-flex;
    align-items: center;
    background-color: #eff6ff;
    color: #2563eb;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
}

/* Update Mobile View for the new cards */
/* Responsive Design */
@media (max-width: 768px) {
    .profile-pic {
        float: none; 
        display: block;
        margin: 0 auto 1.5rem auto; 
        max-width: 100%;
    }
    .grid-list {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* NEW MOBILE BUTTON LAYOUT */
    .links-bar {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.5rem; /* Slightly smaller gap for phone screens */
        width: 100%;
    }
    
    .links-bar a {
        flex: 1 1 calc(50% - 0.5rem); /* Forces the 4 buttons into a 2x2 grid */
        text-align: center;
        padding: 0.6rem 0.2rem; /* Taller padding makes them easier to tap with a finger */
        font-size: 0.85rem;
        box-sizing: border-box;
    }
    
    .year-card {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    .year-pill-container {
        width: 100%;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* ADD THIS NEW BLOCK RIGHT HERE */
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 0.8rem;
        column-gap: 1.2rem;
        text-align: center;
    }
}

.links-bar a i {
    margin-right: 6px;
    font-size: 1.1em; /* Makes the icon just a tiny bit larger than the text */
}
