* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Hiragino Mincho ProN", "游明朝", "Yu Mincho", "MS PMincho", serif;
  letter-spacing: -0.02em; /* または -0.02em 程度 */
  line-height: 1.4;  /* 適切な行間、もしくは1.4など*/
  background: #f9f9f9;
  color: #333;
  padding-top: 102px; /* topheader40 + ヘッダー分おそらく72の余白を確保 */
  overflow-x: hidden;
  word-wrap: break-word;
  margin-left: 20px;
  margin-right: 20px;
}
/* トップヘッダーの共通スタイル */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  background-color: #002244;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  z-index: 1000;
  transition: transform 0.3s ease; /* ← スライドアニメーション */
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 非表示時の状態（上へスライド） */
.top-header.hidden {
  transform: translateY(-100%);
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-utils a {
  color: white;
  text-decoration: none;
  margin-left: 15px;
}
.header-utils input[type="search"] {
  padding: 6px 10px;
  width: 150px;         /* 横幅を広げたい場合はここを調整 */
  font-size: 14px;      /* 文字サイズ */
  border-radius: 4px;
  border: none;
}
.lang-switch {
  font-size: 12px;
  white-space: nowrap;
  display: flex;
}

.lang-btn {
  color: #fff;
  text-decoration: none;
  margin: 0 3px;
}

.lang-btn:hover {
  text-decoration: underline;
}
.lang-flag img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid white;
  transition: transform 0.2s, box-shadow 0.2s;
}

.lang-flag img:hover {
  transform: scale(1.1);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}


