/* --- CSS Variables (Theme Colors) --- */
:root {
    --primary-color: #0d47a1; /* 深い青 */
    --primary-light: #1976d2;
    --secondary-color: #B3E5FC; /* 明るい水色 */
    --dark-color: #212121;
    --gray-color: #666;
    --light-gray-color: #f4f4f4;
    --white-color: #fff;
    --header-height: 80px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--dark-color);
    background-color: var(--white-color);
    scroll-padding-top: var(--header-height); /* Smooth scroll offset */
}

h1, h2, h3, h4 {
    line-height: 1.3;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Layout & Reusable Classes --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-section {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--light-gray-color);
}

.text-center {
    text-align: center;
}

.section-lead {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--gray-color);
    text-align: center;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}
h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

/* --- Header & Navigation --- */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eee;
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-nav a {
    color: var(--dark-color);
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* --- 更新 --- */
.main-nav a.current-page {
    font-weight: 700;
    color: var(--primary-color);
}

/* --- Hero Section --- */
#hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url(https://via.placeholder.com/1920x1080/212121/FFFFFF?text=Lab+Background) no-repeat center center/cover;
    height: calc(100vh - var(--header-height));
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white-color);
    padding: 20px;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 20px;
}
.hero-content p {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}

/* --- Grid & Card Layout --- */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

/* --- 更新 --- */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block; /* カード全体をブロックとして扱う */
}

.card {
    background-color: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%; /* --- 追加 --- */
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.card-content {
    padding: 25px;
}
.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* --- Members Section --- */
.members-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.member-card {
    text-align: center;
}
.member-card img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 20px auto 0;
    object-fit: cover;
}
.member-card h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}
.member-card p {
    color: var(--gray-color);
}

/* --- Publications Section --- */
.publication-list {
    list-style: none;
    max-width: 800px;
    margin: 0 auto 40px;
}
.publication-list li {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}
.publication-list a {
    font-weight: 500;
}

.button-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 25px;
    border-radius: 5px;
    font-weight: 700;
    transition: all 0.3s;
}
.button-outline:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* --- Footer --- */
footer {
    background-color: var(--dark-color);
    color: var(--white-color);
    text-align: center;
    padding: 30px 20px;
}

/* --- Mobile Menu --- */
.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}
.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    margin: 5px 0;
    transition: all 0.3s;
}


/* --- Responsive Design --- */
@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }
    .main-nav {
        position: fixed; /* --- 変更 --- */
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--white-color);
        flex-direction: column;
        height: calc(100vh - var(--header-height));
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }
    .main-nav.is-open {
        transform: translateX(0);
    }
    .main-nav ul {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px;
        height: 100%;
    }
    .main-nav a {
        font-size: 1.5rem;
    }

    /* Hamburger to "X" animation */
    .menu-toggle.is-open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .menu-toggle.is-open span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.is-open span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
}

/* --- Subpage Header --- */
.page-header {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 60px 20px;
    text-align: center;
    margin-top: -80px; /* To sit behind the sticky header initially */
    padding-top: calc(var(--header-height) + 60px);
}
.page-header h1 {
    font-size: 2.8rem;
}

/* --- Detail Page Layout --- */
.detail-layout {
    display: flex;
    flex-direction: row-reverse; /* Sidebar on the right */
    gap: 40px;
}

.detail-main {
    flex: 1; /* Take remaining space */
}

.detail-sidebar {
    flex: 0 0 300px; /* Fixed width of 300px */
    position: sticky;
    top: calc(var(--header-height) + 40px); /* Stick under the header */
    align-self: flex-start; /* Stick to the top */
}

.sidebar-box {
    background-color: var(--light-gray-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.sidebar-box img {
    border-radius: 8px;
    width: 100%;
}

.sidebar-box h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
}

.sidebar-box ul {
    list-style: none;
}
.sidebar-box li {
    margin-bottom: 10px;
}
.sidebar-box strong {
    display: block;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.detail-main h2 {
    text-align: left;
    font-size: 1.8rem;
}
.detail-main h2::after {
    left: 0;
    transform: none;
}
.detail-main p {
    margin-bottom: 20px;
}

/* Responsive adjustment for detail pages */
@media (max-width: 992px) {
    .detail-layout {
        flex-direction: column;
    }
    .detail-sidebar {
        position: static;
        flex: 0 0 auto;
        width: 100%;
    }
}


/* --- 更新: Publication Page Redesign --- */
.publication-item {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}
.publication-item:first-child {
    border-top: 1px solid #eee;
}

.publication-item .authors {
    font-weight: 500;
    color: var(--dark-color);
    display: block;
}

.publication-item .title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin: 5px 0;
    display: block;
}

.publication-item .venue {
    font-style: italic;
    color: var(--gray-color);
    display: block;
}