@import "common_vars.css";

/* people page common styling */

/* people container */
.people-container {
    max-width: 100%;
    margin: 0 auto;
}

/* Main page title styling */
.page-title {
    color: var(--PI-darkred);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--PI-sand);
    padding-bottom: 0.5rem;
}

/* Subtitle for people sections */
.subtitle {
    font-weight: bold;
    color: #555;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;;
}

/* Simple people Navigation */
.pep-nav-container {
    margin: 1rem 0 2rem 0;
    text-align: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
    position: relative; /* For absolute positioning of toggle button */
}

.pep-nav-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
}

.pep-nav-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem 0;
    align-items: center;
}

.pep-nav-links a {
    color: var(--PI-darkred);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Separator between links - as separate element */
.pep-nav-separator {
    color: #aaa;
    padding: 0  0.25rem;
}

.pep-nav-links a:hover {
    color: var(--PI-red);
}

.pep-nav-links a:active {
    font-weight: 700;
    color: var(--PI-red);
}

/* Toggle button styles */
.pep-nav-toggle {
    display: none;
    background: transparent;
    color: #777;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    position: absolute;
    right: 0;
    top: 0;
    transition: all 0.2s ease, box-shadow 0.2s ease;
    z-index: 20;
}

.pep-nav-toggle:hover {
    color: var(--PI-darkred);
    border-color: var(--PI-darkred);
}

/* Add shadow when dropdown is open */
.pep-nav-toggle[aria-expanded="true"] {
    box-shadow: 0 0 6px rgba(0,0,0,0.2);
    border-color: var(--PI-darkred);
    color: var(--PI-darkred);
}

/* Mobile navigation */
@media (max-width: 870.98px) {
    /* Container styling for mobile */
    .pep-nav-container {
        border-bottom: none;
        margin: 0;
        padding: 0;
    }
    
    /* pep-nav-wrapper is now a sibling of the toggle button. */
    /* It no longer needs to be hidden, as nav-links inside it is display:none by default. */
    .pep-nav-wrapper {
        /* It can be display: block or rely on default block behavior. */
        /* If it needs specific layout for some reason (e.g. centering navLinks if it were static), style here. */
        /* For now, no specific style is needed as nav-links is absolute. */
    }
    
    /* Show toggle button */
    .pep-nav-toggle {
        display: block;
    }
    
    /* Dropdown menu positioning and styling */
    .pep-nav-links {
        display: none;
        position: absolute;
        right: 0;
        top: 50px; /* Position below the button */
        background-color: #fff;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        z-index: 10;
        padding: 0.5rem;
        min-width: 200px;
        flex-direction: column;
        align-items: flex-start;
        
        /* Animation properties */
        transform: translateY(-10px);
        opacity: 0;
        transition: transform 0.25s ease-out, opacity 0.25s ease-out;
        pointer-events: none;
    }
    
    /* Show dropdown with animation - Use .mobile-expanded class */
    .pep-nav-links.mobile-expanded { /* CHANGED from .active */
        display: flex;
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    
    .pep-nav-links a {
        padding: 0.5rem;
        width: 100%;
        text-align: left;
        border-radius: 3px;
    }
    
    .pep-nav-links a:hover {
        background-color: #f5f5f5;
    }
    
    /* Hide separators in mobile view */
    .pep-nav-separator {
        display: none;
    }
}

/* Ensure nav is always visible in desktop view */
@media (min-width: 871px) {
    .pep-nav-wrapper {
        display: flex !important; /* Force display in desktop mode */
    }
    
    .pep-nav-links {
        display: flex !important;
        opacity: 1 !important;
        position: static !important;
        transform: none !important;
        pointer-events: auto !important;
    }
    
    .pep-nav-toggle {
        display: none !important; /* Always hide toggle in desktop */
    }
}

/* people section header */
.people-section {
    padding-bottom: 0.5rem;
    scroll-margin-top: 100px; /* Add space for scrolling to section */
}

.people-section h2 {
    color: var(--PI-darkred);
    margin-bottom: 0;
    padding-bottom: 0.5rem;
}

/* Year dividers */
.people-year {
    margin: 1.3rem 0 1rem 0;
    background-color: var(--PI-sand);
    padding: 8px 15px;
    border-radius: 4px;
}

.people-year h3 {
    margin: 0;
    color: var(--PI-darkred);
}

/* people list */
ul.people {
    list-style-type: none;
    padding: 0;
    margin: 0 10px;
}

ul.people li {
    margin-bottom: 1rem;
    padding: 5px 15px;
    background-color: #fff;
    border-left: 4px solid var(--PI-red);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

ul.people li:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-left-color: var(--PI-darkred);
}

/* people title */
p.title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--PI-darkred);
}

