/* --- Fonts --- */
@font-face {
    font-family: 'Lato';
    src: url('/fonts/lato-regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Lato';
    src: url('/fonts/lato-bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

/* --- Variables --- */
:root {
    --bg-color: #FFFFFF;
    --text-main: #4D483B;
    --text-secondary: #666666;
    --link-color: #1C71A6;
    --nav-bg: #1C71A6;
    --nav-accent: #134e73;
    --nav-text: #ffffff;
    --btn-bg: #f7f4ed;
    --btn-border: #e0ddd5;
    --btn-hover: #F0B23E;
    --info-bg: #E6F5FF;
    --heading-color: #4D483B;
    --title-color: #175f8c;
    --status-color: #f768a1;
    --font-ui: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Base Styles --- */
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

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

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    color: var(--heading-color);
    margin-bottom: 1rem;
    margin-top: 2.5rem;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

/* Remove top margin from first headers in any container */
.container > :first-child,
section > :first-child,
.teaching-list > :first-child {
    margin-top: 0;
}

em {
    font-style: normal;
}

/* --- Layout --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.profile-outer {
    background-color: var(--info-bg);
    width: 100%;
}

.profile-outer .container {
    padding-top: 1rem;
    padding-bottom: 0.75rem;
}

/* --- Components: Navigation --- */
.site-header {
    background-color: var(--nav-bg);
    color: var(--nav-text);
    font-size: 1rem;
    border-bottom: 10px solid var(--nav-accent);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--nav-text);
    font-weight: bold;
    opacity: 0.8;
    padding-bottom: 0.25rem;
    border-bottom: 4px solid transparent;
}

.nav-links a:hover {
    opacity: 1;
    text-decoration: none;
    color: var(--btn-bg);
}

.nav-links a.active {
    opacity: 1;
    border-bottom: 4px solid var(--nav-text);
}

.site-title a {
    color: var(--nav-text);
    font-size: 1.3rem;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-logo {
    height: 1.625rem;
    width: auto;
}

/* --- Components: Profile --- */
.profile-header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
}

.profile-image-container img {
    width: 220px;
    height: auto;
    border-radius: 4px;
    background-color: #e0e0e0;
}

.profile-text {
    font-size: 0.9rem;
}

.profile-text p {
    margin-top: 0;
}

.bio a {
    color: var(--heading-color);
    font-weight: bold;
}

.profile-links {
    margin-top: 1rem;
}

.bold-link {
    color: var(--link-color) !important;
    font-weight: bold;
}

/* --- Components: Items (Papers, Courses, Code) --- */
.paper-item, .course-item, .code-note-item {
    margin-bottom: 1.5rem;
}

.paper-title, .course-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--title-color);
}

.paper-journal {
    color: var(--text-main);
    font-size: 0.9rem;
    margin-top: 0.1rem;
}

.paper-abstract, .course-details, .code-note-description {
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.paper-abstract {
    padding: 1rem;
    background-color: #ffffff;
    border-left: 4px solid var(--text-secondary);
}

.paper-presentations {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.paper-links, .course-links {
    margin-top: 0.3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.paper-status {
    color: var(--status-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-weight: bold;
}

/* --- Components: Buttons & Toggles --- */
.link-btn, .abstract-toggle {
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--text-main) !important;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    text-decoration: none !important;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.link-btn:hover, .abstract-toggle:hover {
    background: var(--btn-hover);
}

.presentations-toggle {
    background: transparent;
    border: none;
    color: var(--link-color) !important;
    padding: 0;
    font-size: 0.8rem;
    font-weight: normal;
    display: inline;
    cursor: pointer;
    font-family: inherit;
}

.presentations-toggle:hover {
    text-decoration: underline !important;
}

.hidden {
    display: none;
}

/* --- Media Queries --- */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

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