/* スタイルシートをリセットして、ブラウザ間の表示差異をなくします */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 基本的なフォントと背景色を設定します */
body {
  font-family: 'Noto Sans JP', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f4f4f4;
  position: relative;
  z-index: 0;
  min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-image: url('../images/Itsutsubashi.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.1;
}

/* リンクのデフォルトスタイルを設定します */
a {
  text-decoration: none;
  color: #007bff;
}

a:hover {
  text-decoration: underline;
}

/* 画像がコンテナからはみ出さないようにします */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 全体のラッパーを設定し、中央に配置します */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* トップバーを削除し、ヘッダー内のリンクとナビゲーションのスタイルを調整 */
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.top-links {
  margin-bottom: 0.5rem;
  font-size: 0.9em;
}

.top-links a {
  color: #555;
  text-decoration: none;
  margin-left: 1.5rem;
}

.top-links a:hover {
  color: #000;
  text-decoration: underline;
}

/* ヘッダー */
.site-header {
  background: #fff;
  padding: 0.5rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 75px; /* 50px から 1.5倍に */
  width: auto;
}

.main-nav-desktop {
  display: block;
}

.main-nav-mobile {
  display: none;
}

.main-nav ul {
  display: flex;
  list-style: none;
  flex-wrap: nowrap; /* 折り返しを無効化 */
  overflow-x: auto; /* はみ出した場合にスクロールを許可 */
  gap: 1rem;
}

.main-nav a {
  color: #333;
  font-weight: bold;
  padding: 0.5rem;
  display: block;
  white-space: nowrap; /* テキストの折り返しを防ぐ */
  line-height: 1.2; /* 行間を詰める */
}

.nav-toggle {
    display: none; /* デフォルトでは非表示 */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1010;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

.main-nav .nav-jp {
    display: block;
    margin-bottom: -2px; /* 日本語と英語の間の隙間を調整 */
}

.main-nav .nav-en {
  font-size: 0.7em;
  color: #777;
  font-weight: normal;
}

/* メインコンテンツ */
.main-content {
  padding-bottom: 2rem;
}

/* ヒーローセクション（トップ画像） */
.hero {
  position: relative;
  height: 50vh;
  min-height: 250px;
  background-color: #333;
  overflow: hidden;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  animation: kenburns 20s infinite;
}

.hero-slide.active {
  opacity: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  background: rgba(0,0,0,0.5);
  padding: 2rem;
  border-radius: 10px;
}

.hero-content .slogan {
  line-height: 1.5;
}

.slogan-en {
  display: block;
  font-size: clamp(1.5rem, 3.8vw, 3.6rem); /* 最小、推奨、最大フォントサイズ */
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  white-space: nowrap; /* テキストの折り返しを禁止 */
}

.slogan-jp {
  display: block;
  font-size: clamp(0.75rem, 1.9vw, 1.8rem); /* 最小、推奨、最大フォントサイズ */
  font-family: 'M PLUS Rounded 1c', sans-serif;
  color: #eee;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  margin-top: 0.5rem;
  white-space: nowrap; /* テキストの折り返しを禁止 */
}

/* Ken Burns Effect Animation */
@keyframes kenburns {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    animation-timing-function: ease-in;
  }
  50% {
    transform: scale(1.2) rotate(3deg);
    animation-timing-function: ease-out;
  }
}

/* セクションの共通スタイル */
.section {
  background: #fff;
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.section-title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #333;
}

/* ニュースセクション */
.news-list {
  list-style: none;
}

.news-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item time {
  font-weight: bold;
  color: #555;
  flex-shrink: 0;
}

.news-item .label {
  padding: 0.2rem 0.5rem;
  color: white;
  border-radius: 4px;
  font-size: 0.8em;
  margin-right: 0.5rem;
}

.label-important { background-color: #dc3545; }
.label-new { background-color: #28a745; }

/* 紹介動画セクション */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  background: #000;
  margin: 0 auto;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* アルバムグリッドセクション */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.album-grid div {
    text-align: center;
    background-color: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.album-grid div:hover {
    transform: translateY(-5px);
}

.album-grid img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.album-grid p {
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
}

/* フッター */
.site-footer {
  background: rgb(228, 228, 228);
  color: #555;
  text-align: center;
  padding: 0.67rem 0;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.footer-links img {
  height: 40px;
  transition: filter 0.3s;
}

.footer-links a:hover img {
  filter: none;
}

.copyright {
  margin-top: 1rem;
  font-size: 0.8em;
}

/* パスグリッドセクション */
.path-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.path-category {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.path-category h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #005bac;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.path-category h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #005bac;
    padding-bottom: 0.5rem;
}

.path-category .item {
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
}

/* メンバーページ */
.professor-section {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    background-color: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
}

.professor-photo {
    flex-shrink: 0;
}

.professor-photo img {
    width: 180px;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.professor-details h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.professor-details h2 a {
    color: #333;
    text-decoration: none;
}

.professor-details h2 a:hover {
    color: #005bac;
}

.professor-details h3 {
    font-size: 1.1rem;
    color: #005bac;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.professor-details p {
    line-height: 1.8;
    color: #555;
}

.students-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.student-category h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #005bac;
    padding-bottom: 0.5rem;
}

.student-list p {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    background-color: #f9f9f9;
    padding: 0.8rem 1.2rem;
    border-radius: 4px;
}

/* Project Page */
.project-card {
    background-color: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.project-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.project-card h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #005bac;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.project-card h5 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.project-card p {
    line-height: 1.8;
    color: #555;
}

.project-card ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-top: 1rem;
}

.project-card li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
    color: #555;
}

.project-image {
    max-width: 100%;
    height: auto;
    margin-top: 1rem;
    border-radius: 8px;
}

/* Contact Page Styles */
.contact-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.contact-text {
    flex: 1;
}

.contact-image {
    flex: 1;
    max-width: 50%;
}

.contact-map-image {
    width: 70%;
    height: auto;
    border-radius: 8px;
}

.google-map iframe {
    border-radius: 8px;
}

/* レスポンシブ対応 */
@media (max-width: 900px) { /* 768pxのブレークポイントを900pxに統合 */
  .nav-toggle {
    display: block; /* 900px以下で表示 */
  }

  .main-nav-desktop {
    display: none;
  }

  .main-nav-mobile {
    display: none; /* デフォルトで非表示 */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }

  .header-right {
    display: none; /* モバイルでは非表示 */
  }

  .main-nav-mobile.active {
    display: block; /* activeクラスで表示 */
  }

  .main-nav-mobile ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    list-style: none;
    padding: 0;
    gap: 0;
    border-top: 1px solid #ddd;
    border-left: 1px solid #ddd;
  }

  .main-nav-mobile li {
    text-align: center;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
  }

  .main-nav-mobile a {
    padding: 1rem 0.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
    white-space: normal; /* テキストの折り返しを許可 */
  }

  .main-nav-mobile a:hover {
    background-color: #f5f5f5;
    text-decoration: none;
  }

  .header-container {
    flex-direction: row;
    justify-content: space-between;
  }

  .slogan-en {
    font-size: 1.8rem;
  }

  .slogan-jp {
    font-size: 1rem;
  }

  .news-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .professor-section {
    flex-direction: column;
    text-align: center;
  }

  .students-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .contact-container {
    flex-direction: column;
  }

  .contact-image {
    max-width: 100%;
    margin-bottom: 1rem;
  }
}
