/*
 * style.css — 統合スタイルシート
 * 旧ファイル: style.warm.css + style.labname.css + unify.css +
 *             a11y-extra.css + site-enhance.css +
 *             members-overrides.css + publications-overrides.css
 *
 * 構成
 *  1. CSS変数 / テーマトークン
 *  2. リセット・ベース
 *  3. タイポグラフィ
 *  4. レイアウト（コンテナ・グリッド）
 *  5. ヘッダー・ナビゲーション
 *  6. アコーディオン
 *  7. ホームページ（バナー・ウェルカム・ニュース・イベント）
 *  8. コンポーネント（ボタン・カード・テーブル・リンク）
 *  9. フッター
 * 10. ページ別スタイル（メンバー・論文・学会発表・アクセス・リンク）
 * 11. アクセシビリティ
 * 12. レスポンシブ
 */

/* ==========================================================================
   1. CSS変数 / テーマトークン
   ========================================================================== */
:root {
  /* カラーパレット */
  --bg:        #f7f8fa;
  --surface:   #ffffff;
  --elev:      #f0f4f9;
  --text:      #1b2540;
  --muted:     #5b677d;
  --line:      #dce3ec;
  --accent:    #1a56a8;
  --accent-2:  #1a56a8;

  /* ブランドカラー（ナビ等） */
  --brand:           #1a56a8;
  --brand-contrast:  #ffffff;
  --nav-active-fg:   #1a56a8;
  --nav-active-bg:   rgba(26, 86, 168, .10);

  /* レイアウト */
  --page-max:  960px;
  --page-pad:  clamp(20px, 5vw, 48px);
  --measure:   62ch;
  --radius:    16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow:    0 10px 24px rgba(8, 15, 40, .08);

  /* スペーシング */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  /* ナビゲーション */
  --nav-fs:    clamp(0.95rem, 1.05vw, 1.05rem);
  --nav-pad-y: .55rem;
  --nav-pad-x: .85rem;
}

/* ==========================================================================
   2. リセット・ベース
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", "Yu Gothic Medium", "YuGothic",
               "Hiragino Sans", "Hiragino Kaku Gothic ProN",
               "Meiryo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .02em;
  text-rendering: optimizeLegibility;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

html[lang="en"] body {
  font-family: "Roboto", "Source Sans Pro", system-ui,
               -apple-system, "Segoe UI", Arial, sans-serif;
  letter-spacing: .005em;
  word-spacing: normal;
}

img, video { max-width: 100%; height: auto; }
img { image-rendering: auto; }
iframe, video { max-width: 100%; }

figure { margin: 0 0 1rem; }
figure img { display: block; width: 100%; height: auto; border-radius: var(--radius-md); }

/* ==========================================================================
   3. タイポグラフィ
   ========================================================================== */
h1, h2, h3, h4, h5, h6 { color: var(--text); }

h1 { font-size: clamp(1.9rem, 2.2vw + 1rem, 2.5rem); line-height: 1.2;  margin: .9rem 0 .5rem; }
h2 { font-size: clamp(1.5rem, 1.4vw + 1rem, 1.9rem); line-height: 1.25; margin: .85rem 0 .45rem; }
h3 { font-size: clamp(1.25rem, 1vw + 1rem, 1.5rem);  line-height: 1.3;  margin: .8rem 0 .4rem; }
h4, h5, h6 { line-height: 1.35; margin: .75rem 0 .35rem; }

html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3 { letter-spacing: .5px; line-height: 1.22; }

a { color: var(--brand); }
a:hover, a:focus { text-decoration: underline; }

/* ページ見出し（各サブページのh1） */
.page-heading {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  color: var(--text);
  margin: 1.5rem 0 1.25rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--accent);
  max-width: none;
}

/* ==========================================================================
   4. レイアウト（コンテナ・グリッド）
   ========================================================================== */
.container {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
  box-sizing: border-box;
  width: 100%;
}

main {
  padding-block: clamp(16px, 4vh, 32px);
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: 0;
  box-sizing: border-box;
  width: 100%;
}

