/* --- CSS Variables for Theming --- */
:root {
    --bg-color: rgb(233, 233, 233);
    --text-color: #363c41;
    /* --header-font: 'Playfair Display', serif; */
    --header-font: 'Cormorant Garamond', serif; 
    --body-font: 'Inter', sans-serif;
    --border-color: #353b41;
    /* High-contrast border */
    --link-hover: #7497e8;
    --icon-color: #495057;
    --icon-accent-color: var(--icon-color);
}


[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #c5c3c3;
    --border-color: #a7b2bc;
    /* --link-hover: #a9b8ff; */
    --link-hover: #ccaccf;
    --icon-color: #adb5bd;
    --icon-accent-color: var(--icon-color);
}

/* --- General Styles & Typography --- */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--body-font);
    line-height: 1.5;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
}

h1,
h2,
h3 {
    font-family: var(--header-font);
    color: var(--text-color);
    margin: 0;
}

h1 {
    font-size: 2.5rem;
    font-weight: 500;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0rem;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.2s ease-in-out;
}

h1:hover {
    color: var(--link-hover);
}

h2:hover {
    color: var(--link-hover);
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

a {
    /* color: var(--text-color); */
    color: var(--link-hover);
    text-decoration: none;
    /* font-weight: 500; */
    transition: color 0.2s ease-in-out;
}

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

/* --- Header & Navigation --- */
header {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.identity h1 {
    font-size: 2.3rem;
    font-weight: 600;
    margin: 0;
}

.identity a {
    text-decoration: none;
}

.affiliation {
    color: #6c757d;
    margin-top: 0.5rem;
    margin-bottom: -0.5rem;
    padding-bottom: -0.5rem;
    font-size: 0.95rem;
    line-height: 1.2rem;
}

.affiliation span {
    display: block;
}

[data-theme="dark"] .affiliation {
    color: #adb5bd;
}

/* --- Icon Group (Gallery & Theme Toggle) --- */
.icon-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 20px;
}

.icon-group button,
.icon-group a {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
}

.icon-group svg {
    width: 22px;
    height: 22px;
    stroke: var(--icon-accent-color);
    transition: all 0.2s ease-in-out;
}

.icon-group button:hover svg,
.icon-group a:hover svg {
    transform: scale(1.15) rotate(5deg);
    stroke: var(--link-hover);
}

.icon-moon {
    display: none;
}

[data-theme="dark"] .icon-sun {
    display: none;
}

[data-theme="dark"] .icon-moon {
    display: block;
}


/* --- Hero Section --- */
#hero {
    text-align: center;
    margin-bottom: 3rem;
}

.affiliation {
    color: #6c757d;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.affiliation span {
    display: block;
}

[data-theme="dark"] .affiliation {
    color: #adb5bd;
}

/* --- Content Block Layout --- */
.content-block {
    background-color: transparent;
    /* No separate inner color */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* --- About, Research & Contact --- */
.about-flex-container {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    text-align: justify;
}

.profile-sidebar {
    flex: 0 0 120px; /* Give sidebar a fixed width */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-photo {
    width: 170px;
    height: 170px;
    object-fit: cover;
    border-radius: 30%;
    border: 1px solid var(--border-color);
    /* flex-shrink: 0; */
    /* Prevents image from shrinking */
    margin-top: 1rem;
    /* margin: auto; */
    /* filter: grayscale(20%) opacity(80%); */
    /* filter: opacity(90%); */
    /* transition: filter 0.2s ease; */ 
}

/* .profile-sidebar:hover .profile-photo {
    filter: grayscale(0%) opacity(100%);
} */

.email-address {
    font-family: 'Inconsolata', monospace;
    /* background-color: var(--bg-color); */
    /* border: 1px solid var(--border-color); */
    padding: 0.5rem 0.5rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    display: inline-block;
    line-height: 1.3; /* Add this line */

    /* Fits content width */
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    margin-top: -0.5rem;

}

.social-links svg {
    width: 22px;
    height: 22px;
    stroke: var(--icon-color);
    transition: all 0.15s ease-in-out;
}

.social-links a:hover svg {
    /* transform: scale(1) rotate(5deg); */
    stroke: var(--link-hover);
}

#research .project:not(:last-child) {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed var(--border-color);
}

/* --- Gallery Page --- */
#gallery .subtitle {
    text-align: center;
    font-size: 1.1rem;
    margin: -1rem 0 2rem 0;
    color: #6c757d;
}

#gallery h2 {
    border-bottom: None;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding: 10px;
}

.photo-grid img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease-in-out;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}


.photo-grid a:hover img {
    opacity: 0.8;
}

/* --- JS-Powered Lightbox --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.lightbox.show {
    display: flex;
}

/* Shown with JS */
.lightbox-content {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;

    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.lightbox-close:hover {
    transform: scale(1.1);
}

/* --- Footer --- */
footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}

/* --- Responsive Design --- */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .content-block {
        padding: 1.5rem;
    }

    .about-flex-container {
        flex-direction: column;
        align-items: center;
    }

    .profile-photo {
        margin-bottom: 0rem;
    }
}


/* Styling for publication categories */
#publications h3 {
    font-family: var(--body-font);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--icon-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

#publications li {
    margin-bottom: 1rem;
}

.contribution-note {
    display: block; 
    font-size: 0.85rem;
    font-style: italic;
    color: var(--icon-color);
    margin-top: 0.25rem;
}