header {
  position: fixed;
  left: 0;
  top: 72px;
  width: 100%;
  height: 30px;
  z-index: 1000;
  background: #003366;
  color: white;
  padding: 0px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.top-nav {
  display: flex;
  gap: 12px;            /* ナビ同士の余白 */
  list-style: none;     /* ・マークを消す */
  padding: 0;
  margin: 0;
}
.top-nav li a {
  color: white;
  text-decoration: none;
  font-size: 14px;
}
.logo {
  font-size: 22px;
  font-weight: bold;
}
.logo a {
  text-decoration: none;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
}
.logo a:hover {
  background-color: #7F99B2;
  color: white;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}
nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
nav ul li a {
  text-decoration: none;
  color: white;
  font-size: 14px;
}
nav ul li a:hover {
  text-decoration: underline;
}

/* ナビゲーションのドロップダウン */
.main-nav {
  list-style: none;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-item {
  position: relative;
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-radius: 4px;
  padding: 10px 0;
  z-index: 1000;
  min-width: 160px;
}

.dropdown li {
  padding: 0;
}

.dropdown li a {
  display: block;
  padding: 10px 20px;
  color: #003366;
  background: white;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

.dropdown li a:hover {
  background: #f0f0f0;
}

.nav-item:hover .dropdown {
  display: block;
}
  /* テキスト折り返しを許可 */
.top-header .title h1,
.top-header .title p {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}
/* スクロール補正 スマホでリンクに飛ぶ時のヘッダー分押し下げ幅？*/
section[id], .section[id], #about {
  scroll-margin-top: 100px;
}/*ここまでheader*/

/*セクションヘッダーのホバー効果*/
.section-header h2 a {
  color: #ffffff;
  background-color: #003366;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  border: 2px solid #003366;
  font-weight: bold;
  display: inline-block;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.section-header h2 a:hover {
  background-color: #1a4466;  /* ← #003366を少し明るく */
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px); /* 少し浮く感じ */
}

/* ========== スマホ対応レイアウト ========== */
/* ハンバーガーとモバイルナビ用のスタイル */
.hamburger {
  font-size: 26px;
  color: white;
  cursor: pointer;
  display: none;
  position: absolute;    /* 右上に固定 */
  top: 20px;              /* 必要に応じて微調整 */
  right: 20px;
  z-index: 1100;          /* ヘッダーより上にくるように */
}

.mobile-nav {
  position: fixed;            /* ← 固定表示 */
  top: 72px;                  /* ← .top-header の下に配置 */
  left: 0;
  width: 100%;
  background: #003366;
  padding: 6px 12px;
  display: none;
  z-index: 999;               /* ヘッダーより1段下（または上でもOK） */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mobile-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav li a {
  color: white;
  text-decoration: none;
  display: block;
  padding: 6px 8px;   /* ← 各項目の上下余白を調整 */
  font-size: 14px;     /* ← 文字サイズ小さめに調整 */
  border-bottom: 1px solid #445566;
}

/* モバイル表示時のレイアウト */
@media screen and (max-width: 768px) {
  .hamburger {
    display: block;
  }

  body {
    padding-top: 72px;
  }

  .top-header {
    flex-direction: row; /* または column だとしても文脈に合わせて */
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    height: auto;
    position: fixed; /* hamburgerのabsolute配置に必要 */
  }
  .top-header .title p {
  white-space: nowrap;         /* nowrapだと折り返し禁止 */
  overflow: hidden;            /* はみ出し部分を隠す（省略可能） */
  text-overflow: ellipsis;     /* はみ出したら "…" で省略（任意） */
    font-size: 10px;  /* スマホ用にやや小さめに調整 */
    max-width: 100%;
  }

  .top-header .title {
    flex-shrink: 1;
    min-width: 0;
  }

  /* ナビゲーション用の header（PC用）を非表示に */
  header:not(.top-header) {
    display: none;
  }

  .logo-area {
    flex-direction: row;   /* ← 横並び */
    /*flex-wrap: wrap;        ← 必要なら折り返し */
    align-items: center;
    gap: 10px;
  }

 /* ヘッダーのユーティリティ（お問い合わせ・検索）を非表示 */
  .header-utils {
    display: none;
  }

 nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 14px;
    gap: 5px;
  }

  .nav-item {
    width: 100%;
  }

  .dropdown {
    position: relative;
    box-shadow: none;
    background: #f9f9f9;
  }

  .dropdown li a {
    padding-left: 30px;
  }

  .dropdown li a {
    background: none;
    padding: 8px 12px;
  }
}/*from @media screen and (max-width: 768px)*/
  /*ここまでモバイル表示*/

.section {
  background-color: rgba(255, 255, 255, 0.9);
  max-width: 960px;
  margin: 40px auto;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0,0,0,0.1);
}

h2 {
  border-bottom: 2px solid #6699cc;
  padding-bottom: 10px;
}
/*タイトルヘッダーの装飾*/
.section-header {
  background-color: #003366;
  color: #fff;
  padding: 20px;
  text-align: left;
  margin-bottom: 30px;
}

.section-header h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 1px;
}
.professor-photo {
  float: right;
  width: 30vw;
  max-width: 360px; 
  margin: 0 0 20px 20px;
  border-radius: 8px;
}

.professor-name {
  margin-top: 30px;
  font-weight: bold;
  text-align: right;
}

/* もっと見るボタン*/
.greeting-text.collapsed {
  max-height: 160px; /* 表示上限（行数に応じて調整） */
  overflow: hidden;
  position: relative;
}
.trim-text.collapsed {
  max-height: 280px; /* 表示上限（行数に応じて調整） */
  overflow: hidden;
  position: relative;
}

