/* ── SISL Lab shared stylesheet ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #ffffff;
    --bg-nav: #ffffff;
    --text: #111111;
    --text-muted: #555555;
    --link: #1a56db;
    --link-hover: #0e3a9e;
    --accent: #e63312;
    --border: #e0e0e0;
    --section-gap: 4rem;
    --max-w: 1100px;
}
[data-theme="dark"] {
    --bg: #111111;
    --bg-nav: #0d0d0d;
    --text: #ededed;
    --text-muted: #888888;
    --link: #7aabff;
    --link-hover: #a8c8ff;
    --accent: #ff6e50;
    --border: #2c2c2c;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.75;
    transition: background 0.25s, color 0.25s;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* ── Nav ── */
nav {
    position: sticky;
    top: 0;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    transition: background 0.25s, border-color 0.25s;
    z-index: 100;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.nav-brand img { width: 32px; height: 32px; border-radius: 6px; }
.nav-brand:hover { color: var(--accent); text-decoration: none; }
.nav-links { display: flex; gap: 1.75rem; list-style: none; flex-wrap: wrap; }
.nav-links a {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
}
.nav-links a:hover { color: var(--link); }
.nav-links a.active {
    color: var(--text);
    font-weight: 700;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 1px;
}

/* ── Theme toggle ── */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: border-color 0.2s, color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-muted); }

/* ── Page wrapper ── */
main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 3rem 1.5rem 6rem;
}

/* ── Section headings ── */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--text);
}
.page-intro { margin-bottom: 2rem; color: var(--text-muted); }

/* ── Badge ── */
.badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 0.3rem;
    vertical-align: middle;
}

/* ── Footer ── */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
footer a { color: var(--text-muted); }
footer p + p { margin-top: 0.3rem; }

/* ── Hero (About page) ── */
.hero { margin-bottom: var(--section-gap); }
.hero-header { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 0.25rem; }
.hero-header img { width: 72px; height: 72px; border-radius: 14px; flex-shrink: 0; }
.hero h1 { font-size: 2rem; font-weight: 700; line-height: 1.25; margin-bottom: 0; }
.hero .subtitle { color: var(--text-muted); font-size: 1rem; margin-bottom: 1.5rem; }
.hero p { margin-bottom: 1rem; }

/* ── Photo mosaic ── */
.mosaic {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 190px);
    gap: 4px;
    margin: 2rem 0 0.75rem;
    border-radius: 6px;
    overflow: hidden;
}
.mosaic a { display: block; overflow: hidden; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.mosaic a:hover img { transform: scale(1.04); }
.mosaic-caption { font-size: 0.82rem; color: var(--text-muted); text-align: center; margin-bottom: 0; }

/* ── News ── */
.news-list { list-style: none; }
.news-list li {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.97rem;
}
.news-list li:first-child { border-top: 1px solid var(--border); }
.news-date { font-weight: 600; color: var(--text); margin-right: 0.4rem; }

/* ── Research ── */
.research-areas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 1.5rem; }
.research-area { border-top: 3px solid var(--accent); padding-top: 1rem; }
.research-area .area-icon { font-size: 1.6rem; margin-bottom: 0.5rem; display: block; }
.research-area h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; }
.research-area p { font-size: 0.92rem; color: var(--text-muted); line-height: 1.65; }
.research-pubs { margin-top: 0.75rem; font-size: 0.85rem; }
.research-pubs a { color: var(--link); margin-right: 0.5rem; }

/* ── Publications ── */
.pub-note { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.pub-entry {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 1.5rem;
    align-items: start;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}
.pub-entry:first-of-type { border-top: 1px solid var(--border); }
.pub-title { font-weight: 600; font-size: 1rem; color: var(--text); margin-bottom: 0.2rem; }
.pub-venue { font-size: 0.85rem; font-weight: 600; color: var(--accent); margin-bottom: 0.2rem; }
.pub-authors { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.pub-abstract { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.pub-links a { font-size: 0.82rem; font-weight: 500; margin-right: 0.75rem; color: var(--link); }
.pub-img {
    width: 200px; height: 135px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* ── Team ── */
.team-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; margin-top: 1.25rem; }
.team-member { text-align: center; }
.team-member img {
    width: 90px; height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    margin-bottom: 0.5rem;
}
.member-name { font-size: 0.9rem; font-weight: 600; line-height: 1.3; }
.member-role { font-size: 0.8rem; color: var(--text-muted); }
.alumni-note { font-size: 0.75rem; color: var(--link); }
.team-subhead { font-size: 1.1rem; font-weight: 600; margin: 2.5rem 0 0.75rem; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }

/* ── Join Us ── */
.join-box {
    border-left: 4px solid var(--accent);
    padding: 1.5rem 2rem;
    margin-top: 2rem;
    background: transparent;
}
.join-box p { margin-bottom: 0.75rem; }
.join-box ul { margin: 0.5rem 0 1rem 1.5rem; font-size: 0.97rem; }
.join-box li { margin-bottom: 0.3rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .research-areas { grid-template-columns: 1fr; }
    .team-grid { grid-template-columns: repeat(3, 1fr); }
    .pub-entry { grid-template-columns: 1fr; }
    .pub-img { width: 100%; height: 200px; }
}
@media (max-width: 560px) {
    .mosaic { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 130px); }
    .team-grid { grid-template-columns: repeat(2, 1fr); }
    nav { flex-wrap: wrap; }
    .nav-links { gap: 1rem; }
}
