:root {
    --navy: #23384d;
    --navy-dark: #182a3a;
    --teal: #567b78;
    --teal-light: #eaf0ef;
    --ink: #263238;
    --muted: #68757d;
    --line: #d7e0e3;
    --paper: #ffffff;
    --page: #eef1f2;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
                 "Yu Gothic", Meiryo, Arial, sans-serif;
    margin: 0;
    color: var(--ink);
    background-color: var(--page);
    line-height: 1.75;
}

a {
    color: #315f77;
    text-underline-offset: 3px;
}

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

header {
    position: relative;
    background-image:
        linear-gradient(rgba(24, 42, 58, 0.62), rgba(24, 42, 58, 0.62)),
        url("images/header.jpg");
    background-size: cover;
    background-position: center;
    color: white;
    padding: 42px 20px 36px;
    text-align: center;
}

header p {
    margin: 0 0 6px;
    font-size: 15px;
    letter-spacing: 0.08em;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 46px);
    font-weight: 600;
    letter-spacing: 0.08em;
}

nav {
    background-color: var(--navy-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav a {
    display: block;
    padding: 14px 22px;
    color: white;
    text-decoration: none;
    font-size: 15px;
    letter-spacing: 0.04em;
    transition: background-color 0.2s ease;
}

nav a:hover {
    color: white;
    background-color: var(--teal);
}

body.Home nav a[href="index-j.html"],
body.Research nav a[href="Research.html"],
body.Members nav a[href="Members.html"],
body.Activity nav a[href="Activity.html"] {
    background-color: var(--teal);
}

main {
    max-width: 980px;
    margin: 28px auto;
    padding: 42px 54px;
    background: var(--paper);
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(36, 56, 73, 0.08);
}

section {
    margin-bottom: 46px;
}

h2 {
    margin: 0 0 30px;
    padding-bottom: 12px;
    color: var(--navy);
    font-size: clamp(32px, 5vw, 42px);
    font-weight: 600;
    letter-spacing: 0.03em;
    border-bottom: 3px solid var(--teal);
}

h3 {
    margin-top: 38px;
    margin-bottom: 18px;
    padding: 8px 0 8px 14px;
    color: var(--navy);
    font-size: 24px;
    font-weight: 600;
    border-left: 5px solid var(--teal);
    border-bottom: 1px solid var(--line);
}

h4 {
    margin: 10px 0 5px;
    color: var(--navy);
    font-size: 18px;
    line-height: 1.5;
}

h5 {
    margin: 18px 0;
    color: var(--navy);
    font-size: 27px;
    line-height: 1.55;
}

p {
    font-size: 16px;
    text-align: justify;
}

p1 {
    font-size: 16px;
    line-height: 1.8;
}

p2 {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

ul {
    padding-left: 1.4em;
}

li {
    margin-bottom: 8px;
}

footer {
    margin-top: 36px;
    padding: 22px 20px;
    color: white;
    background-color: var(--navy-dark);
    text-align: center;
    font-size: 13px;
    letter-spacing: 0.04em;
}

.slideshow {
    width: 100%;
    max-width: 760px;
    height: 380px;
    margin: 0 auto 40px;
    overflow: hidden;
    border-radius: 7px;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.14);
}

@keyframes fade {
    from { opacity: 0.25; }
    to { opacity: 1; }
}

.slide {
    width: 100%;
    height: 380px;
    object-fit: cover;
    object-position: center;
    animation: fade 1s;
}

.label {
    display: inline-block;
    min-width: 84px;
    margin-right: 10px;
    padding: 3px 9px;
    color: white;
    background-color: var(--teal);
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.news-container {
    max-height: 300px;
    overflow-y: auto;
    padding: 18px 22px;
    background: #fafbfb;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.news-container ul {
    margin: 0;
}

.research-image {
    display: block;
    width: min(72%, 650px);
    height: auto;
    margin: 24px auto;
    border-radius: 5px;
}

.member-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.member {
    text-align: left;
}

.role-title {
    display: inline-block;
    margin: 18px 0 8px;
    padding: 4px 13px;
    color: white;
    background-color: var(--teal);
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.member h4:not(.role-title) a {
    margin-left: 10px;
    font-size: 13px;
    font-weight: 400;
}

.publication-list li {
    margin-bottom: 1.25em;
}

.career {
    padding-left: 0;
}

.career li {
    display: flex;
    gap: 18px;
    margin-bottom: 9px;
    list-style: none;
}

.career-date {
    flex: 0 0 180px;
    color: var(--muted);
}

summary {
    padding: 8px 0;
    color: var(--navy);
    border-bottom: 2px solid var(--teal);
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
}

iframe {
    max-width: 100%;
    border-radius: 6px;
}

@media (max-width: 700px) {
    header {
        padding: 32px 16px 28px;
    }

    nav a {
        padding: 12px 13px;
        font-size: 13px;
    }

    main {
        margin: 0;
        padding: 28px 20px;
        border-radius: 0;
    }

    .slideshow,
    .slide {
        height: 240px;
    }

    .research-image {
        width: 100%;
    }

    .career li {
        display: block;
    }

    .career-date {
        display: block;
        width: auto;
        margin-bottom: 2px;
    }
}

body.Home nav a[href="index-e.html"],
body.Research nav a[href="Research_en.html"],
body.Members nav a[href="Members_en.html"],
body.Activity nav a[href="Activity_en.html"] {
    background-color: var(--teal);
}

.lang-switch {
    margin-left: auto;
}

.lang-switch a {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
}
