body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
    background-image: url('background.jpeg'); /* Ensure the background image is specified correctly */
    background-size: cover; /* Cover the entire body with the image */
    background-repeat: no-repeat; /* Do not repeat the image */
    background-position: center center; /* Center the background image */
    position: relative; /* Relative positioning for overlay */
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.08); /* Black overlay with 50% opacity */
    z-index: 0; /* Ensures the overlay is below the text content */
}

div {
    background-color: rgba(255, 255, 255, 0.7); /* White with 80% opacity */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: auto;
    max-width: 800px;
    position: relative; /* Ensure it's above the overlay */
    z-index: 1;
}

.profile-pic {
    width: 200px; /* Adjusted from a smaller size to 200px */
    height: auto; /* Maintains the aspect ratio of the image */
    border-radius: 50%; /* Keeps the image circular */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); /* Adds a subtle shadow for depth */
    margin-right: 20px; /* Adds spacing between the image and the adjacent text */
    float: left; /* Aligns the image to the left of the text */
}

/* Ensure the header containing the floated image expands to include the float */
.profile-header {
    overflow: auto; /* creates a new block formatting context to contain floats */
    padding-bottom: 15px;
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    .profile-pic {
        width: 100px; /* Smaller size on mobile devices for better fit */
        float: none; /* Prevents image from floating to allow better centering */
        display: block; /* Block display to handle center alignment */
        margin: 0 auto 10px; /* Center-aligns the image and adds space below it */
    }
}

/* Make all heading elements black and bold (site titles) */
h1, h2, h3, h4, h5, h6 {
    color: #000000;
    font-weight: 700;
}

p, .email a {
    color: #333;
    line-height: 1.5;
}

.email a {
    text-decoration: none;
    color: #0056b3;
}

.email a:hover {
    text-decoration: underline;
}

/* Keep all links blue, even after they've been visited */
a {
    color: #0056b3;
}

a:visited {
    color: #0056b3;
}

a:hover {
    text-decoration: underline;
}

ul.publications {
    list-style-type: disc;
    padding-left: 20px;
}

ul.publications li {
    margin-bottom: 10px;
}

h3 {
    margin-top: 20px;
}

/* Make Research Interest heading smaller */
h3.research-interest {
    font-size: 1.1em;
    margin-top: 15px;
    margin-bottom: 8px;
}

/* Navigation links - must come BEFORE the separator and be right-aligned */
.nav-links {
    text-align: right;
    margin: 5px 0 10px 0;
    padding: 8px 0;
    clear: both;
    display: block;
    width: 100%;
}

.nav-links a {
    color: #0056b3;
    text-decoration: none;
    margin-left: 10px;
    font-weight: 500;
}

.nav-links a:hover {
    text-decoration: underline;
}

/* Horizontal separator under the profile header and navigation */
.profile-sep {
    clear: both;
    display: block;
    width: 100%;
    border: none;
    height: 2px;
    background-color: #000;
    margin: 15px 0 15px 0;
    padding: 0;
}

/* Specific adjustment for Scientist-in-Residence section */
.sir-title {
    margin-top: 0;
    margin-bottom: 5px;
}