.show-all-button {
  margin: 8px auto;
  padding: 6px 14px;
  background-color: #f57c00;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  border-bottom: 2px solid #222;
}
.show-all-button:hover {
  background-color: #fb8c00;
  transform: translateY(2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid #222;
}

.button-container {
  text-align: right; /* ボタンを右端に */
  margin-top: 8px;
  margin-bottom: 20px; /* お好みで調整可能 */
}
.view-more-btn {
  margin-top: 10px;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
  background-color: #666666;
  color: white;
  border: none;
  border-radius: 5px;

  /* 立体感を演出 */
  font-weight: bold;
  box-shadow: 0 3px 0 #222, 0 8px 12px rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid #222;

  transition: all 0.15s ease-in-out;
}

.view-more-btn:hover {
  background-color: #777777; /* 少し明るく */
  transform: translateY(2px); /* 浮き下がる */
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid #222;
}

.neural-separator {
  background-image: url('images/neural-separator.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  width: 100vw;
  height: 80px;
  overflow: hidden;
  margin: 40px 0;
}
.role-group {
  margin-bottom: 30px;
  background: #fff;
  padding: 15px;
  border-left: 4px solid #003366;
  border-right: 4px solid #003366;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border-radius: 6px;
}

.role-block {
  margin-bottom: 30px;
  background: #fff;
  padding: 15px;
  border-left: 4px solid #003366;
  border-right: 4px solid #003366;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border-radius: 6px;

}

.role-block h3 {
  font-size: 1.4em;
  color: #003366;
  border-left: 5px solid #6699cc;
  padding-left: 10px;
  margin-bottom: 15px;
}

.staff-grid {
  display: flex;
  align-items: flex-start;  /* 行内で高さを揃えない */
  flex-wrap: wrap;
  justify-content: center; /* カードを中央に配置 */
  gap: 20px; /* カード間のスペース */
  margin-bottom: 30px;
}

.staff-card {
  position: relative;   /* ポップをこのカード基準で絶対配置するため必須 */
  overflow: visible;    /*  はみ出しOKにする（clipされない） */
  align-self: flex-start;/* 念のため、各カードだけ独立して上寄せで維持したい場合 */
  max-width: 300px;
  background-color: #fffdfa;
  background-image: linear-gradient(to bottom, rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 100% 28px;
  background-repeat: repeat;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border: 1px solid #e0e0e0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  font-family: "Hiragino Mincho ProN", "游明朝", "Yu Mincho", "MS PMincho", serif;
  letter-spacing: -0.02em;
  line-height: 1.4;
  scroll-margin-top: 112px;
}

.staff-card:hover { 
  transform: translateY(-6px);box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);}

.staff-card.wide-card {
  flex: 1 1 100%;
  max-width: 100%;
}

.staff-detail {
  max-height:0;
  line-height: 1.6;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  text-align: left;
}
.staff-card.active > .staff-detail {
  max-height: fit-content; /* 必要に応じて調整 */
  opacity: 1;
}

/* 画像のスタイル 100by100 */
.staff-photo{
  display: block;
  max-width: 300px;        /* 写真の最大幅を固定 */
  width: 100%;    
  aspect-ratio: 1 / 1;   /* 正方形 */
  height: auto;          /* ブラウザが aspect-ratio で高さを計算 */
  object-fit: cover;     /* はみ出す分はトリミング */
  border-radius: 6px;
  margin: 0 auto 2px;   /* ← 左右を auto にして中央配置 */
}
.staff-info {
  padding: 0;
}

.staff-info h4 {
  margin: 0;
  font-size: 14px;
  color: #003366;
}

.staff-card.no-photo {
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
}

ul.namelist {
  margin: 0;
  padding-left: 20px;
  list-style-type: disc;
}

ul.namelist li {
  margin-bottom: 5px;
}

/* 教室の沿革history */

.history-header {
  text-align: center;
  margin-bottom: 20px;
}

.history-header img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 6px;
}

.history-header h2 {
  font-size: 24px;
  margin: 12px 0 4px;
  color: #003366;
}

.history-header p {
  font-size: 13px;
  color: #666;
}

.history-table {
  border-top: 1px solid #ccc;
}

.history-row {
  display: flex;
  border-bottom: 1px solid #ccc;
  padding: 10px 0;
}

.history-year {
  width: 30%;
  font-weight: bold;
  color: #003366;
  padding-right: 20px;
}

.history-desc {
  width: 70%;
  line-height: 1.5;
}

.footer {
  text-align: center;
  padding: 20px;
  background-color: rgba(0,0,0,0.6);
  color: white;
  font-size: 0.9em;
}