body {
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333;
}

#member, #news, #access {
  scroll-margin-top: 80px;
}


header {
  background-image: url("img/lab_photo1.jpg");  /* 初期画像 */
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  color: black;
  padding: 2em 1em;
  overflow: hidden;
  text-align: center;
  min-height: 300px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  transition: background-image 0.8s ease-in-out; /* フェード切り替え */
}

.bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 1s ease-in-out;
  opacity: 0;
  z-index: 0;
}

.bg.show {
  opacity: 1;
}

.header-content {
  position: relative;
  z-index: 2;
  color: white;
  text-align: center;
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.3);
  z-index: 1;
}

header h1 {
  margin: 0;
  font-size: 2.5em;
  font-weight: 800;
  color: white; /* 濃いグレー */
  z-index: 1;
  text-align: center;
  text-shadow:     
    0 0 4px rgba(0, 0, 0, 0.7),
    0 0 12px rgba(0, 0, 0, 0.8); /* 文字のまわりにぼかし影 */
  line-height: 1.4;
}

header h1 .subtitle {
  display: block;
  font-size: 0.6em;
  font-weight: normal;
  color: white; /* 少し明るいグレーで柔らかく */
}



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

nav a {
  color: white;
  text-decoration: none;
  font-size: 0.9em;
}

/* メニュー全体の初期状態 */
.menu-list {
  display: flex;
  justify-content: center;
  gap: 1.5em;
}


.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8em;
  color: white;
  padding: 0.5em 1em;
  cursor: pointer;
}

main {
  padding: 2em;
}

html {
  scroll-behavior: smooth;
}

section {
  scroll-margin-top: 80px;
  margin-bottom: 2em;
  background-color: #fff;
  padding: 1.5em;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

h2 {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 700;
  font-size: 1.5em;
  letter-spacing: 0.03em;
  border-bottom: 2px solid #999;
  padding-bottom: 0.3em;
  margin-bottom: 1em;
}

.more-link {
  display: inline-block;
  margin-top: 0.8em;
  color: #666;
  text-decoration: underline;
  font-size: 0.9em;
}


/* === メニューバー === */
.main-nav {
  background-color:#404041;
  color: white;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 1000;
}

.main-nav ul {
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0.5em 0;
  list-style: none;
  gap: 1.5em;
}

.main-nav a {
  color: white;
  text-decoration: none;
  font-size: 1.05em;
  font-weight: 600;
  padding: 0.4em 0.8em;
  transition: background 0.3s;
  font-family: "Segoe UI", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
}

.main-nav a:hover {
  background-color: #666;
  border-radius: 4px;
  border-bottom: 2px solid #333;
}

/* === NEWSセクション === */
#news {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
}

.news-item {
  display: flex;
  background-color: #fdfdfd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.news-item:hover {
  transform: translateY(-3px);
}

.news-item img {
  width: 100%;
  max-width: 300px; 
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: block;
}

.news-date {
  display: inline-block;
  background-color: #7b7b7c;  /* 濃い青紫。好みに応じて調整OK */
  color: #fff;
  font-size: 0.9em;
  padding: 0.3em 0.8em;
  border-radius: 6px;
  font-weight: bold;
  margin-bottom: 0.5em;

  margin-right: auto;
}