main > * + * { margin-block-start: clamp(12px, 2.2vh, 24px); }
main p + p   { margin-top: .6em; }
main :is(h2, h3) { margin-top: clamp(1.6rem, 2.8vw, 2.2rem); margin-bottom: .6rem; }
main :is(h1, h2) { margin-top: clamp(1.6rem, 3.2vw, 2.4rem); }

main ul, main ol { padding-left: 1.2em; }
main li { margin-block: .3em; }
main li > ul, main li > ol { margin-top: .2em; }

main p       { max-width: none; }
main figure  { margin: 1rem auto; }
main img, main video { display: block; border-radius: 6px; }
main pre     { white-space: pre-wrap; word-break: break-word; }

main dl { max-width: none; margin-inline: auto; }
main dt { font-weight: 600; margin-top: .6rem; }
main dd { margin-left: 1rem; margin-top: .2rem; }

.page-section {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
  overflow-x: hidden;
}

main > .page-section + .page-section { margin-top: var(--space-5); }

/* アコーディオン形式のセクション間は詰める */
main > .accordion + .accordion,
main > section.accordion + section.accordion { margin-top: .4rem; }

/* page-section内のアコーディオン間の隙間 */
.page-section details.accordion + details.accordion { margin-top: .5rem; }

/* ==========================================================================
   5. ヘッダー・ナビゲーション
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  z-index: 999;
}

.site-header .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
}

/* ブランド（研究室名） */
.brand {
  font-weight: 800;
  font-size: clamp(1.6rem, 2.4vw, 2.0rem);
  line-height: 1.2;
  white-space: normal;
  width: 100%;
  text-align: center;
}
.brand-jp { display: block; }
.brand-en { display: block; font-weight: 500; font-size: clamp(0.95rem, 1.5vw, 1.15rem); opacity: .85; margin-top: .2rem; }

/* ハンバーガーメニュー（モバイル用） */
#nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  cursor: pointer;
  padding: .6rem .8rem;
  border-radius: .5rem;
  align-self: flex-end;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid rgba(0,0,0,.12);
}
.nav-toggle-label span { display: block; width: 22px; height: 2px; margin: 4px 0; background: currentColor; transition: transform .2s, opacity .2s; }
#nav-toggle:checked + .nav-toggle-label span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
#nav-toggle:checked + .nav-toggle-label span:nth-child(2) { opacity: 0; }
#nav-toggle:checked + .nav-toggle-label span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ナビゲーション */
.site-nav { width: 100%; }
.site-nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .8rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav li { list-style: none; }
.site-nav a {
  display: inline-block;
  font-size: var(--nav-fs);
  line-height: 1.2;
  padding: var(--nav-pad-y) var(--nav-pad-x);
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
}
.site-nav a:hover { background: rgba(0, 0, 0, .06); text-decoration: none; }

/* アクティブ状態 */
.site-nav a[aria-current="page"],
.site-nav a.is-active {
  color: var(--nav-active-fg);
  background: var(--nav-active-bg);
  font-weight: 700;
}
.site-nav a[aria-current="page"]:hover,
.site-nav a.is-active:hover { background: rgba(26, 86, 168, .18); }

/* EN/JA 切替リンク */
header .site-nav a#switch-en,
header .site-nav a#switch-ja {
  color: var(--text) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
header .site-nav a#switch-en:visited,
header .site-nav a#switch-ja:visited { color: var(--text) !important; }
header .site-nav a#switch-en:hover,
header .site-nav a#switch-ja:hover { color: inherit !important; background: rgba(0,0,0,.06) !important; }

/* ==========================================================================
   6. アコーディオン
   ========================================================================== */
details.accordion > summary {
  cursor: pointer;
  padding: .5rem .8rem;
  border: none;
  border-radius: var(--radius-sm);
  background: #f0f4f9;
  font-size: 1.15rem;
  font-weight: 650;
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}
details[open] > summary {
  background: #e0eaf6;
  color: var(--accent);
}

