/* Import Oswald font */
@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@400;700&display=swap");

/* Import Merriweather font (as a stand-in for Factoria) */
@import url("https://fonts.googleapis.com/css2?family=Merriweather&display=swap");

/* Import Libertinus Serif font - User may need to verify this URL or host the font files */
@import url("https://fonts.googleapis.com/css2?family=Libertinus+Serif&display=swap"); /* Placeholder URL, verify if correct */

/* Basic Reset */
body,
h1,
h2,
h3,
p,
ul,
li {
    /* Removed 'a' from this reset */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* General Link Styles */
a {
    color: #7db0db; /* Standardized link color */
    text-decoration: none; /* Remove underline by default */
}

a:hover {
    text-decoration: underline; /* Add underline on hover */
}

body {
    font-family:
        "Merriweather", serif; /* Updated font to Merriweather (Factoria substitute) */
    line-height: 1.6;
    color: #333;
    background-color: #fff; /* Changed background to white */
    padding: 20px 0; /* Added padding to prevent content touching screen edges */
}

.container {
    display: flex;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto; /* Center the container */
    min-height: 90vh; /* Ensure container takes up most of the viewport height */
}

/* Sidebar (Left Column) */
.sidebar {
    width: 280px; /* Fixed width for sidebar */
    flex-shrink: 0; /* Prevent sidebar from shrinking */
    background-color: #fff; /* Dark background for sidebar */
    color: #333;
    padding: 20px;
    position: sticky; /* Make sidebar sticky */
    top: 20px; /* Stick to the top, considering body padding */
    height: calc(
        90vh - 40px
    ); /* Adjust height considering padding and potential footer */
    overflow-y: auto; /* Allow scrolling if content exceeds height */
}

.profile {
    text-align: center;
    margin-bottom: 20px;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 3px solid #555;
}

.profile h1 {
    font-family: "Oswald", sans-serif;
    font-size: 1.8em;
    margin-bottom: 5px;
    color: #333;
}

.profile p {
    font-size: 0.9em;
    margin-bottom: 5px;
    color: #333;
}

.profile p a {
    color: #007bff; /* Light blue for links - will inherit from general 'a' */
    /* text-decoration: none; */ /* Will inherit */
}

/* Styles for the new profile affiliations section */
.profile-affiliations a {
    display: block; /* Each affiliation on a new line */
    font-size: 0.85em; /* Smaller font size */
    margin-bottom: 3px; /* Space between affiliations */
    color: #007bff; /* Consistent link color */
    /* text-decoration: none; will inherit */
}

/* .profile-affiliations a:hover { */
/* text-decoration: underline; will inherit */
/* } */

.profile .university-affiliation a {
    font-family: "Oswald", sans-serif;
    font-size: 0.9em; /* Reduced font size */
    color: #00509e; /* Specific blue for university affiliation */
    /* text-decoration: none; */ /* Will inherit */
    font-weight: bold; /* Make it bold */
}

/* .profile .university-affiliation a:hover { */
/* text-decoration: underline; */ /* Will inherit */
/* } */

.profile .other-affiliations {
    list-style-type: none; /* Remove bullets */
    padding-left: 0; /* Remove default padding */
    text-align: left; /* Align text to the left */
    margin-top: 5px; /* Add some space above this list */
}

.profile .other-affiliations li {
    margin-bottom: 2px; /* Reduced space between items */
}

.profile .other-affiliations li a {
    font-size: 0.8em; /* Reduced font size */
    color: #555; /* Darker grey for a subtle look - specific color preserved */
    /* text-decoration: none; */ /* Will inherit */
    font-style: italic; /* Italicize for distinction */
}

/* .profile .other-affiliations li a:hover { */
/* text-decoration: underline; */ /* Will inherit */
/* } */

/* .profile p a:hover { */
/* text-decoration: underline; */ /* Will inherit */
/* } */

.contact-info {
    border: 1px solid #ccc; /* Light grey border */
    background-color: #f9f9f9; /* Very light grey background */
    padding: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
    margin-left: 15px; /* Added left margin for symmetry */
    margin-right: 15px; /* Existing right margin */
    border-radius: 4px; /* Rounded corners */
    text-align: left; /* Align text to the left */
}

.contact-info h4 {
    font-family: "Oswald", sans-serif;
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 8px;
    color: #333;
}

.contact-info p {
    font-size: 0.85em;
    margin-bottom: 4px;
    line-height: 1.4;
}

.contact-info p strong {
    font-weight: bold;
}

.contact-info a {
    color: #007bff; /* Standard link color - will inherit */
    /* text-decoration: none; */ /* Will inherit */
}

/* Specific style for email links within contact-info */
.contact-info p a[href^="mailto:"] {
    color: #7db0db;
}

/* .contact-info a:hover { */
/* text-decoration: underline; */ /* Will inherit */
/* } */

.social-links {
    text-align: center; /* Center the icons within the div */
    margin-top: 10px; /* Add some space above the icons */
    margin-bottom: 10px; /* Add some space below the icons */
}

.social-links .icon-link {
    margin-left: 5px; /* Adjust spacing between icons */
    margin-right: 5px; /* Adjust spacing between icons */
}

nav ul {
    list-style: none;
}

nav ul li {
    /* display: flex; */ /* Flex properties moved to 'a' tag */
    /* align-items: center; */ /* Flex properties moved to 'a' tag */
    margin-bottom: 5px; /* Maintain original margin-bottom for spacing between nav items */
}

nav ul li a {
    display: flex; /* Make 'a' tag a flex container */
    align-items: center; /* Vertically align icon and text within 'a' */
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 5px;
    font-family:
        "Merriweather", serif; /* Consistent with body, but can be overridden */
    font-weight: bold; /* Visually distinct for navigation */
}

nav ul li a:hover,
nav ul li a.active {
    background-color: #eee;
}

nav ul li img.nav-icon {
    width: 16px; /* Or your preferred size */
    height: 16px; /* Or your preferred size */
    margin-right: 8px; /* Space between icon and text */
}

/* Content (Right Column) */
.content {
    flex-grow: 1; /* Allow content to take remaining space */
    padding: 30px;
    overflow-y: auto; /* Allow content area to scroll independently */
}

.content section {
    margin-bottom: 30px;
}

.content h2 {
    font-family: "Oswald", sans-serif; /* New font */
    text-transform: uppercase; /* All caps */
    color: #002d72; /* Heritage blue */
    font-size: 1.8em; /* Adjusted font size */
    margin-bottom: 10px; /* Reduced margin */
    padding-bottom: 3px; /* Reduced padding */
    /* border-bottom: none; */ /* Removed border */
}

/* Publications List */
#publications ul {
    list-style: none;
}