.news-content {
  padding: 0.8em 1em;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.news-text {
  font-size: 1em;
  font-weight: 500;
  margin-top: 0.2em;
}

.news-title {
  font-size: 1.3em;               /* 少し大きめ */
  font-weight: 700;              /* 太字 */
  color: #353b42;                /* 濃紺（上品な強調色） */
  margin: 0.3em 0;
  font-family: "Segoe UI", "Helvetica Neue", "Noto Sans JP", "Meiryo", sans-serif;
  letter-spacing: 0.5px;
}

.news-text ul.news-list {
  margin: 0.5em 0 0 1em;
  padding-left: 1em;
  list-style-type: disc;
  color: #444;
  font-size: 0.95em;
}

.news-text ul.news-list li {
  margin-bottom: 0.5em;
  line-height: 1.5;
}

.news-text ul.author-list {
  list-style-type: none;
  margin-top: 0.3em;
  margin-left: 1em;
  padding-left: 1em;
  font-size: 0.9em;
  color: #666;
}

/* === メンバー === */
.member-group {
  margin-bottom: 2em;
  border-left: 4px solid #888;
  padding-left: 1em;
}

.member-card {
  display: flex;
  flex-direction: column;     /* ← 縦並びにする */
  align-items: center;        /* 中央揃え */
  background-color: #f9f9f9;
  border-radius: 8px;
  padding: 0.8em;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  width: 100%;            /* ← 横幅も最大化 */
  box-sizing: border-box; /* ← paddingがずれないように */
}

.member-title {
  font-size: 1.2em;
  font-weight: 600;
  color: #444;
  margin-bottom: 0.5em;
  letter-spacing: 0.03em;
}

.member-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.member-photo {
  width: 80px;         /* 写真のサイズを指定 */
  height: 80px;
  object-fit: cover;
  border-radius: 50%;  /* 丸くする（必要なければ削除OK） */
  margin-right: 12px;  /* ← 写真と文字の間に余白を追加 */
}

.teacher-photo {
  width: 130px;
  height: 130px;
  object-fit: cover;
  flex-shrink: 0;
}

.member-list li {
  display: flex;
  align-items: center;
  gap: 12px;               /* 画像と名前の間隔 */
  font-family: "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 1em;
  font-weight: 500;
  margin-bottom: 0.6em;
  padding: 0.4em 0.6em;
  border-radius: 6px;
  background-color: #f8f8f8; /* 初期背景 */
  transition: background-color 0.3s ease;

  width: 100%;
  box-sizing: border-box;
}

.member-info {
  display: flex;
  flex-direction: row;   /* 横並び（名前と役職） */
  gap: 1em;
  align-items: baseline;
  text-align: center;
  margin-top: 0.5em;
  flex: 1;
}

.member-name {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 1em;
  text-decoration: none;
  color: #333;
  display: inline-block; 
  transition: color 0.3s ease;
}

/* aタグを持つliにだけhover効果をつける */
.member-list li:has(a):hover {
  background-color: #d6d7d5;
  cursor: pointer;
}

.member-role {
  font-size: 0.85em;
  color: #666;
  margin-top: 0.2em;
  line-height: 1.4;
}

.member-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;          /* カード間の余白 */
  padding: 0;
  list-style: none;
  margin: 0;
}

.member-grid li {
  background-color: #f9f9f9;
  border-radius: 8px;
  padding: 0.8em;
  width: calc(25% - 12px); /* 4列（ギャップ分を引く） */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: background-color 0.3s ease;
}

.member-grid li:has(a):hover {
  background-color: #d6d7d5;
  cursor: pointer;
}

.member-grid li:has(a):hover .member-card {
  background-color: #d6d7d5; /* ← aにも同じ色を明示 */
}

/* === ブログ === */
.blog-post {
  max-width: 800px;
  margin: 0 auto 3em;
  padding: 2em;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  line-height: 1.8;
}

.blog-post h3 {
  font-size: 1.5em;
  margin-bottom: 0.3em;
  border-left: 4px solid #666;
  padding-left: 0.6em;
  color: #222;
}

.blog-photo {
  display: block;
  width: 60%;               
  max-width: 400px;         /* ← 最大でもこの幅までに制限 */
  height: auto;
  margin: 1.5em auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.blog-date {
  font-size: 0.85em;
  color: #888;
  margin-bottom: 1.2em;
}

.blog-post p {
  margin-bottom: 1.2em;
  font-size: 1em;
}

.blog-layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2em 1em;
  gap: 2em;
}

.blog-menu {
  width: 250px;
  flex-shrink: 0;
  background-color: #f9f9f9;
  padding: 1em;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 100px; /* ナビゲーションバーの高さ＋余白分に調整 */
  height: fit-content;
}

.blog-menu h2 {
  font-size: 1.1em;
  margin-bottom: 1em;
}

.blog-menu ul {
  list-style: none;
  padding-left: 0;
  line-height: 1.6;
}

.blog-menu a {
  color: #444;
  text-decoration: none;
}

