/* --- General Styles --- */
:root {
    --primary-color: #003366; /* A professional dark blue */
    --secondary-color: #005f9e;
    --accent-color: #e37222; /* An accent color, e.g., for highlights */
    --text-color: #333333;
    --light-gray: #f4f4f4;
    --white: #ffffff;
    --header-font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --body-font: 'Georgia', 'Times New Roman', Times, serif;
}

body {
    font-family: var(--body-font);
    line-height: 1.7;
    color: var(--text-color);
    margin: 0;
    background-color: var(--white);
}

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

h1, h2, h3 {
    font-family: var(--header-font);
    color: var(--primary-color);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; border-bottom: 2px solid var(--light-gray); padding-bottom: 10px; }
h3 { font-size: 1.5rem; color: var(--secondary-color); }

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
}

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

strong {
    color: var(--primary-color);
}

/* --- Header & Navigation --- */
header {
    background-color: var(--white);
    padding: 1.5rem 0;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-family: var(--header-font);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo-block {
    text-decoration: none; /* Removes underline from the link block */
}

.logo-block .logo-title {
    font-family: var(--header-font);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    display: block; /* Makes it a block element */
    line-height: 1.2; /* Adjust line height */
}

.logo-block .logo-subtitle {
    font-family: var(--header-font);
    font-size: 0.9rem;
    color: var(--primary-color);
    display: block; /* Makes it a block element */
}

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

nav a {
    font-family: var(--header-font);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    padding-bottom: 5px;
}

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

/* --- Main Content --- */
main {
    padding: 2rem 0;
}

/* --- Footer --- */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer a {
    color: var(--white);
}

/* --- Footer Links --- */
.footer-links {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ffffff33; /* A semi-transparent white line */
}

.footer-links p {
    margin: 0.5rem 0;
}

.copyright {
    margin-top: 1rem;
    font-size: 0.9em;
    color: #ccc;
}

/* --- Homepage Specific Styles --- */
.hero {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 4rem 0;
    text-align: left;
}

.hero-text h1 {
    font-size: 3rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.hero-text .subtitle {
    font-size: 1.25rem;
    font-family: var(--header-font);
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

/* You can keep this part to center the image within the layout */
.hero-image-placeholder {
    width: 250px;
    height: 250px;
    flex-shrink: 0;
}

/* Apply the circular styling directly to the image */
.hero-image-placeholder img {
    /* Make the image fill the container */
    width: 100%;
    height: 100%;
    
    /* Crop to fit the container without distortion */
    object-fit: cover; 
    
    /* Apply the circular shape */
    border-radius: 50%; 
}

.highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 3rem;
}

.highlight-card {
    border: 1px solid #ddd;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    transition: box-shadow 0.3s, transform 0.3s;
}

.highlight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* --- Research Page Styles --- */
.research-vision {
    background-color: var(--light-gray);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 3rem;
    text-align: center;
}

.research-vision blockquote {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--primary-color);
    border: none;
    padding: 0;
    margin: 0;
}

.research-grid {
    display: grid;
    grid-template-columns: 1fr; /* Creates a single column */
    gap: 30px; /* Adjust the space between cards */
}

.research-card {
    position: relative;
    display: flex; /* Arranges items side-by-side */
    align-items: center; /* Vertically centers the text and image */
    gap: 30px; /* Adjusts space between text and image */
    
    border: 1px solid #ddd;
    border-left: 5px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    scroll-margin: 6rem; /* Offsets anchor jumps for sticky header */
}

.card-text {
    flex: 1; /* Allows the text block to grow and fill available space */
}

.card-image {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    flex-basis: 350px; /* Sets a fixed width for the image container */
    flex-shrink: 0; /* Prevents the image from shrinking */
    z-index: 1; /* This value will be increased on hover */
}

.card-image:hover img {
    transform: scale(2); /* Scales the image up */
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); /* Adds a shadow for depth */
    z-index: 10; /* Ensures the image appears above other elements */
}

.card-image img {
    width: 100%;
    height: auto;
    border-radius: 8px; /* Adds rounded corners to the image */
    display: block;
}

/* --- Publications Page Styles --- */
.pub-stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    background-color: var(--light-gray);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.pub-list {
    list-style-type: none;
    padding-left: 0;
}

.pub-list li {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    border-left: 3px solid var(--light-gray);
}

.pub-list li .title {
    font-weight: bold;
    display: block;
    color: var(--primary-color);
}

.pub-list li .authors {
    font-size: 0.9rem;
}

.pub-list li .venue {
    font-size: 0.9rem;
    font-style: italic;
    color: #555;
}

.pub-list li .links a {
    margin-right: 10px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* --- Teaching & About Page Styles --- */
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.timeline {
    list-style-type: none;
    padding-left: 0;
    border-left: 2px solid var(--light-gray);
    padding-left: 20px;
}
.timeline li {
    position: relative;
    margin-bottom: 2rem;
}
.timeline li::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--secondary-color);
}
.timeline .date {
    font-weight: bold;
    color: var(--secondary-color);
}
.timeline .institution {
    font-style: italic;
}

.teaching-artifacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 2.5rem 0;
}

.teaching-artifacts-grid.grid-2x2 {
    grid-template-columns: 1fr 1fr; /* Specifically for 2x2 grid */
}

.artifact-card {
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    background-color: #fff;
    /* overflow: hidden; */
    text-align: center;
    transition: box-shadow 0.3s, transform 0.3s;
    position: relative;
    z-index: 1;
}

