/* ==================== CSS Variables ==================== */
:root {
    --primary-color: #1a1a1a;
    --link-color: #0066cc;
    --link-hover: #0052a3;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --bg-light: #f8f8f8;
    --white: #ffffff;
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

p {
    margin-bottom: 1rem;
}

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

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

ul {
    margin-bottom: 1rem;
}

/* ==================== Language Toggle ==================== */
.language-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.lang-btn.active {
    background: var(--primary-color);
    color: var(--white);
}

.lang-btn:hover:not(.active) {
    background: var(--bg-light);
}

/* ==================== Navigation ==================== */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 999;
}

.nav-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-title:hover {
    text-decoration: none;
}

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

.nav-menu li a {
    color: var(--text-dark);
    font-weight: 400;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: var(--link-color);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--primary-color);
    margin: 3px 0;
    transition: all 0.3s ease;
}

/* ==================== Main Content ==================== */
.main-content {
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

.content-section {
    margin-bottom: 3rem;
}

/* ==================== Hero Grid (Home Page) ==================== */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 3rem;
}

.profile-card {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.profile-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pi-card {
    grid-column: span 2;
    grid-row: span 2;
}

/* ==================== Hero Section with Photo and Bio ==================== */
.hero-section {
    display: flex;
    align-items: flex-start; /* or center if you prefer vertical alignment /*/
    gap: 2rem; /*/ space between photo and bio */
}

.hero-photo {
    flex: 0 0 auto;  /*keep the photo at its natural size or set a fixed width /*/
    width: auto;
    max-width: 250px;
    justify-content: center;
}

.hero-photo img {
    width: 100%; 
    height: auto; 
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-bio {
    flex: 1 1 auto; /* bio takes remaining space /*/
    min-width: 0; /*/ prevents overflow from long text */
    justify-content: left;
}

.hero-bio h1 {
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: none;
    padding-bottom: 0;
}

.hero-bio p {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.hero-bio strong {
    color: var(--primary-color);
}

/* ==================== Lists ==================== */
.simple-list {
    list-style-position: outside;
    margin-left: 1.5rem;
}

.simple-list li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.news-list {
    list-style: none;
    margin-left: 0;
}

.news-list li {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.news-list strong {
    color: var(--text-dark);
}

.alumni-list {
    list-style: none;
    margin-left: 0;
}

.alumni-list li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

/* ==================== Contact Grid ==================== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* ==================== Team Page ==================== */
.team-member-detailed {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.team-member-detailed img {
    width: 100%;
    max-width: 200px;
    border-radius: 4px;
}

.member-info h3 {
    margin-top: 0;
    font-size: 1.5rem;
}

.member-title {
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.team-member {
    text-align: left;
}

.team-member img {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.8rem;
}

.team-member h3 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0.3rem;
}

.team-member h3 a {
    color: var(--primary-color);
}

.member-note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.member-research {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.5;
}

/* ==================== Research Page ==================== */
.research-project {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.research-project:last-child {
    border-bottom: none;
}

.research-project h3 {
    margin-top: 0;
}

.publication-links {
    margin-top: 2rem;
    text-align: center;
}

.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: var(--link-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: var(--link-hover);
    text-decoration: none;
}

.scholar-embed {
    margin-top: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

/* ==================== Teaching Page ==================== */
.course-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.course-item h3 {
    margin-top: 0;
}

.heading-with-logo {
  display: flex;
  align-items: center;
  gap: 1.5em; /* Controls horizontal spacing, e.g. 2em, 32px, etc */
}

.university-logo {
  width: 100px; /* or any fixed size you need */
  max-width: 100px;  /* never exceed 100px, even if file is bigger */
  height: auto;
  display: block;
    margin-bottom: -25px;       /* lowers the image slightly below the baseline of the h2 */
}


/* ==================== Prospective Students Page ==================== */
.recruiting-banner {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    padding: 2rem;
    border-radius: 4px;
    border-left: 4px solid var(--link-color);
    margin-bottom: 2rem;
}

.recruiting-banner h2 {
    margin-top: 0;
    font-size: 1.8rem;
}

.deadline-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    padding: 1.5rem;
    border-radius: 4px;
    margin-top: 1.5rem;
}

.deadline-box p {
    margin-bottom: 0.5rem;
}

.deadline-box p:last-child {
    margin-bottom: 0;
}

/* ==================== Footer ==================== */
footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

footer p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu.active {
        max-height: 400px;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu li a {
        display: block;
        padding: 1rem 20px;
    }

    .hero-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .pi-card {
        grid-column: span 2;
        grid-row: span 2;
    }

    /* Hero section responsive */
.hero-section { display: grid; 
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
    align-items: start; }

.hero-photo {
    flex: 0 0 auto; /* keep the photo at its natural size or set a fixed width /*/
    width: 250px; /*/ optional: explicit photo width*/ 
}

    .team-member-detailed {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .team-member-detailed img {
        max-width: 200px;
        margin: 0 auto;
    }

    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .language-toggle {
        top: 10px;
        right: 10px;
    }

    .main-content {
        padding: 2rem 0;
    }
}

@media (max-width: 480px) {
    .hero-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .nav-container {
        padding: 1rem 15px;
    }

    .container {
        padding: 0 15px;
    }
}