.accordion-panel,
.accordion-content { padding: .5rem 0; }

/* ==========================================================================
   7. ホームページ
   ========================================================================== */

/* バナー */
/* バナーのsummaryを完全に非表示 */
.home-banner details.accordion > summary,
.home-banner summary {
  display: none !important;
}


.home-banner img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 1;
  object-fit: cover;
  border-radius: 0;
}

/* ウェルカムセクション */
#welcome .welcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
  overflow: hidden;
}
#welcome .welcome-image img { display: block; width: 100%; max-width: 100%; height: auto; border-radius: var(--radius-md); }
#welcome .welcome-image { overflow: hidden; min-width: 0; }
#welcome .welcome-text { padding-left: 12px; min-width: 0; overflow: hidden; }

#welcome details.accordion > summary {
  margin-block-end: .2rem;
  padding-bottom: .2rem;
}
#welcome .accordion-panel { margin-top: 0; padding-top: 4px; }
#welcome .welcome-text p:first-child { margin-top: 0; }
#welcome .welcome-text p { text-wrap: balance; }

/* ニュース */
.news {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-block: 1rem 1.5rem;
}
.news-card {
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--surface);
}
.news-card .date { font-size: .9rem; opacity: .8; display: block; margin-bottom: .25rem; }
.news-card .text { line-height: 1.6; }

