/* ===== PLRG @ UNIST — Stylesheet ===== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&family=DM+Serif+Display&display=swap');

/* --- Tokens --- */
:root {
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;

    --sidebar-w: 260px;
    --content-max: 820px;
    --gap: 48px;
    --radius: 6px;
}

/* Light palette (default) */
:root {
    --bg: #f7f6f3;
    --bg-sidebar: #1e2228;
    --bg-card: #ffffff;
    --text: #2a2d33;
    --text-secondary: #6b6e76;
    --text-sidebar: #9298a4;
    --text-sidebar-active: #ffffff;
    --accent: #3074c8;
    --accent-hover: #2460a8;
    --link: #3074c8;
    --link-hover: #2460a8;
    --border: #e4e3df;
    --rule: #dcdad5;
    --tag-bg: #eeedea;
    --tag-text: #6b6e76;
    --sidebar-accent: #4a90d9;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #18191c;
        --bg-sidebar: #111214;
        --bg-card: #222328;
        --text: #dcdde2;
        --text-secondary: #909399;
        --text-sidebar: #6b7080;
        --text-sidebar-active: #f0f1f4;
        --accent: #5a9ee6;
        --accent-hover: #78b2f0;
        --link: #6aa5e8;
        --link-hover: #78b2f0;
        --border: #2e3038;
        --rule: #282a30;
        --tag-bg: #28292f;
        --tag-text: #909399;
        --sidebar-accent: #5a9ee6;
    }
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    min-height: 100vh;
}

/* --- Layout Shell --- */
.page {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 40px 28px 32px;
    overflow-y: auto;
    border-right: 3px solid var(--sidebar-accent);
}

.sidebar-brand {
    margin-bottom: 36px;
}

.sidebar-brand .lab-name {
    font-family: var(--font-display);
    font-size: 1.65rem;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.02em;
    line-height: 1.2;
    display: block;
}

.sidebar-brand .lab-affiliation {
    font-size: 0.78rem;
    color: var(--text-sidebar);
    margin-top: 6px;
    line-height: 1.45;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-weight: 500;
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav a {
    display: block;
    padding: 9px 14px;
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: color 0.2s, background 0.2s;
    letter-spacing: 0.01em;
}

.sidebar-nav a:hover {
    color: var(--text-sidebar-active);
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-nav a.active {
    color: var(--text-sidebar-active);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    font-size: 0.72rem;
    color: var(--text-sidebar);
    line-height: 1.5;
    opacity: 0.6;
}

/* --- Main Content --- */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: var(--gap) var(--gap) 80px;
    max-width: calc(var(--content-max) + var(--gap) * 2);
}

/* --- Typography --- */
h1 {
    font-family: var(--font-display);
    font-size: 2.15rem;
    font-weight: 400;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 12px;
}

h2 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 400;
    line-height: 1.3;
    color: var(--text);
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* Make h2 span full width while keeping border inline */
.section h2 {
    display: block;
}
.section h2::after {
    content: none;
}

h3 {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 28px;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

p {
    margin-bottom: 10px;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--link-hover);
}

/* --- Intro / Hero --- */
.intro {
    margin-bottom: 40px;
}

.intro p {
    font-size: 1.08rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.intro p:first-of-type {
    font-size: 1.15rem;
    color: var(--text);
}

/* --- Sections --- */
.section {
    margin-bottom: 40px;
}

.section h2 {
    border-bottom: 2px solid var(--accent);
    padding-bottom: 6px;
    margin-bottom: 20px;
}

/* --- Research areas --- */
.research-areas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.research-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
}

.research-card h3 {
    margin: 0 0 6px;
    font-size: 0.95rem;
}

.research-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* --- News --- */
.news-list {
    list-style: none;
}

.news-list li {
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
    display: flex;
    gap: 16px;
    align-items: baseline;
}

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

.news-date {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 90px;
    font-variant-numeric: tabular-nums;
}

.news-text {
    font-size: 0.95rem;
}

/* --- Publications --- */
.pub-year {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--accent);
    margin-top: 32px;
    margin-bottom: 14px;
    letter-spacing: 0.02em;
}

.pub-year:first-of-type {
    margin-top: 8px;
}

.pub-entry {
    margin-bottom: 20px;
    padding-left: 16px;
    border-left: 3px solid var(--border);
}

.pub-entry:hover {
    border-left-color: var(--accent);
}

.pub-title {
    font-weight: 700;
    font-size: 0.97rem;
    line-height: 1.5;
}

.pub-authors {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.pub-venue {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 1px;
}

.pub-links {
    margin-top: 5px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pub-links a {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--link);
    padding: 2px 8px;
    background: var(--tag-bg);
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.pub-links a:hover {
    color: var(--link-hover);
    background: var(--border);
}

/* --- Members --- */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 12px;
}

.member-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    transition: border-color 0.2s;
    position: relative;
}

.member-card:hover {
    border-color: var(--accent);
    cursor: pointer;
}

.member-card .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--tag-bg);
    flex-shrink: 0;
    object-fit: cover;
}

.member-card .info h3 {
    margin: 0;
    font-size: 1.02rem;
}

.member-card .info h3 a {
    color: var(--text);
}

.member-card .info h3 a::after {
    content: '';
    position: absolute;
    inset: 0;
}

.member-card .info h3 a:hover {
    color: var(--link-hover);
}

.member-card .info .role {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.member-card .info .member-links {
    margin-top: 8px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.member-card .info .member-links a {
    font-size: 0.82rem;
    color: var(--link);
}

/* --- Member Profile Page --- */
.profile-header {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    margin-bottom: 32px;
}

.profile-header .avatar-lg {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--tag-bg);
    flex-shrink: 0;
    object-fit: cover;
}

.profile-header .profile-info h1 {
    margin-bottom: 4px;
}

.profile-header .profile-info .title {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.profile-header .profile-info .contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.profile-header .profile-info .contact-links a {
    font-size: 0.88rem;
    color: var(--link);
}

.bio {
    max-width: 660px;
    line-height: 1.8;
    margin-bottom: 32px;
}

.bio p {
    margin-bottom: 12px;
}

/* --- Callout box --- */
.callout {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px 28px;
}

.callout h2 {
    margin-top: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* --- Detail lines (indented sub-items) --- */
p.detail {
    margin-left: 20px;
    margin-bottom: 8px;
}

/* --- Footer --- */
.footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    :root {
        --sidebar-w: 0px;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 3px solid var(--sidebar-accent);
        padding: 24px 20px;
    }

    .sidebar-brand {
        margin-bottom: 16px;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    .sidebar-nav a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .sidebar-footer {
        display: none;
    }

    .page {
        flex-direction: column;
    }

    .main {
        margin-left: 0;
        padding: 28px 20px 60px;
    }

    h1 { font-size: 1.7rem; }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .research-areas {
        grid-template-columns: 1fr;
    }

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