/*
 * Cleaned and Re-organized Stylesheet
 * ------------------------------------
 * This CSS file is organized into logical sections for easier maintenance.
 * 1. Global Styles: Basic styles for the entire site (typography, links).
 * 2. Header & Nav: Styles for the main navigation bar.
 * 3. Layout & Reusable Components: Styles for common elements used on multiple pages.
 * 4. Page-Specific Styles: Styles unique to a particular page.
 * 5. Footer: Styles for the site footer.
 * 6. Responsive Design: Styles for mobile and smaller screens.
 */

/* ===================================================================
   1. Global Styles & Theme
   =================================================================== */
body {
    background-color: #1c252c;
    color: #f0f2f5;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    line-height: 1.6;
}

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

h1 {
    color: #ffffff;
    padding-bottom: 1px;
}

h2 {
    color: #ffffff;
    margin-top: 10px;
    margin-bottom: 0px;
    padding-bottom: 1px;
}

h3 {
    color: #aeb9c5;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 0px;
    margin-bottom: 1px;
    padding-bottom: 1px;
    border-bottom: 1px solid #445460;
}

/* Reduced spacing for paragraphs following headings */
h1 + p,
h2 + p {
    margin-top: 3px;
    margin-bottom: 3px;
}

p {
    font-size: 1.25rem;
}

a {
    color: #69b5ff;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: #9acfff;
    text-decoration: underline;
}

/* ===================================================================
   2. Header & Navigation Bar
   =================================================================== */
header {
    background-color: #2c3a44;
    padding: 1.2rem 0;
    border-bottom: 1px solid #1c252c;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    color: #f0f2f5;
    margin: 0 15px;
    font-weight: 500;
    font-size: 1.15rem;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

nav a:hover {
    background-color: #445460;
    text-decoration: none;
}

nav a.active {
    color: #ffffff;
    background-color: #E69500;
}

/* ===================================================================
   3. Layout & Reusable Components
   =================================================================== */

/* --- Card with image and text (Home, Research, Experiments) --- */
.item-card {
    display: flex;
    align-items: flex-start;
    text-align: justify;
    gap: 30px;
    margin-bottom: 30px;
    background-color: #2c3a44;
    padding: 15px;
    border-radius: 8px;
    border: none;
}

.item-card img {
    max-width: 280px;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    margin-top: 30px;
}

.item-card-text h3 {
    margin-top: 0;
    color: #ffffff;
}

.item-card p {
    font-size: 1.0rem;
}

/* --- Justified text block (Research, Experiments, Talks, Publications) --- */
.intro-text-block {
    text-align: justify;
    margin-bottom: 10px;
}

.intro-text-block p,
.intro-text-block li {
    font-size: 1.05rem;
}

/* --- Styled lists (Talks, Publications) --- */
.list-section ul,
.list-section ol {
    margin: 0;
    padding: 20px 30px 20px 50px;
    background-color: #2c3a44;
    border-radius: 8px;
}

.list-section li {
    padding: 3px 0;
}

.list-section li:last-child {
    border-bottom: none;
}

/* ===================================================================
   4. Page-Specific Styles
   =================================================================== */

/* --- 4a. Home Page --- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-bottom: -30px;
}

.profile-photo {
    max-width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid #445460;
    object-fit: cover;
}

.main-title {
    font-size: 2.5rem;
}

.contact-list {
    list-style: none;
    padding-left: 0;
    line-height: 1.2;
    text-align: right;
    font-size: 0.8em;
}

.contact-list li {
    margin-bottom: 10px;
}

.social-icons {
    text-align: center;
    margin-bottom: 40px;
}

.social-icons a {
    color: #cdd1d6;
    font-size: 1.8rem;
    margin: 0 10px;
    transition: color 0.2s ease-in-out;
}

.social-icons a:hover {
    color: #69b5ff;
    text-decoration: none;
}

/* --- 4b. Research & Experiments Pages --- */
.research-theme {
    background-color: #2c3a44;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #445460;
}

.research-theme summary {
    padding: 15px 20px;
    cursor: pointer;
    outline: none;
    list-style: none; /* Removes the default triangle */
}

.research-theme summary h2 {
    display: inline;
    margin: 0;
    font-size: 1.5rem;
}

.research-theme summary::before {
    content: '▶'; /* Arrow pointing right when closed */
    font-size: 0.8em;
    margin-right: 15px;
    display: inline-block;
    transition: content 0.2s;
}

.research-theme[open] > summary::before {
    content: '▼'; /* Arrow pointing down when open */
}

.theme-intro {
    padding: 0 15px 10px 15px;
    text-align: justify;
    font-size: 1.0rem;
    margin-top: -10px;
}

.project-card {
    margin: 0 20px 20px 20px;
    background-color: #1c2c35; /* Darker background to stand out */
    border: 1px solid #445460;
}

.project-card h3 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 15px;
}

.project-card h4 {
    font-size: 1rem;
    color: #aeb9c5;
    margin-top: 20px;
    margin-bottom: 10px;
}

.project-card ul {
    padding-left: 30px;
    margin: 0;
}

.project-card li {
    font-size: 1rem;
    padding: 0;
}

/* ===================================================================
   5. Footer
   =================================================================== */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 0.9em;
    color: #9ab;
    border-top: 1px solid #2c3a44;
    height: 20px;
}

/* ===================================================================
   6. Responsive Design
   =================================================================== */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.0rem;
    }

    .item-card p {
        font-size: 1.0rem;
        text-align: left;
    }

    nav {
        overflow-x: auto; /* Allows horizontal scrolling */
        white-space: nowrap; /* Prevents links from wrapping */
        justify-content: flex-start; /* Aligns links to the left */
        padding: 0 10px;
    }

    /* Home page: Stack profile photo and name vertically */
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        margin-bottom: 0;
    }

    /* Home page: Align contact info left on small screens */
    .contact-list {
        text-align: left;
        margin-top: 20px;
    }

    /* All pages: Stack content within item-cards vertically */
    .item-card {
        flex-direction: column;
        align-items: center;
    }

    /* Adjust image within stacked item-card */
    .item-card img {
        margin-top: 0;
        margin-bottom: 15px;
        max-width: 100%; /* Ensure image is not wider than the card */
    }
}