/* Authors and links */
ul.people li a {
    display: inline-block;
    margin-top: 5px;
    color: var(--PI-red);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

/* people link styling for inline display */
.people-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 2em; /* row-gap column-gap */
    margin-top: 5px;
    position: relative;
    align-items: flex-end; /* Align items to bottom */
}

/* New approach: Make each direct child of people-links a relative container */
.people-links > * {
    position: relative;
    display: inline-flex;
    align-items: flex-end; /* Align contents to bottom */
}

/* Make the link-wrapper italic by default */
.people-links .link-wrapper {
    font-style: italic;
}

/* But keep the links themselves in normal style */
.people-links .link-wrapper a {
    font-style: normal;
}

/* Add separator after each direct child except the last one */
.people-links > *:not(:last-child)::after {
    content: "|";
    position: absolute;
    right: -1.1em; /* Position more centrally between items */
    bottom: 0; /* Align to bottom */
    color: #999;
}

ul.people li a:hover {
    color: var(--PI-darkred);
    text-decoration: underline;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    
    ul.people {
        margin: 0 0px;
    }
    ul.people li {
        padding: 5px 10px;
        font-size: 0.9rem;
    }
    
    p.title {
        font-size: 1.00rem;
    }
    
    .people-year h3 {
        font-size: 1.4rem;
    }
}

/* Styles for Theses Opportunities section (Bachelor/Master fetched content) */ 

/* General style for people section titles (used by Past Theses and potentially others) */
/* This h2.people-section-title is now primarily for the "Past Theses" section heading */
/* and acts as a base for the one inside .opportunity-section-box */
h2.people-section-title {
    color: var(--PI-darkred);
    margin-top: 2.5rem; 
    margin-bottom: 1rem; 
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--PI-sand); 
    text-align: left; 
}

/* New: The main encompassing box for ALL scraped opportunities */
.all-opportunities-box {
    border: 0px solid #c5c5c5; /* Main border for the encompassing box */
    border-radius: 6px; /* Rounded corners for the main box */
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
    background-color: #ffffff; /* Light background for the whole area */
    /*box-shadow: 0 3px 6px rgba(0,0,0,0.08); /* A slightly more pronounced shadow */
    /*padding: 10px; /* Padding inside the main box, around the section boxes */
}

/* Adjustments for individual section boxes when inside the main box */
.all-opportunities-box .opportunity-section-box {
    border: none; /* Remove individual border, main box has it */
    border-radius: 0; /* Remove individual radius */
    margin-top: 0; /* Remove top margin */
    margin-bottom: 10px; /* Space between Bachelor and Master sections if both present */
    background-color: transparent; /* Inherit background from parent or set to #fff if distinct inner bg needed */
    box-shadow: 0 3px 6px rgba(0,0,0,0.08); /* A slightly more pronounced shadow */
}
.all-opportunities-box .opportunity-section-box:last-child {
    margin-bottom: 0; /* No bottom margin for the last section box */
}


/* Styling for the h2 when it's a header of an opportunity box (inside all-opportunities-box) */
.all-opportunities-box .opportunity-section-box h2.people-section-title {
    margin-top: 0; 
    margin-bottom: 0; 
    padding: 10px 15px; 
    border-bottom: 1px solid #ddd; 
    background-color: var(--PI-sand); /* Slightly different background for section headers */
    border-top-left-radius: 4px; 
    border-top-right-radius: 4px;
    border-bottom-left-radius: 0; 
    border-bottom-right-radius: 0;
    color: var(--PI-darkred); /* Ensure color consistency */
}

/* Styling for the list of links within the opportunity box */
.all-opportunities-box .opportunity-section-box ul.opportunity-list {
    list-style-type: none; /* Remove bullet points */
    padding: 10px 15px 15px 15px; 
    margin: 0;
    background-color: #fff; /* White background for the list area */
    border: 1px solid #ddd; /* Border around the list part */
    border-top: none; /* Top border is handled by h2's bottom border */
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.all-opportunities-box .opportunity-section-box ul.opportunity-list li {
    padding: 6px 0; 
    border-bottom: 1px dotted #e8e8e8; 
}

.all-opportunities-box .opportunity-section-box ul.opportunity-list li:last-child {
    border-bottom: none; 
}

.all-opportunities-box .opportunity-section-box ul.opportunity-list li a {
    text-decoration: none;
    color: var(--PI-red);
    font-weight: normal; 
    display: block; 
    padding: 2px 0; /* Small padding for the link itself */
}

.all-opportunities-box .opportunity-section-box ul.opportunity-list li a:hover {
    text-decoration: underline;
    color: var(--PI-darkred);
}