/* People Page Styles - Redesigned */

/* ========================================
   Member Card Grid Layout
   ======================================== */

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.members-grid--single {
    grid-template-columns: 1fr;
    max-width: 800px;
}

/* ========================================
   Member Card Component
   ======================================== */

.member-card {
    background: #fafafa;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e8e8e8;
}

.member-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}


/* ========================================
   Row 1: Photo, Name, Role, Links
   ======================================== */

.member-card__row1 {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
}

.member-card__photo {
    flex-shrink: 0;
}

.member-card__photo img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


/* Header with name, role, and links */
.member-card__header {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* ========================================
   Row 2: Bio and Papers
   ======================================== */

.member-card__row2 {
    border-top: 1px solid #e8e8e8;
    padding-top: 1rem;
}

.member-card__name {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    color: #1a1a1a;
    line-height: 1.3;
}

.member-card__name-ko {
    font-weight: 400;
    color: #666;
    font-size: 0.95em;
}

/* Social Links */
.member-card__links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.member-card__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.member-card__link:hover {
    background: #004191;
    border-color: #004191;
    transform: scale(1.1);
}

.member-card__link img {
    width: 22px;
    height: 22px;
    filter: brightness(0) saturate(100%) invert(40%) sepia(0%) saturate(0%) brightness(90%);
    transition: filter 0.2s ease;
}

.member-card__link:hover img {
    filter: brightness(0) invert(1);
}

/* Role Badge */
.member-card__role {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.member-card__role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    background: #e8f4fd;
    color: #0066cc;
}

/* Role-specific colors */
.member-card__role-badge--pi {
    background: #fef3c7;
    color: #92400e;
}

.member-card__role-badge--phd {
    background: #dbeafe;
    color: #1e40af;
}

.member-card__role-badge--ms {
    background: #d1fae5;
    color: #065f46;
}

.member-card__dept {
    font-size: 0.8rem;
    color: #666;
    padding: 0.2rem 0.5rem;
    background: #f0f0f0;
    border-radius: 4px;
}

/* Bio Text */
.member-card__bio {
    font-size: inherit;
    line-height: 1.6;
    color: #444;
    margin: 0.5rem 0 0 0;
}

/* Advisor Note */
.member-card__advisor {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin: 0.25rem 0 0 0;
}

.member-card__advisor a {
    color: #0066cc;
}

/* Publications Section */
.member-card__publications {
    margin-top: 0.75rem;
}

/* ========================================
   Role Section Headers
   ======================================== */

.role-section {
    margin: 3rem 0 1.5rem 0;
}

.role-section__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #004191;
    display: inline-block;
    margin-bottom: 0;
}

/* ========================================
   Undergraduate & Alumni Sections
   ======================================== */

.undergrad-list,
.alumni-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.undergrad-list li,
.alumni-list li {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: #fafafa;
    border-radius: 8px;
    border-left: 3px solid #004191;
    transition: background 0.2s ease;
}

.undergrad-list li:hover,
.alumni-list li:hover {
    background: #f0f4f8;
}

.undergrad-list li a,
.alumni-list li a {
    font-weight: 500;
    color: #004191;
}