/* イベント */
.home-events { padding: clamp(24px, 3vw, 40px) 0; }
.home-events .events-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.home-events .filter-btn {
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, .12);
  background: var(--surface);
  border-radius: 999px;
  cursor: pointer;
  transition: transform .08s ease;
}
.home-events .filter-btn.is-active { background: #0d6efd0f; border-color: #0d6efd55; }
.home-events .filter-btn:focus     { outline: 2px solid #0d6efd66; outline-offset: 2px; }

.home-events .events-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.home-events .event-card {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  display: flex;
  flex-direction: column;
}
.home-events .event-photo img { display: block; width: 100%; height: auto; }
.home-events .event-meta { padding: 12px; }
.home-events .event-meta time { display: inline-block; font-size: .9rem; color: #666; margin-bottom: 2px; }
.home-events .event-title { font-size: 1.05rem; margin: .2rem 0 .3rem; }
.home-events .event-desc  { margin: 0; color: #444; }
.home-events .events-more { text-align: center; margin-top: 14px; }

/* ライトボックス */
.home-events .lightbox {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .8);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px; z-index: 9999;
}
.home-events .lightbox.is-open { display: flex; }
.home-events .lightbox-figure { max-width: min(1100px, 92vw); max-height: 90vh; }
.home-events #lightbox-img { width: 100%; height: auto; display: block; border-radius: var(--radius-md); }
.home-events #lightbox-caption { color: #fff; margin-top: 8px; text-align: center; }
.home-events .lightbox-close {
  position: absolute; top: 12px; right: 16px;
  background: transparent; color: #fff; font-size: 28px; border: 0; cursor: pointer;
}

/* ==========================================================================
   8. コンポーネント（ボタン・カード・テーブル・リンク）
   ========================================================================== */

/* ボタン */
a.btn, .btn {
  display: inline-block;
  padding: .45rem .8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: .2s ease;
  color: var(--text);
}
.btn:hover         { background: rgba(26, 86, 168, .06); border-color: var(--brand); text-decoration: none; }

/* ページアクション */
.page-actions ul {
  list-style: none;
  display: flex;
  gap: .5rem;
  padding: 0;
  margin: .75rem 0 1rem;
  flex-wrap: wrap;
}

/* カード */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .9rem;
}

/* テーブル（共通） */
table { width: 100%; border-collapse: collapse; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
thead th { background: #fafafa; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .02);
}
main table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
main th, main td { padding: .5rem .75rem; border-bottom: 1px solid rgba(0, 0, 0, .08); vertical-align: top; }
main thead th { font-weight: 600; background: rgba(0, 0, 0, .03); }
main tr:nth-child(even) td { background: rgba(0, 0, 0, .015); }

/* 外部リンク・PDFアイコン */

a[href$=".pdf" i]:not(.btn):not(.no-file)::after {
  content: "PDF";
  display: inline-block;
  margin-inline-start: .35em;
  padding: .05em .3em;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .75em;
  opacity: .85;
}

/* ==========================================================================
   9. フッター
   ========================================================================== */
.site-footer {
  border-top: 2px solid var(--accent);
  background: #f0f4f9;
  margin-top: 3rem;
}
.site-footer .footer-inner {
  box-sizing: border-box;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1rem var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer .footer-brand { display: block; }
.site-footer .footer-brand img { height: clamp(24px, 3vw, 36px); width: auto; vertical-align: middle; cursor: pointer; }
.footer-copy {
  font-size: .82rem;
  color: var(--muted);
  margin: 0;
}

/* ==========================================================================
   10. ページ別スタイル
   ========================================================================== */

/* ---- メンバーページ ---- */
main .faculty-list { list-style: none; padding: 0; margin: 1.25rem 0; }
main .faculty-list > li.with-photo {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px dashed rgba(0, 0, 0, .08);
}
main .faculty-list > li.with-photo:last-child { border-bottom: none; }
main .faculty-list > li:not(.with-photo) { padding-left: .75rem; }
main .faculty-list > li.heading-students { font-weight: 700; margin: .75rem 0 .25rem; }

img.member-photo {
  width: clamp(110px, 22vw, 150px);
  height: clamp(110px, 22vw, 150px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background-color: #f7f7f7;
  display: block;
  flex-shrink: 0;
}
.person-info { flex: 1 1 auto; min-width: 0; }
.person-info .person-name {
  font-weight: 600;
  line-height: 1.35;
  display: inline-block;
  margin-right: .25rem;
}
.person-detail > summary { cursor: pointer; margin-top: .25rem; }
.person-detail[open] summary { margin-bottom: .25rem; }

/* ---- 論文ページ ---- */
body.page-publications h3.pub-year {
  display: block;
  font-size: 1.6rem;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: .01em;
  text-align: center;
  width: 100%;
  margin: 2rem auto .75rem;
  padding: 0;
  padding-left: 1cm;
}

body.page-publications h3.pub-year + ul,
body.page-publications h3.pub-year + ol,
body.page-publications h3.pub-year + dl {
  display: block;
  column-count: 1;
  text-align: center;
  padding-left: 0;
  padding-right: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
body.page-publications h3.pub-year + ul > li,
body.page-publications h3.pub-year + ol > li,
body.page-publications h3.pub-year + dl > dd {
  display: block;
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  float: none;
  clear: both;
  text-align: left;
  white-space: normal;
}

/* 論文アクション（DOI・BibTeX） */
.pub-actions { display: inline-flex; gap: .35rem; margin-left: .4rem; vertical-align: middle; }

body.page-publications .pub-actions { margin-left: 0; }

/* ---- 学会発表ページ ---- */
table.conferences { width: 100%; border-collapse: collapse; }
table.conferences th, table.conferences td { padding: .5rem .6rem; }
table.conferences col.period  { width: 16%; }
table.conferences col.number  { width: 14%; }
table.conferences col.authors { width: 28%; }
table.conferences col.title   { width: 24%; }
table.conferences col.venue   { width: 18%; }

/* トーク（学会発表）カード */
.talk-list { display: grid; gap: 16px; }
.talk {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.talk-meta { display: grid; gap: 8px; align-content: start; }
.chip { display: inline-block; padding: 2px 8px; border: 1px solid #d1d5db; border-radius: 999px; font-size: .875rem; }
.talk-title { margin: .2rem 0; line-height: 1.5; text-wrap: balance; font-size: .95rem; font-weight: 600; }
.talk-submeta { color: #555; font-size: .95rem; margin-top: .25rem; line-height: 1.5; }
.link-group h3 { margin: .2rem 0 .4rem; font-size: clamp(1.05rem, 1.8vw, 1.2rem); }
.link-list { margin: .5rem 0 2rem; padding-left: 1.1rem; }
.link-list li { margin: .3rem 0; line-height: 1.5; }


/* ==========================================================================
   11. アクセシビリティ
   ========================================================================== */
.skip-link {
  position: absolute;
  left: -9999px; top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 16px; top: 16px;
  width: auto; height: auto;
  padding: 8px 12px;
  background: var(--surface);
  outline: 2px solid;
  border-radius: 6px;
  z-index: 1000;
}

.sr-only {
  position: absolute;
  left: -10000px; top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
.site-nav a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
section.accordion > details > summary:focus-visible,
.accordion > details > summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   12. レスポンシブ
   ========================================================================== */

/* モバイル（〜640px） */
@media (max-width: 640px) {
  html { font-size: 16px; }
  body { font-size: 1rem; line-height: 1.7; }
  h1   { font-size: 1.625rem; line-height: 1.25; }
  h2   { font-size: 1.375rem; line-height: 1.28; }
  h3   { font-size: 1.125rem; line-height: 1.32; }
  h4   { font-size: 1rem;     line-height: 1.35; }
  h5, h6 { font-size: .95rem; line-height: 1.4; }

  html[lang="en"] h1 { font-size: 1.55rem; }
  html[lang="en"] h2 { font-size: 1.32rem; }
  html[lang="en"] h3 { font-size: 1.08rem; }

  main > * + * { margin-block-start: clamp(12px, 3.5vw, 18px); }

  .site-nav a { font-size: .95rem; }
  a.btn, .btn { font-size: .95rem; padding: .45rem .75rem; }
  .card { padding: .8rem; }
  .container { padding-inline: 14px; }
  th, td { padding: .45rem .5rem; }
  main .faculty-list > li:not(.with-photo) { padding-left: .75rem; }

  /* アコーディオン summary タップ領域拡大 */
  section.accordion > details > summary,
  .accordion > details > summary,
  details.accordion > summary {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 16px;
    margin: 6px 0 8px;
    line-height: 1.45;
    border-radius: var(--radius-sm);
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    touch-action: manipulation;
  }

  #welcome .welcome-grid { grid-template-columns: 1fr; overflow: hidden; }
  #welcome .welcome-image { order: 2; }
  #welcome .welcome-text  { order: 1; padding-left: 0; min-width: 0; overflow-wrap: break-word; word-break: break-word; }

  .home-events .events-grid { grid-template-columns: 1fr; }
table.conferences col.number  { width: 18%; }
  table.conferences col.authors { width: 34%; }
  table.conferences col.title   { width: 30%; }
  table.conferences col.venue   { width: 18%; }

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

}

/* タブレット（481px〜900px） */
@media (min-width: 481px) and (max-width: 900px) {
  html { font-size: 17px; }
  body { line-height: 1.75; }
  h1 { font-size: 2rem;     line-height: 1.25; }
  h2 { font-size: 1.625rem; line-height: 1.28; }
  h3 { font-size: 1.375rem; line-height: 1.3;  }
  h4 { font-size: 1.125rem; line-height: 1.32; }
  h5, h6 { font-size: 1rem; }

  a.btn, .btn { font-size: 1rem; padding: .5rem .9rem; }
  .card { padding: 1rem; }
  .container { padding-inline: 18px; }
}

/* モバイルのハンバーガーメニュー（〜900px） */
@media (max-width: 900px) {
  .nav-toggle-label { display: flex; }
  .site-nav { display: none; }
  #nav-toggle:checked + .nav-toggle-label + .site-nav {
    display: block;
  }
  .site-nav ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: .5rem 0;
  }
  .site-nav li { list-style: none; }
  .site-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: .75rem .5rem;
    min-height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 0.5px solid var(--color-border-tertiary);
  }
  /* 言語切替（EN/JA）は最後に1列で全幅表示 */
  .site-nav li:last-child {
    grid-column: 1 / -1;
  }
  .site-nav li:last-child a {
    background: transparent;
    border: none;
    opacity: .7;
  }
}

/* デスクトップ（901px〜） */
@media (min-width: 901px) {
  #nav-toggle, .nav-toggle-label { display: none; }
  .site-nav { display: block; }
  .site-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .site-nav a { display: inline-block; }

  img.member-photo { width: clamp(120px, 14vw, 160px); height: clamp(120px, 14vw, 160px); }

  #welcome .welcome-grid { grid-template-columns: 1.35fr 0.65fr; column-gap: 24px; }
  #welcome .welcome-text { padding-left: 16px; }
  #welcome .welcome-image img { max-width: 380px; width: 100%; height: auto; object-fit: cover; }
  #welcome .welcome-text .nowrap { white-space: nowrap; }

  .home-events .events-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 961px) {
  .home-events .events-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  img.member-photo { width: clamp(130px, 14vw, 170px); }
}

@media (max-width: 860px) {
  .talk { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  #welcome .welcome-grid { grid-template-columns: 1fr; overflow: hidden; }
  #welcome .welcome-image { order: 2; }
  #welcome .welcome-text  { order: 1; padding-left: 0; min-width: 0; overflow-wrap: break-word; word-break: break-word; }
}

/* ==========================================================================
   論文ページ専用スタイル（publications.html）
   ========================================================================== */

/* 年度アコーディオン */
.pub-year-block {
  margin: 1.5rem 0;
  border: 0.5px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.pub-year-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.1rem;
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--elev);
  border: none;
  list-style: none;
  color: var(--text);
  user-select: none;
}
.pub-year-summary::-webkit-details-marker { display: none; }
.pub-year-summary::before {
  content: "▶";
  font-size: 0.65rem;
  color: var(--accent);
  transition: transform .2s ease;
  flex-shrink: 0;
}
.pub-year-block[open] > .pub-year-summary::before {
  transform: rotate(90deg);
}
.pub-year-block[open] > .pub-year-summary {
  border-bottom: 0.5px solid var(--line);
}

/* 論文リスト */
.pub-list {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
}

.pub-list > li {
  padding: 0.85rem 1.1rem;
  border-bottom: 0.5px solid var(--line);
  line-height: 1.65;
  font-size: 0.93rem;
}
.pub-list > li:last-child { border-bottom: none; }

/* 論文タイトルリンク */
.pub-list > li > a {
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--accent);
  text-decoration: none;
  display: block;
  margin-bottom: 0.2rem;
}
.pub-list > li > a:hover { text-decoration: underline; }

/* 著者名（li直下の最初のテキスト）*/
.pub-list > li {
  color: var(--muted);
}
.pub-list > li > a + i,
.pub-list > li > i {
  font-style: italic;
  color: var(--text);
  font-weight: 500;
}

/* 無効リンクのスタイル（ORCID・researchmap未設定時） */
.orcid.disabled,
.researchmap.disabled {
  color: var(--muted);
  opacity: .5;
  cursor: default;
  font-size: .9rem;
}

/* インラインstyle置き換えクラス */
.nowrap { white-space: nowrap; }
.bold   { font-weight: 700; }

/* ==========================================================================
   ページトップへ戻るボタン
   ========================================================================== */
#back-to-top {
  position: fixed;
  bottom: clamp(16px, 3vw, 28px);
  right: clamp(16px, 3vw, 28px);
  z-index: 1000;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s, transform .2s;
  box-shadow: 0 2px 8px rgba(26, 86, 168, .3);
  text-decoration: none;
}
#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}
#back-to-top:hover {
  transform: translateY(-3px);
  text-decoration: none;
}


/* ==========================================================================
   印刷スタイル (@print)
   ========================================================================== */

/* ==========================================================================
   スマホ対応（480px以下）
   ========================================================================== */
@media (max-width: 480px) {
  /* ページ余白を縮小 */
  .page-section { padding-inline: 14px; }

  /* ヘッダーのブランド名フォントを縮小 */
  .brand { font-size: clamp(1.1rem, 4vw, 1.4rem); }
  .brand-en { font-size: .8rem; }
  .site-header .container { padding: .5rem .75rem; gap: .3rem; }

  /* メンバー写真を縦並びに・サイズ固定 */
  .faculty-list > li.with-photo,
  .with-photo {
    flex-direction: column;
    align-items: flex-start;
    gap: .6rem;
  }
  .member-photo {
    width: 90px !important;
    height: 90px !important;
  }

  /* テーブルの横スクロール対応 */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .site-table {
    min-width: 480px;
  }

  /* アコーディオンsummaryのフォントを少し小さく */
  details.accordion > summary {
    font-size: 1rem;
  }

  /* 学会発表カード */
  .talk {
    grid-template-columns: 1fr;
  }

  /* バナーのアスペクト比を調整 */
  .home-banner img {
    aspect-ratio: 3 / 1;
  }

  /* ウェルカムセクションの縦並び・写真サイズ制限 */
  #welcome .welcome-grid {
    grid-template-columns: 1fr;
  }
  #welcome .welcome-image { order: 2; }
  #welcome .welcome-text  { order: 1; }
  #welcome .welcome-image img {
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
  }

  /* 論文リストの余白 */
  .pub-list > li {
    padding: .6rem .5rem;
  }

  /* ページトップボタンの位置 */
  #back-to-top {
    bottom: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
  }
}

/* タブレット（481px〜720px） */
@media (min-width: 481px) and (max-width: 720px) {
  .member-photo {
    width: clamp(90px, 18vw, 120px) !important;
    height: clamp(90px, 18vw, 120px) !important;
  }
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .site-table {
    min-width: 480px;
  }
}


/* スマホ向けバナー比率変更 */
@media (max-width: 480px) {
  .home-banner img { aspect-ratio: 2.5 / 1; }
}

/* 卒業生テーブルのスマホ向けカード表示 */
@media (max-width: 600px) {
  .alumni-table thead { display: none; }
  .alumni-table tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    margin-bottom: .75rem;
    padding: .75rem;
    background: var(--surface);
  }
  .alumni-table td {
    display: block;
    padding: .2rem 0;
    border: none;
    font-size: .95rem;
  }
  .alumni-table td:first-child {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: .2rem;
  }
  .alumni-table td:nth-child(2)::before {
    content: "課程：";
    font-size: .8rem;
    color: var(--muted);
  }
  .alumni-table td:nth-child(3) {
    margin-top: .3rem;
    padding-top: .3rem;
    border-top: 1px solid var(--line);
    line-height: 1.55;
    color: var(--text);
  }
  .responsive-table { overflow-x: visible; border: none; background: transparent; }
}

