@charset "utf-8";

/* ============================================
   田中謙治研究室 HP - 新CSS (style.css?v=20260602)
   2026年版 レスポンシブ対応
   ============================================ */

/* --- CSS変数(色などを一元管理) --- */
:root {
  --color-primary: #4A65A9;
  --color-primary-dark: #3A5494;
  --color-primary-light: #8AA0D8;
  --color-primary-bg: #EEF2FA;
  --color-text: #2B2B2B;
  --color-text-light: #666;
  --color-bg: #ffffff;
  --color-bg-alt: #f6f8fc;
  --color-border: #d8dde8;
  --color-link: #2F4E97;
  --color-link-hover: #E37C00;
  --max-width: 1080px;
  --header-padding: 1.4rem 1.5rem;
  --font-jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
             "Yu Gothic", "Meiryo", メイリオ, sans-serif;
  --font-display: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}

/* --- リセット&ベース --- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
  background-color: var(--color-bg-alt);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
  vertical-align: middle;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}
a:hover, a:focus {
  color: var(--color-link-hover);
}

/* --- コンテナ --- */
#container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--color-bg);
  box-shadow: 0 0 24px rgba(74, 101, 169, 0.08);
}

/* --- ヘッダー(2段構造) --- */
#header {
  background: #fff;
  border-top: 4px solid var(--color-primary);
}

/* 上段:タイトル + 機関名 + 言語切替(白背景) */
.header-top {
  background: #fff;
  color: var(--color-text);
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.2rem;
  border-bottom: 1px solid var(--color-border);
}

#header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--color-primary-dark);
  flex: 0 0 auto;
}

#header h1 .subtitle {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  opacity: 0.75;
  margin-top: 0.3rem;
  font-family: var(--font-jp);
  color: var(--color-text-light);
}

.header-top-logos {
  flex: 0 1 auto;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s, opacity 0.2s;
}

.header-logo:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}

.header-logo img {
  height: 32px !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  display: block;
}

#header .lang-links {
  display: flex;
  gap: 0.5rem;
  font-size: 0.82rem;
  flex: 0 0 auto;
}

#header .lang-links a {
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--color-primary);
  border-radius: 3px;
  transition: background 0.2s, color 0.2s;
}

#header .lang-links a:hover,
#header .lang-links a[aria-current="page"] {
  background: var(--color-primary);
  color: #fff;
}

/* 下段:所属テキストのみ(青背景・白文字) */
.header-affiliation {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 0.8rem 1.5rem;
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: stretch;
}

.affiliation-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex: 1 1 50%;
  min-width: 0;
}

/* 機関の間に細い区切り線 */
.affiliation-row + .affiliation-row {
  border-left: 1px solid rgba(255,255,255,0.22);
  padding-left: 1.5rem;
}

.affiliation-text {
  flex: 1 1 auto;
  font-size: 0.88rem;
  line-height: 1.55;
  min-width: 0;
}

.affiliation-text p {
  margin: 0;
  text-indent: 0;
}

.affiliation-text p:first-child {
  opacity: 0.92;
  font-size: 0.82rem;
}

.affiliation-text p:last-child {
  font-weight: 500;
}

.affiliation-logo {
  flex-shrink: 0;
  background: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.affiliation-logo:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.affiliation-logo img {
  height: 22px !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  display: block;
}

/* --- ナビゲーション(7列x2行) --- */
#nav-toggle { display: none; }

.nav-toggle-label { display: none; }

#nav {
  background: var(--color-bg);
  border-bottom: 3px solid var(--color-primary);
}

#nav ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: var(--max-width);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

#nav li {
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

#nav li:nth-child(7n) { border-right: none; }
#nav li:nth-last-child(-n+7):not(:nth-child(n+8)) { border-bottom: none; }
/* 8項目以上ある時のための保険として下7個もボーダー無し */
#nav li:nth-last-child(1),
#nav li:nth-last-child(2),
#nav li:nth-last-child(3),
#nav li:nth-last-child(4),
#nav li:nth-last-child(5),
#nav li:nth-last-child(6),
#nav li:nth-last-child(7) {
  border-bottom: none;
}

#nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.65rem 0.4rem;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.82rem;
  text-align: center;
  line-height: 1.3;
  transition: background 0.18s, color 0.18s;
  height: 100%;
}

