/* --- Global Styles --- */
@import url('https://fonts.googleapis.com/css2?family=Garamond&family=Lato:wght@300;400;700&display=swap');

:root {
    --accent-color: #0056b3;
    --accent-color-hover: #003d80;
    --text-color: #212529;
    --text-color-secondary: #555;
    --background-color: #f8f9fa;
    --header-bg: #ffffff;
    --footer-bg: #495057;          /* CHANGED: Lightened from #343a40 */
    --container-bg: #ffffff;
    --container-border: #dee2e6;
    --font-sans: 'Lato', sans-serif;
    --font-serif: 'Garamond', serif;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden; 
}

html {
    scroll-behavior: smooth; 
}

body {
    font-family: var(--font-sans);
    line-height: 1.0;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--background-color); 
}

body.no-scroll {
    overflow-y: hidden;
}

/* --- Header --- */
header {
    padding: 20px;
    background-color: var(--header-bg);
    color: var(--text-color);
    border-bottom: 1px solid var(--container-border); 
}

h1 {
    font-family: var(--font-sans);
    font-size: 3rem;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    text-align: center;
    color: inherit;
    font-weight: 700;
}

.tagline {
    font-family: var(--font-sans);
    font-size: 1.1em;
    color: var(--text-color-secondary);
    margin-top: 10px;
    font-weight: 300;
    text-align: center;
    text-transform: uppercase; 
    letter-spacing: 1.5px;
}

/* --- Top Navigation Bar (Desktop) --- */
.top-nav {
    background-color: var(--header-bg); 
    border-bottom: 1px solid var(--container-border);
    text-align: center;
    padding: 10px 0;
    display: none; 
}

.top-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; 
}

.top-nav li a {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    color: var(--text-color-secondary);
    text-decoration: none;
    padding: 10px 20px;
    transition: color 0.3s ease, background-color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
}

.top-nav li a:hover {
    color: var(--accent-color);
    background-color: var(--background-color);
    text-decoration: none;
}


/* --- Main Sections --- */
main {
    padding: 10px 10px;
    min-height: calc(100vh - 120px);
    display: column;
    align-items: center;
    justify-content: center;
}

main > section[id] {
    padding-top: 25px; 
    scroll-margin-top: 20px; 
}
main > section[id]:first-child {
    padding-top: 0;
}


.container {
    max-width: 960px;
    margin: auto auto;
    padding: 15px 25px; 
    background-color: var(--container-bg);
    border-radius: 8px; 
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--container-border);
}

main > section[id] .container {
    margin-bottom: 25px; 
}

/* --- CV Download Button Wrapper --- */
.cv-download {
    margin-bottom: 25px; 
}

h2 {
    font-family: var(--font-sans);
    font-size: 2rem;
    color: var(--accent-color); 
    font-style: normal; 
}

h3 {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
}



/* --- Text elements --- */
p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
}

ul, ol {
    padding-left: 25px;
}

li {
    margin-bottom: 10px;
    line-height: 1.5; 
}

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

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

hr {
    border: 0;
    border-top: 1px solid var(--container-border);
    margin: 20px 0;
}

/* --- Indented List Specifics --- */
#publications .container ul li,
#highlights .container ul li {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--text-color-secondary);
    padding-left: 3em; 
    text-indent: -3em;  
    list-style-type: none; 
}

#publications .container ul li a,
#highlights .container ul li a {
    color: var(--accent-color);
    font-weight: bold;
}
#publications .container ul li a:hover,
#highlights .container ul li a:hover {
    color: var(--accent-color-hover);
}


/* ================================= */
/* --- Project Card Styling --- */
/* ================================= */

.project-grid {
    display: flex; 
    flex-direction: column; 
    gap: 25px; 
}

.project-card {
    background: var(--container-bg);
    border: 1px solid var(--container-border);
    border-radius: 8px;
    overflow: hidden; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 20px; 
}

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

.project-card h4 {
    font-family: var(--font-sans);
    font-size: 1.3rem;
    color: var(--accent-color);
    margin-top: 0;
    margin-bottom: 15px; 
}

.card-body {
    display: flex;
    flex-direction: row;
    gap: 20px; 
}

.card-figure {
    flex: 1; 
    margin: 0; 
}

.card-figure img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; 
    object-fit: cover; 
    border-radius: 8px;
    border: 1px solid var(--container-border);
}

