/* ===========================
   VARIABLES & RESET
   =========================== */
:root {
    --green-dark:    #3b6147;
    --green-mid:     #4a7c59;
    --green-sidebar: #6b8f71;
    --green-accent:  #3d7a52;
    --text-dark:     #222222;
    --text-mid:      #444444;
    --text-light:    #666666;
    --text-muted:    #888888;
    --white:         #ffffff;
    --border:        #dde8de;
    --sidebar-width: 260px;
    --font-serif:    'Lora', Georgia, serif;
    --font-sans:     'Source Sans 3', 'Helvetica Neue', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-mid);
    background: var(--white);
    /* Prevent horizontal scroll */
    overflow-x: hidden;
}

/* ===========================
   PAGE WRAPPER — CSS Grid
   main content left, sidebar right
   =========================== */
.page-wrapper {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    grid-template-areas: "main sidebar";
    min-height: 100vh;
    align-items: start;
}

/* ===========================
   MAIN CONTENT (left column)
   =========================== */
.main-content {
    grid-area: main;
    background: var(--white);
    min-height: 100vh;
    /* Prevent overflow into sidebar */
    min-width: 0;
}

/* ===========================
   SIDEBAR (right column) — sticky
   =========================== */
.sidebar {
    grid-area: sidebar;
    background-color: var(--green-sidebar);
    /* Stick to top as page scrolls */
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-sticky {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* Profile */
.sidebar-profile {
    text-align: center;
    padding: 2rem 1.25rem 1.5rem;
    width: 100%;
}

.profile-photo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.35);
    display: block;
    margin: 0 auto 1rem;
}

.sidebar-name {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.4rem;
}

.sidebar-tagline {
    font-size: 0.81rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
    font-style: italic;
}

/* Nav — ALL links are solid green blocks */
.sidebar-nav {
    width: 100%;
    /* No extra margin — blocks start immediately below profile */
}

.nav-link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.8rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    font-weight: 400;
    color: var(--white);
    text-decoration: none;
    background-color: var(--green-mid);
    border-top: 1px solid rgba(255,255,255,0.18);
    transition: background-color 0.15s, color 0.15s;
    /* Ensure block display never collapses */
    box-sizing: border-box;
}

.nav-link:last-child {
    border-bottom: 1px solid rgba(255,255,255,0.18);
}

.nav-link:hover {
    background-color: var(--green-dark);
    color: var(--white);
}

/* Active = white block, green text */
.nav-link.active {
    background-color: var(--white);
    color: var(--green-accent);
    font-weight: 600;
}

/* Social icons at bottom */
.sidebar-icons {
    display: flex;
    gap: 1.25rem;
    margin-top: auto;
    padding-top: 2rem;
    justify-content: center;
    align-items: center;
}

.icon-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.icon-link:hover { color: var(--white); }

.icon-link svg {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
}

/* ===========================
   HERO BANNER
   =========================== */
.hero-banner {
    width: 100%;
    height: 380px;
    overflow: hidden;
    background: linear-gradient(135deg, #4a7c59 0%, #2d5016 50%, #8fbc94 100%);
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===========================
   CONTENT SECTIONS
   =========================== */
.content-section {
    padding: 2.75rem 4rem;
    max-width: 860px;
}

.section-heading {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.25rem;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0 4rem;
}

.footer-spacer { height: 6rem; }

.content-section p {
    margin-bottom: 1rem;
    color: var(--text-mid);
}

/* ===========================
   RESEARCH GROUP
   =========================== */
.group-category { margin-bottom: 2rem; }

.group-subheading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.group-list { list-style: none; padding: 0; }
.group-list li { padding: 0.18rem 0; color: var(--text-mid); font-size: 0.96rem; }
.group-list li a { color: var(--green-accent); text-decoration: underline; }

/* ===========================
   TALKS
   =========================== */
.talks-group { margin-bottom: 2.5rem; }

.talks-event-heading {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.talks-topic {
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 1rem 0 0.35rem;
}

.talks-list { list-style: disc; padding-left: 1.4rem; }
.talks-list li { padding: 0.15rem 0; color: var(--text-mid); font-size: 0.95rem; }

/* ===========================
   PUBLICATIONS
   =========================== */
.publications-note {
    font-size: 0.91rem;
    color: var(--text-light);
    margin-bottom: 0.4rem !important;
}

.pub-list { margin-top: 2rem; }

.pub-item {
    display: flex;
    gap: 2rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}

.pub-item:first-child { border-top: 1px solid var(--border); }
.pub-thumb { flex-shrink: 0; width: 190px; }

.pub-thumb img {
    width: 100%;
    border-radius: 4px;
    display: block;
    border: 1px solid var(--border);
}

.pub-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.pub-authors { font-size: 0.91rem; color: var(--text-mid); margin-bottom: 0.25rem; }
.pub-venue { font-size: 0.91rem; color: var(--text-muted); margin-bottom: 0.6rem; font-style: italic; }
.pub-links { display: flex; gap: 0.75rem; }

.pub-link {
    font-size: 0.9rem;
    color: var(--green-accent);
    text-decoration: none;
    font-weight: 600;
}

.pub-link:hover { color: var(--green-dark); text-decoration: underline; }

.app-btn {
    display: inline-block;
    padding: 0.45rem 1.1rem;
    background: var(--green-accent);
    color: var(--white);
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}
.app-btn:hover { background: var(--green-dark); color: var(--white); text-decoration: none; }

/* ===========================
   TEACHING
   =========================== */
.teaching-group { margin-bottom: 2rem; }

.course-item {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.course-item:last-child { border-bottom: none; }

.course-item strong {
    display: block;
    color: var(--text-dark);
    font-size: 0.97rem;
    margin-bottom: 0.2rem;
}

.course-term {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--green-accent);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.course-item p { font-size: 0.93rem; color: var(--text-light); margin: 0 !important; }

/* CV */
.bio-block { margin-top: 2rem; }

/* Links */
.text-link { color: var(--green-accent); text-decoration: underline; }
.text-link:hover { color: var(--green-dark); }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 900px) {
    :root { --sidebar-width: 210px; }
    .content-section { padding: 2rem 2.5rem; }
    .section-divider { margin: 0 2.5rem; }
    .hero-banner { height: 260px; }
}

@media (max-width: 620px) {
    .page-wrapper {
        grid-template-columns: 1fr;
        grid-template-areas:
            "sidebar"
            "main";
    }
    .sidebar {
        position: relative;
        height: auto;
        width: 100%;
    }
    .sidebar-sticky { min-height: auto; }
    .sidebar-nav { display: flex; flex-wrap: wrap; }
    .nav-link { width: 50%; border: none; border-top: 1px solid rgba(255,255,255,0.18); }
    .hero-banner { height: 200px; }
    .content-section { padding: 1.75rem 1.5rem; }
    .section-divider { margin: 0 1.5rem; }
    .pub-item { flex-direction: column; }
    .pub-thumb { width: 100%; max-width: 220px; }
}