.blog-menu a:hover {
  text-decoration: underline;
}

.blog-content {
  flex: 1;
}

/* === 論文一覧 === */
.pub-separator {
  border: none;
  border-top: 1px solid #ddd;
  margin: 2em 0;
}

/* === アドレス === */

#access {
  padding: 2em 1em;
  background-color: #fff;
  border-radius: 12px;
  margin: 0 auto;
}

.access-info {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
}

.access-item h3 {
  font-size: 1.1em;
  margin-bottom: 0.3em;
  color: #333;
  font-weight: 600;
  border-left: 4px solid #7b7b7c;
  padding-left: 0.5em;
}

.access-item p {
  margin: 0;
  font-size: 0.95em;
  color: #555;
  line-height: 1.6;
}

.access-item a {
  color: #0066cc;
  text-decoration: none;
}

.access-item a:hover {
  text-decoration: underline;
}


/* === フッター === */
footer {
  background-color: #4b4b4b;
  color: #aaa;
  text-align: center;
  padding: 1em;
  font-size: 0.8em;
}

/* === レスポンシブ対応 === */




@media (max-width: 768px) {
  header {
    min-height: 100px; /* 小さめの高さに調整 */
    padding: 1em 0.5em; /* パディングも小さくする */
  }

  header h1 {
    font-size: 1.8em; /* タイトルもやや小さく調整 */
  }

  header h1 .subtitle {
    font-size: 0.5em;
  }

  .menu-toggle {
    display: block;
    font-size: 1.5em;
    background: none;
    border: none;
    color: white;
    margin-left: auto;
    margin-right: 1em;
    padding: 0.5em;
    cursor: pointer;
  }

  .menu-list {
    display: none;              /* 初期は非表示 */
    flex-direction: column;
    background-color: #404041;
    width: 100%;
    padding: 1em 0;
    margin: 0;
    gap: 0;
  }

  .menu-list.show {
    display: flex;
  }

  .menu-list li {
    text-align: center;
    padding: 0.8em 0;
  }


  .news-item {
    flex-direction: column;
  }

  .news-item img {
    width: 100%;
    height: auto;
  }

  .member-grid li {
    width: 100%;
  }

  .member-card {
    display: flex;
    flex-direction: row;       /* 横並び */
    align-items: center;       /* 上下中央寄せ */
    justify-content: center;   /* 横方向中央寄せ */
    text-align: left;
    gap: 12px;                 /* 画像と名前の間隔 */
  }

  .member-photo {
    margin: 0;
  }

  .teacher-photo {
    width: 80px;
    height: 80px;
  }

  .member-name {
    font-size: 1em;
  }

  .member-role {
    font-size: 0.85em;
    margin-top: 0.3em;
  }

  .member-list li {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  .member-photo {
    margin-bottom: 0;            /* ← 上下の余白はなくす */
    margin-right: 12px;          /* ← 名前との間に余白 */
  }

  .member-info {
    flex-direction: column; /* ← 名前と役職を縦並びに */
    align-items: flex-start; /* ← 左寄せ（スマホでも中央にしない） */
    text-align: left;        /* ← テキストも左寄せ */
  }

  /* メニューバーをハンバーガーメニューに */
  .main-nav .menu-list {
    display: none;
    flex-direction: column;
    background-color: #404041;
    width: 100%;
    padding: 1em 0;
    margin: 0;
    gap: 0;
  }

  .main-nav .menu-list.show {
    display: flex !important;  /* ← 強制的に表示 */
  }

  /* ブログレイアウトの調整 */
  .blog-layout {
    flex-direction: column; /* ← スマホでは縦並びに */
    padding: 1em;            /* ← 余白を調整 */
  }

  .blog-menu {
    width: 100%;
    margin-bottom: 1.5em;
    position: static; /* stickyは解除して普通にスクロールされるように */
  }

  .blog-content {
    width: 100%;
  }

  .blog-photo {
    width: 100%;      /* スマホでは画像は全幅 */
    max-width: none;  /* 最大幅制限も解除 */
  }

  .blog-menu ul {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
  }

  .blog-menu a {
    font-size: 0.95em;
  }
}