.card-text-content {
    flex: 2; 
    display: flex;
    flex-direction: column;
}

.card-text-content p {
    font-size: 1rem;
    line-height: 1.5;
    margin-top: 0; 
    margin-bottom: 20px;
    flex-grow: 1; 
    color: var(--text-color-secondary);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: #ffffff;
    font-family: var(--font-sans);
    font-weight: 700;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
    margin-top: auto; 
    align-self: flex-start; 
}

.btn:hover {
    background-color: var(--accent-color-hover);
    color: #ffffff;
    text-decoration: none;
    transform: scale(1.03);
}

/* --- Responsive layout for project cards --- */
@media (max-width: 600px) {
    .card-body {
        flex-direction: column; 
    }
    
    .card-text-content,
    .card-figure {
        flex-basis: 100%;
    }
}

/* =================================== */
/* --- End Project Card Styling ---    */
/* =================================== */


/* --- Menu Toggle Button (Mobile) --- */
.menu-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001; 
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
    display: flex; 
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.menu-toggle-btn:hover {
    background: var(--accent-color-hover);
    transform: scale(1.05);
}

/* Styles for the slide-out sidebar menu */
.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    max-width: 80vw;
    height: 100vh;
    background-color: var(--container-bg);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.4s ease-out;
    overflow-y: auto;
    padding-top: 60px;
    padding-bottom: 20px;
    text-align: left;
    border-left: 1px solid var(--container-border);
    display: block; 
}

.sidebar.is-open {
    right: 0;
}

.sidebar .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-color-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
     z-index: 1002;
}

.sidebar .close-btn:hover {
    color: var(--accent-color);
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.sidebar li a {
    display: block;
    padding: 15px 25px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    font-family: var(--font-sans);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar li a:hover {
    background-color: var(--background-color);
    color: var(--accent-color);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-out, visibility 0.4s ease-out;
    display: block; 
}

.sidebar-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* --- Basic Figure Styling --- */
figure {
    margin: 0;
    padding: 0;
    text-align: center;
    font-size: 0.9em;
    color: var(--text-color-secondary);
    border: 1px solid var(--container-border);
    padding: 10px;
    background-color: var(--background-color);
    border-radius: 5px;
}

figure img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 5px auto;
    border-radius: 3px;
}

figcaption {
    margin-top: 5px;
}

/* --- Text Wrapping (Floating) Classes --- */
.float-right {
    float: right;
    width: 40% ;
    max-width: 350px;
    margin: 0 0 10px 20px;
}

.float-left {
    float: left;
    width: 40%;
    max-width: 350px;
    margin: 0 20px 10px 0;
}

.clear-float {
    clear: both;
    height: 0;
    visibility: hidden;
}

/* --- Responsive Adjustments for Floating --- */
@media (max-width: 600px) {
    .float-right,
    .float-left {
        float: none;
        width: 90%; 
        margin: 10px auto;
        text-align: center;
    }
}

/* --- Footer --- */
footer {
    background-color: var(--footer-bg);
    color: #e0e0e0;
    text-align: center;
    padding: 30px 0;
    font-size: 0.9em;
    margin-top: 50px;
    border-top: 1px solid #555;
}

footer a {
    color: #ffffff;
    font-weight: bold;
}

footer a:hover {
    color: var(--accent-color);
}

/* --- Responsive Menu Switch --- */
@media (min-width: 769px) {
    .top-nav {
        display: block;
    }
    .menu-toggle-btn {
        display: none;
    }
    .sidebar {
        display: none;
    }
    .sidebar-overlay {
        display: none;
    }
    body.no-scroll {
        overflow-y: auto; 
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.2em;
    }
    .tagline {
        font-size: 1em;
    }
    .container {
        padding: 5px 10px;
    }
}

/* --- Contact Icons Styling --- */
.contact-icons a {
    color: #f8f9fa;
    margin: 0 15px;
    font-size: 1.8rem;
    transition: color 0.3s ease, transform 0.3s ease; /* CHANGED: Added transform */
    text-decoration: none;
    display: inline-block; /* Added to make transform work reliably */
}

.contact-icons a:hover {
    color: var(--accent-color); /* CHANGED: Was #ffffff, now accent blue */
    text-decoration: none;
    transform: scale(1.1); /* CHANGED: Was 1.05, made slightly larger */
}