.artifact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    z-index: 10; /* Ensures the card appears above other elements */
}

.artifact-card img,
.artifact-card video {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-bottom: 1px solid var(--light-gray);
    transition: transform 0.3s ease-in-out;
}

.artifact-card:not(.no-zoom) img:hover,
.artifact-card:not(.no-zoom) video:hover {
    transform: scale(2.0); /* Zooms in the image/video on hover */
}

.artifact-card h4 {
    margin: 1rem 0.5rem 0.5rem 0.5rem;
    color: var(--primary-color);
}

.artifact-card p {
    padding: 0 1.25rem 1.25rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Styling for blockquotes (student feedback) */
blockquote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #555;
}

blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-style: normal;
    font-weight: bold;
    color: var(--primary-color);
}

/* --- Smooth Scrolling --- */
html {
    scroll-behavior: smooth;
}

/* --- Jump Navigation Buttons --- */
.jump-nav {
    display: flex;
    flex-wrap: wrap; /* Allows buttons to wrap onto the next line */
    justify-content: center; /* Centers the buttons */
    gap: 20px; /* Space between the two group boxes */
    align-items: stretch; /* Makes the boxes equal height */
    margin-top: 2rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--light-gray);
}

.jump-group {
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    flex: 1; /* Allows groups to grow and fill space */
    min-width: 320px; /* Prevents groups from becoming too narrow */
}

.jump-group-title {
    font-family: var(--header-font);
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.jump-group-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px; /* Space between buttons */
}

.jump-btn {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--secondary-color);
    border-radius: 20px; /* Creates the pill shape */
    color: var(--secondary-color);
    font-family: var(--header-font);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.jump-btn:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px); /* Lifts the button slightly */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- Document Card Style --- */
.document-card {
    max-width: 500px;
    margin: 2rem auto; /* Centers the card horizontally */
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden; /* Ensures the image corners are rounded */
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.document-card a {
    display: block;
    text-decoration: none;
}

.document-card img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid var(--light-gray);
}

.document-card span {
    display: block;
    padding: 1rem;
    font-family: var(--header-font);
    font-weight: 600;
    color: var(--secondary-color);
    background-color: #fcfcfc;
}

/* --- Contact Page Styles --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr; /* Left column is smaller, form is larger */
    gap: 50px;
    margin-top: 3rem;
}

.contact-details h3 {
    margin-top: 0;
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 10px;
}

.social-links {
    list-style-type: none;
    padding-left: 0;
}

.social-links li {
    margin-bottom: 0.5rem;
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--header-font);
    font-weight: 500;
    color: var(--primary-color);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: var(--body-font);
    font-size: 1rem;
    line-height: 1.5;
}

.contact-form button {
    cursor: pointer;
    border: 1px solid var(--primary-color);
    background-color: var(--primary-color);
    color: var(--white);
}

.contact-form button:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* --- Hamburger Menu Styles --- */
.nav-toggle {
    display: none; /* Hidden by default */
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0.5em;
    position: absolute;
    right: 1.5em;
    top: 1.5em;
    z-index: 1001;
}

.hamburger {
    display: block;
    position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    background: var(--primary-color);
    width: 2em;
    height: 3px;
    border-radius: 1em;
    transition: transform 250ms ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
}

.hamburger::before { top: 7px; }
.hamburger::after { bottom: 7px; }

/* Styles for the navigation when it is open on mobile */
.nav-open .main-nav {
    transform: translateX(0);
}

.nav-open .hamburger {
    transform: rotate(.625turn);
}

.nav-open .hamburger::before {
    transform: rotate(90deg) translateX(-7px);
}

.nav-open .hamburger::after {
    opacity: 0;
}

/* --- Responsive Styles for Mobile --- */
@media (max-width: 768px) {

    /* --- General Layout --- */
    body {
        line-height: 1.6; /* Improve readability on small screens */
    }

    /* --- Header --- */
    header .container {
        flex-direction: column; /* Stack the logo and nav vertically */
        gap: 20px;
    }

    /* NEW: Stack navigation links on mobile */
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    /* --- Homepage --- */
    .hero {
        flex-direction: column-reverse; /* Stack text above the image */
        text-align: center;
    }

    /* NEW: Stack publication stats on mobile */
    .pub-stats {
        flex-direction: column;
        gap: 10px;
    }

    /* --- Two-Column Grids --- */
    /* This targets all your 2-column layouts: about, teaching, contact, etc. */
    .grid-container,
    .contact-grid,
    .teaching-artifacts-grid.grid-2x2 {
        grid-template-columns: 1fr; /* Switch to a single column */
    }

    /* --- Research Card Layout --- */
    /* Stack the image on top of the text in research cards */
    .research-card {
        flex-direction: column;
        align-items: flex-start; /* Align text to the left */
    }
    
    .card-image {
        flex-basis: auto; /* Allow image width to be flexible */
        width: 100%;     /* Make image full width of the card */
        margin-bottom: 1rem;
    }

    /* --- Contact Form Note --- */
    .form-note {
    font-size: 0.9rem;
    color: #555;
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
    }

    /* --- Navigation Menu --- */
    .main-nav {
        display: flex;
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0;
        left: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(5px);
        transform: translateX(100%);
        transition: transform 250ms ease-in-out;
        z-index: 1000;
        
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .main-nav ul {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .main-nav a {
        font-size: 1.5rem;
    }

    .nav-toggle {
        display: block;
    }
}