#publications li {
    background-color: #f9f9f9;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    border-left: 5px solid #7db0db;
}

#publications h3 {
    font-size: 1.2em;
    margin-bottom: 5px;
    color: #333;
}

#publications p {
    margin-bottom: 5px;
    font-size: 0.95em;
}

#publications p em {
    color: #555;
}

#publications a {
    color: #007bff; /* Default link color within publications, will be overridden by more specific rules */
    /* text-decoration: none; */ /* Will inherit */
}

/* Specific color for co-author links */
#publications li em a {
    color: #7db0db;
}

/* Specific color for year links */
#publications p a[href*="years/year_"] {
    color: #7db0db;
}

/* #publications a:hover { */
/* text-decoration: underline; */ /* Will inherit */
/* } */

/* Styling for abstract toggle */
#publications details summary {
    cursor: pointer;
    display: inline-block; /* To prevent full-width click area if h3 is block */
}

#publications details summary h3 {
    display: inline; /* Keep h3 styling but allow it within summary */
    margin-bottom: 5px; /* Retain original margin for consistency */
    color: inherit; /* Ensure it doesn't pick up link colors */
    text-decoration: none; /* Ensure no underline */
}

#publications details summary {
    cursor: pointer;
    display: flex; /* Use flexbox to align items inline */
    align-items: center; /* Vertically align items in the middle */
    color: inherit; /* Ensure it doesn't pick up link colors */
    text-decoration: none; /* Ensure no underline */
    list-style-type: none; /* Remove default marker for most browsers */
}

#publications details summary::-ms-expand {
    /* Hide default marker for IE/Edge */
    display: none;
}

/* Explicitly hide the default disclosure marker/arrow for Webkit/Blink and Firefox */
#publications details summary::marker,
#publications details summary::-webkit-details-marker {
    display: none;
    content: ""; /* Also try to remove content for good measure */
}