/* Compact bullet lists for markdown sections */
h2 + ul,
h3 + ul {
    margin-top: 0.5rem !important;
    margin-bottom: 1.5rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

h2 + ul li,
h3 + ul li {
    margin-bottom: 0.5rem !important;
    padding: 0.5rem 0 !important;
    line-height: 1.5 !important;
    border-bottom: 1px solid #eee;
}

h2 + ul li:last-child,
h3 + ul li:last-child {
    border-bottom: none;
}

h2 + ul li p,
h3 + ul li p {
    margin: 0 !important;
    padding: 0 !important;
}

/* ========================================
   Legacy Profile Icon Styles (for compatibility)
   ======================================== */

.profile-icon {
    display: inline-block;
    color: #555;
    margin-right: 8px;
    vertical-align: middle;
    transition: color 0.2s ease, transform 0.2s ease;
}

.profile-icon:hover {
    color: #004191;
    transform: scale(1.15);
}

.profile-icon img {
    vertical-align: middle;
    filter: brightness(0) saturate(100%) invert(40%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%);
    transition: filter 0.2s ease;
}

.profile-icon:hover img {
    filter: brightness(0) saturate(100%) invert(18%) sepia(98%) saturate(1800%) hue-rotate(210deg) brightness(90%);
}

/* ========================================
   Member Publications Styles
   ======================================== */

.member-publications {
    display: block;
    overflow: hidden;
}

.member-publications details.papers-details {
    display: inline;
}

.member-publications summary.papers-toggle {
    display: inline-block;
    cursor: pointer;
    list-style: none;
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #004191;
    background-color: #e8f4fd;
    border: 1px solid #b8d4f0;
    border-radius: 20px;
    padding: 0.4rem 0.9rem;
    transition: all 0.2s ease;
}

.member-publications summary.papers-toggle::-webkit-details-marker {
    display: none;
}

.member-publications summary.papers-toggle:hover {
    color: white;
    background-color: #004191;
    border-color: #004191;
}

.member-publications ul.member-pub-list {
    display: block;
    margin-top: 0.75rem;
    margin-left: 0;
    padding-left: 1.25em;
    font-size: inherit;
    list-style-position: outside;
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1rem 1rem 2rem;
    border: 1px solid #e8e8e8;
}

.member-publications ul.member-pub-list li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.member-publications .klink,
.member-publications .abstract_button {
    font-family: 'Raleway', sans-serif;
    font-size: 70%;
    color: #004191;
    background-color: #fff;
    border: 1px solid #b8d4f0;
    border-radius: 4px;
    padding: 2px 6px;
    margin-right: 3px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.member-publications .klink:hover,
.member-publications .abstract_button:hover {
    color: white;
    background-color: #004191;
    border-color: #004191;
}

.member-publications .abstractbg {
    background-color: #f8fafc;
    padding: 12px;
    margin: 8px 0;
    border-radius: 6px;
    font-size: 0.85em;
    display: block;
    overflow-wrap: break-word;
    border-left: 3px solid #004191;
}

.member-publications .author-highlight {
    font-weight: 600;
    color: #004191;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 600px) {
    .member-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.25rem;
    }

    .member-card__header {
        justify-content: center;
    }

    .member-card__role {
        justify-content: center;
    }

    .member-card__photo img {
        width: 120px;
        height: 120px;
    }

    .members-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ========================================
   Dark Mode - System Preference
   ======================================== */

@media (prefers-color-scheme: dark) {
    body:not(.light-theme) .member-card {
        background: #2a2a2a;
        border-color: #404040;
    }

    body:not(.light-theme) .member-card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }


    body:not(.light-theme) .member-card__name {
        color: #e8e8e8;
    }

    body:not(.light-theme) .member-card__name-ko {
        color: #aaa;
    }

    body:not(.light-theme) .member-card__bio {
        color: #bbb;
    }

    body:not(.light-theme) .member-card__advisor {
        color: #999;
    }

    body:not(.light-theme) .member-card__link {
        background: #3a3a3a;
        border-color: #555;
    }

    body:not(.light-theme) .member-card__link:hover {
        background: #5FBEEB;
        border-color: #5FBEEB;
    }

    body:not(.light-theme) .member-card__link img {
        filter: brightness(0) saturate(100%) invert(75%) sepia(0%) saturate(0%) brightness(100%);
    }

    body:not(.light-theme) .member-card__link:hover img {
        filter: brightness(0) invert(0.1);
    }

    body:not(.light-theme) .member-card__role-badge {
        background: #1e3a5f;
        color: #7cb8e8;
    }

    body:not(.light-theme) .member-card__role-badge--pi {
        background: #78350f;
        color: #fcd34d;
    }

    body:not(.light-theme) .member-card__role-badge--phd {
        background: #1e3a8a;
        color: #93c5fd;
    }

    body:not(.light-theme) .member-card__role-badge--ms {
        background: #064e3b;
        color: #6ee7b7;
    }

    body:not(.light-theme) .member-card__dept {
        background: #3a3a3a;
        color: #aaa;
    }

    body:not(.light-theme) .member-card__photo img {
        border-color: #404040;
    }

    body:not(.light-theme) .member-card__row2 {
        border-top-color: #404040;
    }

    body:not(.light-theme) .role-section__title {
        color: #ddd;
        border-bottom-color: #5FBEEB;
    }

    body:not(.light-theme) h2 + ul li,
    body:not(.light-theme) h3 + ul li {
        border-bottom-color: #444;
    }

    body:not(.light-theme) .profile-icon {
        color: #aaa;
    }

    body:not(.light-theme) .profile-icon:hover {
        color: #5FBEEB;
    }

    body:not(.light-theme) .profile-icon img {
        filter: brightness(0) saturate(100%) invert(75%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%);
    }

    body:not(.light-theme) .profile-icon:hover img {
        filter: brightness(0) saturate(100%) invert(70%) sepia(50%) saturate(500%) hue-rotate(165deg) brightness(105%);
    }

    body:not(.light-theme) .member-publications summary.papers-toggle {
        color: #7cb8e8;
        background-color: #1e3a5f;
        border-color: #3a5a7f;
    }

    body:not(.light-theme) .member-publications summary.papers-toggle:hover {
        background-color: #5FBEEB;
        border-color: #5FBEEB;
        color: #1a1a1a;
    }

    body:not(.light-theme) .member-publications ul.member-pub-list {
        background: #333;
        border-color: #444;
    }

    body:not(.light-theme) .member-publications .klink,
    body:not(.light-theme) .member-publications .abstract_button {
        color: #7cb8e8;
        background-color: #2a2a2a;
        border-color: #3a5a7f;
    }

    body:not(.light-theme) .member-publications .klink:hover,
    body:not(.light-theme) .member-publications .abstract_button:hover {
        background-color: #5FBEEB;
        border-color: #5FBEEB;
        color: #1a1a1a;
    }

    body:not(.light-theme) .member-publications .abstractbg {
        background-color: #333;
        border-left-color: #5FBEEB;
    }

    body:not(.light-theme) .member-publications .author-highlight {
        color: #5FBEEB;
    }
}

/* ========================================
   Dark Mode - Manual Toggle
   ======================================== */

body.dark-theme .member-card {
    background: #2a2a2a;
    border-color: #404040;
}

body.dark-theme .member-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

body.dark-theme .member-card__name {
    color: #e8e8e8;
}

body.dark-theme .member-card__name-ko {
    color: #aaa;
}

body.dark-theme .member-card__bio {
    color: #bbb;
}

body.dark-theme .member-card__advisor {
    color: #999;
}

body.dark-theme .member-card__link {
    background: #3a3a3a;
    border-color: #555;
}

body.dark-theme .member-card__link:hover {
    background: #5FBEEB;
    border-color: #5FBEEB;
}

body.dark-theme .member-card__link img {
    filter: brightness(0) saturate(100%) invert(75%) sepia(0%) saturate(0%) brightness(100%);
}

body.dark-theme .member-card__link:hover img {
    filter: brightness(0) invert(0.1);
}

body.dark-theme .member-card__role-badge {
    background: #1e3a5f;
    color: #7cb8e8;
}

body.dark-theme .member-card__role-badge--pi {
    background: #78350f;
    color: #fcd34d;
}

body.dark-theme .member-card__role-badge--phd {
    background: #1e3a8a;
    color: #93c5fd;
}

body.dark-theme .member-card__role-badge--ms {
    background: #064e3b;
    color: #6ee7b7;
}

body.dark-theme .member-card__dept {
    background: #3a3a3a;
    color: #aaa;
}

body.dark-theme .member-card__photo img {
    border-color: #404040;
}

body.dark-theme .member-card__row2 {
    border-top-color: #404040;
}

body.dark-theme .role-section__title {
    color: #ddd;
    border-bottom-color: #5FBEEB;
}

body.dark-theme h2 + ul li,
body.dark-theme h3 + ul li {
    border-bottom-color: #444;
}

body.dark-theme .profile-icon {
    color: #aaa;
}

body.dark-theme .profile-icon:hover {
    color: #5FBEEB;
}

body.dark-theme .profile-icon img {
    filter: brightness(0) saturate(100%) invert(75%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%);
}

body.dark-theme .profile-icon:hover img {
    filter: brightness(0) saturate(100%) invert(70%) sepia(50%) saturate(500%) hue-rotate(165deg) brightness(105%);
}

body.dark-theme .member-publications summary.papers-toggle {
    color: #7cb8e8;
    background-color: #1e3a5f;
    border-color: #3a5a7f;
}

body.dark-theme .member-publications summary.papers-toggle:hover {
    background-color: #5FBEEB;
    border-color: #5FBEEB;
    color: #1a1a1a;
}

body.dark-theme .member-publications ul.member-pub-list {
    background: #333;
    border-color: #444;
}

body.dark-theme .member-publications .klink,
body.dark-theme .member-publications .abstract_button {
    color: #7cb8e8;
    background-color: #2a2a2a;
    border-color: #3a5a7f;
}

body.dark-theme .member-publications .klink:hover,
body.dark-theme .member-publications .abstract_button:hover {
    background-color: #5FBEEB;
    border-color: #5FBEEB;
    color: #1a1a1a;
}

body.dark-theme .member-publications .abstractbg {
    background-color: #333;
    border-left-color: #5FBEEB;
}

body.dark-theme .member-publications .author-highlight {
    color: #5FBEEB;
}