/* ナビアイコン(旧nav*.gif画像) - 左側のサムネ部分だけクリップ表示 */
.nav-icon-wrap {
  display: inline-block;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 4px;
  flex-shrink: 0;
  background: #fff;
}

.nav-icon {
  display: block;
  height: 100% !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  opacity: 0.92;
  transition: opacity 0.2s;
  object-position: left center;
}

#nav a:hover .nav-icon,
#nav a:focus .nav-icon,
#nav a.active .nav-icon {
  opacity: 1;
}

.nav-text {
  display: block;
}

#nav a:hover, #nav a:focus {
  background: var(--color-primary);
  color: #fff;
}

#nav a.active {
  background: var(--color-primary-bg);
  color: var(--color-primary-dark);
  font-weight: 600;
}

/* --- コンテンツ領域 --- */
#contents {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.8rem 2rem 2.5rem;
  min-height: 50vh;
}

/* --- メインビジュアル(スライダー) --- */
.hero-slider {
  position: relative;
  max-width: 600px;
  margin: 0 auto 1.8rem;
  background: var(--color-bg-alt);
}

.hero-slides-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(74, 101, 169, 0.15);
}

.hero-slides {
  display: flex;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.hero-slides img {
  flex: 0 0 100%;
  width: 100%;
  height: auto;
  display: block;
  max-width: none;
}

/* 矢印ボタン(PCはホバーで出現) */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.75);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--color-primary-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.25s, transform 0.2s;
  z-index: 2;
  opacity: 0;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.hero-slides-wrap:hover .hero-arrow,
.hero-slider:hover .hero-arrow {
  opacity: 1;
}

.hero-arrow:hover {
  background: #fff;
}

.hero-arrow:active {
  transform: translateY(-50%) scale(0.92);
}

.hero-prev { left: 12px; }
.hero-next { right: 12px; }

/* ドットインジケータ(画像の下に配置) */
.hero-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 0.8rem;
  padding: 0;
}

.hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: var(--color-border);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.hero-dot:hover {
  background: var(--color-primary-light);
}

.hero-dot.active {
  background: var(--color-primary);
  transform: scale(1.35);
}

/* --- 見出し --- */
h2 {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  padding: 0.7rem 1.2rem;
  margin: 0 0 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

h3 {
  color: var(--color-primary-dark);
  border-left: 4px solid var(--color-primary);
  padding: 0.2rem 0 0.2rem 0.8rem;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 0.8rem;
}

h4 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 1.4rem 0 0.5rem;
  color: var(--color-primary-dark);
}

#contents .text,
#main .text {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  font-size: 1rem;
  text-align: left;
}

p {
  margin: 0.8rem 0;
  text-indent: 0.8em;
}

p.noindent { text-indent: 0; }

/* --- リスト --- */
ul { margin: 0.5rem 0 0.5rem 1.6rem; padding: 0; }
ul li { padding: 0.15rem 0; }
ol { margin: 0.5rem 0 0.5rem 1.6rem; padding: 0; }
ol li { padding: 0.15rem 0; }

/* --- 図 --- */
.figure, .figure_center, .figure_fr, .figure_fl {
  margin: 1.2rem auto;
}

.figure_center {
  text-align: center;
}

.figure_fr {
  float: right;
  margin: 0 0 1rem 1.2rem;
  max-width: 50%;
}

.figure_fl {
  float: left;
  margin: 0 1.2rem 1rem 0;
  max-width: 50%;
}

.figure img, .figure_center img,
.figure_fr img, .figure_fl img {
  margin: 0.2rem 0 0.4rem;
  border-radius: 3px;
}

/* レスポンシブiframe(YouTube埋め込み等) */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  background: #000;
  border-radius: 3px;
  overflow: hidden;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.figcaption {
  font-size: 0.88rem;
  color: var(--color-text-light);
  line-height: 1.45;
  padding: 0 0.3rem;
  text-align: left;
}

.figcaption.center { text-align: center; }

/* --- テーブル(メンバー一覧など) --- */
table.member {
  width: 100%;
  margin: 0 0 1rem;
  border-collapse: collapse;
  border-top: 1px solid var(--color-border);
}

table.member td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  font-size: 0.92rem;
}

table.member tr:nth-child(odd) {
  background-color: var(--color-bg-alt);
}

/* --- メンバー一覧用 --- */
.member-section {
  margin: 2rem 0;
  padding-bottom: 1.8rem;
  border-bottom: 1px dotted #c5cad6;
}