/* Custom marker using ::before */
#publications details summary::before {
    content: "▶"; /* Default state: right-pointing triangle */
    display: inline-block;
    margin-right: 8px; /* Space between marker and title */
    font-size: 0.9em; /* Adjust size as needed */
    color: #333; /* Marker color */
    transition: transform 0.2s ease-in-out; /* Smooth rotation for open/close */
    flex-shrink: 0; /* Prevent marker from shrinking if title is long */
}

#publications details[open] > summary::before {
    transform: rotate(90deg); /* Rotated state: down-pointing triangle */
}

/* Ensure the main "Recent Work" h2 is not styled as a link */
#publications > h2 {
    color: #002d72; /* Reset to its original intended color (from .content h2) */
    text-decoration: none; /* Ensure no underline */
}

#publications details .abstract-content {
    margin-top: 10px; /* Space above abstract */
    margin-bottom: 10px; /* Space below abstract */
    padding-left: 20px; /* Indent abstract slightly */
    border-left: 2px solid #eee; /* Subtle left border */
}

.researcher-name {
    font-weight: bold; /* Ensure the name is bold */
    /* color and font-style will inherit from parent or default, ensuring no override from here */
}

.publication-year {
    font-size: 1.05em; /* Slightly larger font */
    background-color: #f0f0f0; /* Light grey background */
    padding: 2px 5px; /* Some padding */
    border-radius: 3px; /* Rounded corners */
    font-weight: bold; /* Make it bold to stand out more */
}

.icon-link {
    margin-left: 8px; /* Add some space between icons/links */
    display: inline-block; /* Helps with vertical alignment and spacing */
}

.icon {
    height: 1.2em; /* Adjust size as needed */
    width: auto; /* Adjust size as needed */
    vertical-align: middle; /* Align icons nicely with text if any */
}

.pdf-icon {
    height: 1.5em;
}

.bibtex-icon {
    height: 1.5em;
}

/* Collaborators Grid */
.collaborators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.collaborator-card {
    background-color: #f9f9f9;
    padding: 15px;
    text-align: center;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.collaborator-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid #ddd;
}

.collaborator-card h3 {
    font-size: 1.1em;
    margin-bottom: 5px;
}

.collaborator-card h3 a {
    color: #007bff; /* Will inherit */
    /* text-decoration: none; */ /* Will inherit */
}
/* .collaborator-card h3 a:hover { */
/* text-decoration: underline; */ /* Will inherit */
/* } */

.collaborator-card p {
    font-size: 0.9em;
    color: #666;
}

/* Publication Tags */
.tags {
    margin-top: 10px;
}

.tag {
    display: inline-block;
    padding: 3px 8px;
    margin-right: 5px;
    margin-bottom: 5px; /* Added margin to bottom for wrapping */
    border-radius: 4px;
    font-size: 0.85em;
    color: #fff; /* White text for good contrast on colored backgrounds */
    font-family: "Oswald", sans-serif;
    text-transform: uppercase;
}

a.tag {
    color: #fff;
}

.all-tags-list a.tag {
    color: #fff !important;
}

/* Footer */
footer {
    text-align: center;
    padding: 15px;
    background-color: #fff;
    color: #333;
    font-size: 0.8em;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto; /* Center footer if body padding is removed for footer */
    position: sticky; /* Stick footer to bottom */
    bottom: 0;
}

/* Responsive adjustments (optional basic example) */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        width: 100%;
        min-height: auto; /* Adjust min-height for smaller screens */
    }

    .sidebar {
        width: 100%;
        position: static; /* Remove sticky positioning */
        height: auto; /* Adjust height */
        margin-bottom: 0px; /* Reduced for less vertical space */
        padding-left: 15px; /* Add padding for content inside */
        padding-right: 15px; /* Add padding for content inside */
        /* box-sizing: border-box; is globally set, ensuring padding is included in width */
    }

    .profile-pic {
        width: 120px;
        height: 120px;
    }

    .content {
        padding: 20px;
    }

    .contact-info {
        /* Specific adjustment for contact-info in vertical layout */
        margin-left: 0; /* Rely on sidebar padding */
        margin-right: 0; /* Rely on sidebar padding */
        margin-bottom: 10px;
        /* margin-top will be inherited from the default style (15px) */
        background-color: transparent; /* Remove grey background on mobile */
        border: none; /* Remove border on mobile */
    }

    footer {
        width: 100%;
        position: static; /* Remove sticky positioning */
    }
}