/* 英語版カード表示 */
@media (max-width: 600px) {
  .alumni-table td:nth-child(2)::before { content: "Degree: "; }
}

@media print {
  /* ヘッダー・フッター・ボタン類を非表示 */
  .site-header,
  .site-footer,
  #back-to-top,
  .nav-toggle-label,
  .skip-link,
  .pub-actions,
  .accordion-panel .btn,
  .page-actions { display: none !important; }

  /* 背景色・影をリセット */
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.6;
  }

  /* コンテナ幅をフルに */
  main, .page-section, .container {
    max-width: 100% !important;
    padding-inline: 0 !important;
    margin-inline: 0 !important;
  }

  /* アコーディオンを全て展開 */
  details { display: block !important; }
  details > summary { display: block !important; }
  .accordion-panel,
  .accordion-content { display: block !important; }

  /* リンクにURLを表示 */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: .85em;
    color: #555;
    word-break: break-all;
  }
  /* DOIリンクはURLのみ表示（短く） */
  .pub-list a[href^="https://doi.org"]::after {
    content: "";
  }

  /* ページ区切り */
  .page-section { page-break-inside: avoid; }
  h1, h2, h3 { page-break-after: avoid; }

  /* 論文リストの余白調整 */
  .pub-year-block { page-break-inside: avoid; }
  .pub-list > li { margin-bottom: .5rem; }

  /* アクセスページの地図を非表示 */
  iframe { display: none !important; }
}