.member-section:last-of-type {
  border-bottom: none;
}

.member-section h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.member-content {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.member-photo {
  text-align: center;
}

.member-photo img {
  width: 100%;
  max-width: 200px;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

.member-photo .figcaption {
  margin-top: 0.4rem;
  text-align: center;
  font-size: 0.82rem;
}

.member-info p {
  margin: 0.6rem 0;
  text-indent: 0;
}

.member-info p.bio {
  background: var(--color-bg-alt);
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--color-primary-light);
  border-radius: 0 4px 4px 0;
  font-size: 0.95rem;
}

.member-tag {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--color-primary-dark);
  background: var(--color-primary-bg);
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

/* --- フッター --- */
#footer {
  background: var(--color-bg-alt);
  border-top: 3px solid var(--color-primary);
  padding: 1.8rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 2rem;
}

#footer .footer-kakenhi {
  margin: 0 0 1.4rem;
}

#footer .footer-kakenhi img {
  max-width: 220px;
  transition: opacity 0.2s, transform 0.2s;
}

#footer .footer-kakenhi a:hover img {
  opacity: 0.85;
  transform: translateY(-2px);
}

#footer .footer-counter {
  margin: 0.8rem 0;
}

#footer .footer-counter img {
  height: 16px;
  vertical-align: middle;
}

#footer .footer-counter .label {
  font-size: 0.8rem;
  margin-right: 0.5rem;
  vertical-align: middle;
}

#footer .copyright {
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
  color: var(--color-text-light);
}

#footer .notice {
  margin: 0.4rem 0;
  font-size: 0.8rem;
}

/* --- ユーティリティ(既存維持) --- */
.w10 { width: 10%; } .w20 { width: 20%; } .w30 { width: 30%; }
.w40 { width: 40%; } .w45 { width: 45%; } .w50 { width: 50%; }
.w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; }
.w90 { width: 90%; } .w100 { width: 100%; }

.mb0  { margin-bottom: 0 !important; }
.mb05 { margin-bottom: 5px !important; }
.mb10 { margin-bottom: 10px !important; }
.mb15 { margin-bottom: 15px !important; }
.mb20 { margin-bottom: 20px !important; }
.mb25 { margin-bottom: 25px !important; }
.mb30 { margin-bottom: 30px !important; }

.mt0  { margin-top: 0 !important; }
.mt05 { margin-top: 5px !important; }
.mt10 { margin-top: 10px !important; }
.mt15 { margin-top: 15px !important; }
.mt20 { margin-top: 20px !important; }
.mt25 { margin-top: 25px !important; }
.mt30 { margin-top: 30px !important; }
.mt40 { margin-top: 40px; }

.clear  { clear: both; }
.center { text-align: center; text-indent: 0; }
.right  { text-align: right; }
.left   { text-align: left; }
.small  { font-size: 0.85em; }
.color  { color: #c0392b; }
.w100px { width: 100px; }

hr {
  border: 0;
  border-top: 1px dotted #aaa;
  margin: 1.5rem 0;
}

blockquote {
  margin: 0.8rem 0;
  padding: 0.8rem 1.2rem;
  border-left: 4px solid var(--color-primary-light);
  background: var(--color-bg-alt);
  border-radius: 0 4px 4px 0;
}

blockquote p { text-indent: 0; }

img.ic { vertical-align: middle; }

.back_color {
  width: 95%;
  margin: 1rem auto;
  padding: 1.2rem 1rem;
  background-color: var(--color-bg-alt);
  border-left: 3px solid var(--color-primary-light);
  border-radius: 4px;
}

/* ============================================
   タブレット(769px〜1024px)
   ============================================ */
@media (max-width: 1024px) and (min-width: 769px) {
  #nav a {
    font-size: 0.82rem;
    padding: 0.75rem 0.3rem;
  }
  #header h1 { font-size: 1.5rem; }
  #contents { padding: 1.5rem 1.5rem 2rem; }
}

/* ============================================
   スマホ(768px以下)
   ============================================ */
