/* 研究室サイトの見た目（前のサイトの雰囲気に合わせたもの） */

:root {
  --bg: #efefef;          /* ページの地の色（薄いグレー） */
  --surface: #f7f7f7;     /* カードの色 */
  --text: #2b2b2b;
  --muted: #8a8a8a;       /* 小見出しなどの薄い文字 */
  --line: #cfcfcf;
  --dark: #1f1f1f;        /* 黒いボタン・フッター */
  --accent: #c8d43a;      /* フッターの上の黄緑の線 */
  --hero-yellow: #e8ea6a; /* トップの「Welcome to」 */
  --link: #3949ab;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", "Times New Roman", serif;
  --sans: "Helvetica Neue", Arial, "Hiragino Sans", "Noto Sans JP", sans-serif;
  --side: 52px;           /* 右端メニューの幅 */
  --radius: 4px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: .02em;
  padding-right: var(--side);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); }
h1, h2, h3, h4 { line-height: 1.4; font-weight: 700; }
.center { text-align: center; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: #fff; padding: 8px 12px; }
.icon { width: 20px; height: 20px; flex: none; }

/* ---------- 右端の縦メニュー ---------- */
.sidenav {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--side); z-index: 50;
  background: var(--dark); color: #ddd;
  display: flex; flex-direction: column; align-items: center; padding-top: 14px; gap: 18px;
}
.sidenav button, .menu-panel button {
  background: none; border: 0; color: inherit; cursor: pointer; padding: 6px; display: flex;
}
.side-icons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.side-icons a { position: relative; display: flex; color: #bbb; padding: 8px; border-radius: 3px; }
.side-icons a:hover, .side-icons a:focus-visible, .side-icons a[aria-current] { color: #fff; background: #333; }
.side-icons span {
  position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: var(--dark); color: #fff; font-family: var(--sans); font-size: 12px; line-height: 1;
  padding: 7px 10px; border-radius: 3px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s;
}
.side-icons a:hover span, .side-icons a:focus-visible span { opacity: 1; }

.menu-panel {
  position: fixed; inset: 0 0 0 auto; width: min(320px, 100vw); z-index: 60;
  background: var(--dark); color: #eee; padding: 64px 28px 28px; box-shadow: -4px 0 20px rgba(0,0,0,.3);
}
.menu-panel[hidden] { display: none; }
.menu-close { position: absolute; top: 14px; right: 14px; }
.menu-brand { font-family: var(--sans); font-weight: 800; font-style: italic; font-size: 20px; margin: 0 0 18px; }
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel a { display: flex; gap: 12px; align-items: center; color: #ddd; text-decoration: none; padding: 10px 0; border-bottom: 1px solid #333; }
.menu-panel a:hover, .menu-panel a[aria-current] { color: #fff; }

/* ---------- トップの大きな写真 ---------- */
.hero {
  min-height: min(78vh, 640px);
  background: #6f8fb0 var(--banner) center / cover no-repeat;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 40px 20px; text-shadow: 0 2px 12px rgba(0,0,0,.35);
  position: relative; overflow: hidden;
}
/* スライドショー（hero-1.jpg 〜 hero-6.jpg のうち、置いてあるものだけを順に表示） */
.hero-slide {
  position: absolute; inset: 0; background: center / cover no-repeat;
  opacity: 0; transition: opacity 1.2s ease;
}
.hero-slide.is-on { opacity: 1; }
.hero p { margin: 0; line-height: 1.05; position: relative; z-index: 1; }
.hero-dots { position: absolute; bottom: 14px; left: 0; right: 0; z-index: 1; display: flex; justify-content: center; gap: 8px; }
.hero-dots button {
  width: 11px; height: 11px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid #fff; background: transparent; box-shadow: 0 0 4px rgba(0,0,0,.4);
}
.hero-dots button[aria-current] { background: #fff; }
@media (prefers-reduced-motion: reduce) { .hero-slide { transition: none; } }
.hero-small { font-family: var(--serif); font-style: italic; color: var(--hero-yellow); font-size: clamp(30px, 5vw, 64px); }
.hero-large { font-family: var(--sans); font-weight: 900; font-style: italic; color: #f2f2f2; font-size: clamp(40px, 7.5vw, 100px); letter-spacing: -.01em; }

/* ---------- 各ページの上の帯 ---------- */
.page-banner {
  height: clamp(160px, 30vw, 300px);
  background: #9a8a7a var(--banner) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.page-banner h1 {
  width: 100%; margin: 0; color: #fff; font-size: clamp(40px, 7vw, 96px); line-height: 1.1;
  text-shadow: 0 2px 16px rgba(0,0,0,.35); text-align: center; padding: 0 16px;
}
.page-banner.long h1 { font-size: clamp(26px, 4.4vw, 52px); }

/* ---------- 本文の幅と見出し ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 40px 20px; }
.wrap.wide { max-width: 860px; }
.section-head { text-align: center; margin: 10px 0 26px; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 32px); margin: 0; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.subtitle::before, .subtitle::after { content: ""; width: 24px; border-top: 1px solid #b7b7b7; }

/* ---------- お知らせ ---------- */
.notice { position: relative; border: 2px solid #b2b2b2; text-align: center; padding: 10px 44px; margin-bottom: 30px; font-size: 13px; }
.notice p { margin: 0; }
.notice-title { font-weight: 700; }
.notice-close { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #666; cursor: pointer; }

/* ---------- ボタン ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: 999px;
  background: #e9e9e9; color: var(--text); text-decoration: none; font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .15s, box-shadow .15s;
}
.pill:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.pill.dark { background: var(--dark); color: #fff; }
.link-button { background: none; border: 0; padding: 0; color: var(--link); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- スタッフ ---------- */
.staff { display: flex; gap: 26px; align-items: flex-start; padding: 22px 0; border-top: 1px solid var(--line); }
.staff:last-of-type { border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.staff img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; flex: none; background: #ddd; }
.staff h3 { margin: 0 0 4px; font-size: 16px; }
.staff p { margin: 0; font-size: 13.5px; }

/* ---------- 研究テーマのカード ---------- */
.carousel { position: relative; display: flex; align-items: center; gap: 6px; }
.car-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 24px) / 3); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 6px 2px 14px; flex: 1; }
.car-track::-webkit-scrollbar { display: none; }
.car-track .card { scroll-snap-align: start; }
.car-btn { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid #999; background: transparent; color: #666; cursor: pointer; font-size: 18px; line-height: 1; }
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { background: var(--surface); box-shadow: var(--shadow); border-radius: 2px; overflow: hidden; }
.card a { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #ddd; display: block; }
.card h3 { font-size: 14px; text-align: center; margin: 12px 14px 6px; }
.card p { font-size: 12.5px; line-height: 1.75; margin: 0 16px; flex: 1; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.card .more { display: block; text-align: center; font-size: 12px; letter-spacing: .08em; padding: 14px 0 16px; }

/* ---------- 業績とニュース ---------- */
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.feature { background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.feature h3 { font-size: 18px; margin: 18px 22px 8px; }
.feature-body { position: relative; max-height: 320px; overflow: hidden; padding: 0 22px; font-size: 12.5px; line-height: 1.8; }
.feature-body:not(.is-clipped)::after { display: none; }
.feature-body::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; background: linear-gradient(transparent, var(--surface)); }
.feature-body h2 { font-size: 13px; font-weight: 400; margin: 0; }
.feature-body p { margin: 0 0 10px; }
.feature-more { display: flex; justify-content: space-between; margin-top: auto; padding: 12px 22px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 13px; }

/* ---------- アクセス ---------- */
.access { background: #8d8174 var(--banner) center / cover no-repeat; padding: 40px 20px; margin-top: 20px; }
.access-card { max-width: 800px; margin: 0 auto; background: #f1f1f1; padding: 26px 30px 30px; text-align: center; box-shadow: var(--shadow); }
.access-card h2 { font-size: 28px; margin: 0 0 4px; }
.access-card p { font-size: 13px; margin: 0 0 14px; }
.access-card img { display: block; margin: 0 auto; }

/* ---------- 年度の切り替え（People・Publications） ---------- */
.with-years { display: grid; grid-template-columns: 96px minmax(0, 780px); justify-content: center; gap: 26px; padding: 36px 20px; }
.years ul { list-style: none; margin: 0; padding: 0; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 32px); overflow-y: auto; }
.years a { display: block; text-align: center; font-size: 13px; padding: 7px 0; color: #666; text-decoration: none; border: 1px solid var(--line); background: #f4f4f4; border-radius: 2px; }
.years a:hover, .years a[aria-current] { color: var(--text); background: #fff; border-color: #aaa; }
.year { padding-bottom: 20px; }
.js-tabs .year:not(.is-active) { display: none; }
.year > h2 { font-size: 19px; margin: 0 0 6px; }
.role { font-size: 16px; margin: 22px 0 14px; padding-top: 14px; border-top: 1px solid #555; }
.year > h2 + .role { border-top: 0; padding-top: 0; }
.members { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 18px; }
.member { text-align: center; }
.member img, .member .avatar { width: min(180px, 100%); aspect-ratio: 1; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 8px; background: #e2e2e2; }
.member .avatar { background: #e2e2e2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23bdbdbd'%3E%3Ccircle cx='12' cy='9' r='4'/%3E%3Cpath d='M4 21c1-4.5 4.2-6.5 8-6.5s7 2 8 6.5z'/%3E%3C/svg%3E") center / 60% no-repeat; }
.member h4 { margin: 0; font-size: 14px; }
.member p { margin: 4px 0 0; font-size: 12px; line-height: 1.7; }
.member a { font-size: 12px; }
.old-year p { font-size: 13.5px; }
.publications p { font-size: 13.5px; margin: 0 0 12px; padding-left: 1em; text-indent: -1em; }

/* ---------- 記事のページ ---------- */
.article h1 { font-size: 26px; }
.article h2 { font-size: 21px; margin-top: 2em; }
.article img { display: block; margin: 16px auto; border-radius: 2px; }
.article figcaption { text-align: center; font-size: 13px; color: #555; }

/* ---------- 写真を横に並べたもの（News など）。3枚ずつ見せて、矢印と点で送る ---------- */
.gallery {
  display: flex; gap: 4px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; margin: 16px 0; scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.article .gallery img {
  flex: 0 0 calc((100% - 8px) / 3); width: calc((100% - 8px) / 3); aspect-ratio: 3 / 2;
  object-fit: cover; margin: 0; border-radius: 0; scroll-snap-align: start; cursor: zoom-in;
}
.gallery-box { position: relative; margin: 16px 0 8px; }
.gallery-box .gallery { margin: 0; }
.gallery-box .g-prev, .gallery-box .g-next {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 1;
  width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.75); color: #222; font-size: 20px; line-height: 1;
}
.gallery-box .g-prev { left: 6px; }
.gallery-box .g-next { right: 6px; }
.gallery-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.gallery-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: #bbb; cursor: pointer; }
.gallery-dots button[aria-current] { background: #222; }
@media (max-width: 640px) {
  .article .gallery img { flex-basis: 100%; width: 100%; }
}

/* News は帯なしで、記事ごとに線で区切る */
.news h1 { margin-top: 48px; }
.news h2 ~ h2 { border-top: 2px solid #999; padding-top: 1.6em; margin-top: 2.2em; }
.topic h1 { text-align: center; margin-top: 0; }
.topic h4 { text-align: center; font-size: 22px; margin: 2.4em 0 1em; }
.topic .main-description { background: #e6e7e8; border-radius: 10px; padding: 22px 26px; margin-bottom: 30px; }
.topic .sub-section { background: var(--surface); box-shadow: var(--shadow); border-radius: 10px; padding: 24px 28px; margin-bottom: 28px; }
.topic .sub-section h2 { font-size: 18px; margin-top: 0; padding-bottom: 8px; border-bottom: 2px solid #5b8fc9; }
.topic .content-wrapper::after { content: ""; display: block; clear: both; }
.topic .content-wrapper img { float: left; width: min(46%, 380px); margin: 4px 20px 12px 0; cursor: zoom-in; }
.topic .main-description p, .topic .sub-section p { font-size: 14px; }

/* ---------- ポップアップ・画像の拡大 ---------- */
dialog { border: 0; padding: 0; background: transparent; max-width: min(92vw, 900px); }
dialog::backdrop { background: rgba(0, 0, 0, .8); }
.popup { background: #fff; padding: 28px 30px; border-radius: 4px; max-width: min(92vw, 640px); }
.popup h3 { margin-top: 0; }
.popup-close, .lightbox-close { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.9); border: 0; border-radius: 50%; padding: 6px; cursor: pointer; display: flex; }
.lightbox img { display: block; max-height: 86vh; width: auto; margin: 0 auto; }
img.zoomable { cursor: zoom-in; }

/* ---------- フッター ---------- */
.site-footer { background: var(--dark); color: #ddd; text-align: center; font-size: 12px; padding: 18px; border-top: 4px solid var(--accent); margin-top: 40px; }
.site-footer p { margin: 0; }
.home .site-footer { margin-top: 0; }

/* ---------- スマホ ---------- */
@media (max-width: 760px) {
  body { padding-right: 0; font-size: 14.5px; }
  .hero { min-height: 56vh; }
  .sidenav { top: 10px; right: 10px; bottom: auto; width: auto; background: rgba(31,31,31,.85); border-radius: 6px; padding: 4px; }
  .side-icons { display: none; }
  .staff { flex-direction: column; align-items: center; text-align: left; }
  .staff img { width: 120px; height: 120px; }
  .car-track { grid-auto-columns: 82%; }
  .car-btn { display: none; }
  .features, .card-grid { grid-template-columns: 1fr; }
  .with-years { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px 16px; }
  .with-years > * { min-width: 0; }
  .years ul { position: static; flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 6px; }
  .years a { padding: 5px 10px; }
  .members { grid-template-columns: repeat(2, 1fr); }
  .topic .content-wrapper img { float: none; width: 100%; margin: 0 0 12px; }
  .wrap { padding: 28px 16px; }
  .access { padding: 24px 12px; }
  .access-card { padding: 20px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