@media (max-width: 768px) {
  body { font-size: 15px; }

  #container { box-shadow: none; }

  /* ヘッダー上段 */
  .header-top {
    padding: 0.85rem 1rem;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  #header h1 {
    font-size: 1.1rem;
    flex: 1 1 auto;
  }
  #header h1 .subtitle {
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    margin-top: 0.2rem;
  }
  .header-top-logos {
    gap: 0.5rem;
  }
  .header-logo img {
    height: 22px !important;
  }
  #header .lang-links a {
    padding: 0.22rem 0.5rem;
    font-size: 0.72rem;
  }

  /* ヘッダー下段(所属テキストのみ・青背景)スマホでは縦並び */
  .header-affiliation {
    flex-direction: column;
    padding: 0.7rem 1rem;
    gap: 0.5rem;
  }
  .affiliation-row {
    flex: 1 1 auto;
  }
  /* 区切り線解除 */
  .affiliation-row + .affiliation-row {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid rgba(255,255,255,0.18);
    padding-top: 0.5rem;
  }
  .affiliation-text {
    font-size: 0.74rem;
    line-height: 1.4;
  }
  .affiliation-text p:first-child {
    font-size: 0.7rem;
  }

  /* ナビ:ハンバーガー(押すと展開、2列) */
  .nav-toggle-label {
    display: block;
    background: var(--color-primary);
    color: #fff;
    padding: 0.9rem 1.1rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    text-align: left;
    position: relative;
    letter-spacing: 0.05em;
  }
  .nav-toggle-label::before {
    content: '☰';
    margin-right: 0.6rem;
    font-size: 1.1rem;
    vertical-align: middle;
  }
  .nav-toggle-label::after {
    content: '';
    position: absolute;
    right: 1.1rem;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #fff;
    transform: translateY(-50%);
    transition: transform 0.25s;
  }
  #nav-toggle:checked ~ .nav-toggle-label::after {
    transform: translateY(-50%) rotate(180deg);
  }

  #nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
    border-bottom: 0;
  }
  #nav-toggle:checked ~ #nav {
    max-height: 1200px;
    border-bottom: 3px solid var(--color-primary);
  }

  #nav ul {
    grid-template-columns: repeat(2, 1fr);
  }
  #nav li {
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
  }
  #nav li:nth-child(7n) {
    border-right: 1px solid var(--color-border);
  }
  #nav li:nth-child(2n) {
    border-right: none;
  }
  /* 全部下ボーダー復活 */
  #nav li:nth-last-child(-n+7):not(:nth-child(n+8)),
  #nav li:nth-last-child(1),
  #nav li:nth-last-child(2),
  #nav li:nth-last-child(3),
  #nav li:nth-last-child(4),
  #nav li:nth-last-child(5),
  #nav li:nth-last-child(6),
  #nav li:nth-last-child(7) {
    border-bottom: 1px solid var(--color-border);
  }
  #nav li:nth-last-child(-n+2) {
    border-bottom: none;
  }

  #nav a {
    flex-direction: row;
    gap: 0.6rem;
    font-size: 0.82rem;
    padding: 0.7rem 0.6rem;
    text-align: left;
    justify-content: flex-start;
  }
  .nav-icon-wrap {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }

  /* コンテンツ */
  #contents {
    padding: 1.2rem 1rem 1.8rem;
  }

  h2 { font-size: 1.05rem; padding: 0.6rem 0.9rem; }
  h3 { font-size: 1rem; }
  h4 { font-size: 0.98rem; }

  /* 段落のインデント解除(スマホでは見づらいため) */
  p { text-indent: 0; margin: 0.7rem 0; }

  /* 図の回り込みを解除 */
  .figure_fr, .figure_fl {
    float: none;
    max-width: 100%;
    margin: 1rem auto;
  }
  .w60, .w70, .w80, .w90 { width: 100%; }
  .w40, .w45, .w50 { width: 80%; }

  /* テーブル */
  table.member { font-size: 0.88rem; }
  table.member td { padding: 0.45rem 0.5rem; }

  /* メンバーセクション スマホでは縦並び */
  .member-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .member-photo {
    max-width: 180px;
    margin: 0 auto;
  }

  /* スライダー(スマホでは矢印非表示) */
  .hero-arrow { display: none; }
  .hero-dots { margin-top: 0.6rem; gap: 6px; }
  .hero-dot { width: 8px; height: 8px; }

  /* フッター */
  #footer { padding: 1.5rem 1rem; }
  #footer .footer-kakenhi img { max-width: 180px; }
}

/* ============================================
   超小サイズ(480px以下)の微調整
   ============================================ */
@media (max-width: 480px) {
  #header h1 { font-size: 1rem; }
  #header { gap: 0.5rem; }
  h2 { font-size: 1rem; }
}
