/* ============================================================
   style.css — 熱流体力学研究室
   ============================================================ */

:root {
  --primary:       #1b3a6b;
  --primary-light: #2a5298;
  --accent:        #e07b20;
  --bg:            #ffffff;
  --bg-alt:        #f4f6f9;
  --text:          #2c2c2c;
  --text-light:    #5a5a6a;
  --border:        #d8dde4;
  --max-width:     1080px;
  --radius:        8px;
  --shadow:        0 2px 12px rgba(0,0,0,0.08);
  --transition:    0.2s ease;
  --header-h:      64px;
}

/* ── リセット & ベース ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── ヘッダー ────────────────────────────────────────────── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: box-shadow var(--transition);
}
header.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,0.1); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}

.logo { display: flex; align-items: center; text-decoration: none; }
.logo-text { font-size: 1.05rem; font-weight: 700; color: var(--primary); white-space: nowrap; }

nav { display: flex; align-items: center; }

.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-list a {
  padding: 6px 11px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 4px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-list a:hover,
.nav-list a.active {
  background: var(--bg-alt);
  color: var(--primary);
  text-decoration: none;
}

.lang-toggle {
  padding: 5px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: 2px solid var(--primary);
  border-radius: 20px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.lang-toggle:hover { background: var(--primary); color: #fff; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* ── フッター ────────────────────────────────────────────── */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 24px 0;
  font-size: 0.875rem;
}
.footer-inner { display: flex; justify-content: center; }

/* ============================================================
   index.html（ホームページ）
   ============================================================ */

/* ─── スライドショー（MTE研究室に準拠：1200×400px、中央寄せ） ── */
.slideshow-wrap {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 400px;
  margin: var(--header-h) auto 40px;
  overflow: hidden;
  background: #111;
  user-select: none;
}

.slideshow-inner { position: relative; width: 100%; height: 100%; }

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}
.slide.active {
  opacity: 1;
  pointer-events: auto;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* 矢印ボタン */
.slide-prev,
.slide-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background: rgba(0, 0, 0, 0.30);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  width: 44px;
  height: 56px;
  cursor: pointer;
  border-radius: 4px;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide-prev:hover,
.slide-next:hover { background: rgba(0, 0, 0, 0.55); }
.slide-prev { left: 16px; }
.slide-next { right: 16px; }

/* ドットインジケーター */
.slide-dots {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 9px;
  z-index: 20;
}
.slide-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), transform var(--transition);
}
.slide-dot.active {
  background: #fff;
  transform: scale(1.25);
}

/* 研究室名キャプション（スライド下部） */
.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  padding: 32px 24px 14px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.slide-caption-sep { opacity: 0.5; }

/* 研究室概要（ホーム） */
#intro {
  padding: 40px 0 40px;
  background: var(--bg);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
#intro.visible { opacity: 1; transform: translateY(0); }

.intro-wrap { max-width: 760px; }
.home-intro-text {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 16px;
}
.home-prof-line {
  font-size: 0.9rem;
  color: var(--text-light);
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.home-prof-sub { font-size: 0.85rem; }

/* ニュース（ホーム） */
#news {
  padding: 56px 0 72px;
  background: var(--bg-alt);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
#news.visible { opacity: 1; transform: translateY(0); }
#news h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--primary);
  letter-spacing: 0.04em;
}
.news-list { display: flex; flex-direction: column; }
.news-item {
  display: flex;
  gap: 24px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.news-item:first-child { border-top: 1px solid var(--border); }
.news-date {
  flex-shrink: 0;
  font-size: 0.875rem;
  color: var(--text-light);
  white-space: nowrap;
}
.news-text { font-size: 0.95rem; line-height: 1.65; }

/* ============================================================
   内部ページ共通 (page-main)
   ============================================================ */
.page-main {
  padding-top: calc(var(--header-h) + 56px);
  padding-bottom: 96px;
  min-height: 75vh;
  animation: pageFadeIn 0.35s ease both;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 48px;
  padding-bottom: 14px;
  border-bottom: 3px solid var(--primary);
  letter-spacing: 0.04em;
}

/* セクション内見出し */
.section-sub {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.section-lead { margin-bottom: 20px; color: var(--text-light); }
.mt-lg { margin-top: 56px; }

/* ── 研究ページ ───────────────────────────────────────────── */
.about-block {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 40px;
  align-items: start;
  margin-bottom: 0;
}
.about-block-text p { margin-bottom: 14px; line-height: 1.9; }
.about-block-meta {
  background: var(--bg-alt);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 24px 20px;
}
.prof-name { font-weight: 700; font-size: 1rem; color: var(--primary); margin-bottom: 6px; }
.prof-title { font-size: 0.875rem; color: var(--text-light); line-height: 1.6; margin-bottom: 12px; }
.prof-links { list-style: none; }
.prof-links li + li { margin-top: 6px; }
.prof-links a { font-size: 0.875rem; color: var(--primary-light); }

/* 研究画像 */
.research-image-wrap { margin-bottom: 28px; }
.research-overview-img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* 研究カードグリッド */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
a.research-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  color: inherit;
  text-decoration: none;
  padding: 0;
}
a.research-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: var(--primary-light);
  text-decoration: none;
}
.research-card-img { width: 100%; height: 160px; overflow: hidden; background: var(--bg-alt); }
.research-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
a.research-card:hover .research-card-img img { transform: scale(1.04); }
.research-card-body { padding: 20px 20px 18px; flex: 1; display: flex; flex-direction: column; }
.research-icon { font-size: 2rem; margin-bottom: 8px; }
a.research-card h3 { font-size: 0.95rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
a.research-card p  { font-size: 0.875rem; color: var(--text-light); line-height: 1.7; margin-bottom: 10px; flex: 1; }
.card-readmore     { font-size: 0.85rem; font-weight: 600; color: var(--primary-light); }

/* ── 研究テーマ インライン展開（research.html） ─────────── */
.rt-section {
  margin-top: 52px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.rt-section:first-child { margin-top: 28px; padding-top: 0; border-top: none; }

.rt-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}
.rt-icon { font-size: 1.4rem; flex-shrink: 0; }

.rt-inner { display: flex; gap: 28px; align-items: flex-start; }
.rt-img {
  flex-shrink: 0;
  width: 300px;
  order: 2;
}
.rt-img img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: block;
}
.rt-body { flex: 1; order: 1; }
.rt-body p { margin-bottom: 14px; line-height: 1.9; }
.rt-body strong { color: var(--primary); font-weight: 700; }
.rt-keywords { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; }

.rt-pubs {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  list-style: none;
}
.rt-pubs li {
  font-size: 0.83rem;
  color: var(--text-light);
  line-height: 1.7;
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}
.rt-pubs li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ── メンバーページ ──────────────────────────────────────── */
.member-group { margin-bottom: 40px; }
.member-group-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.member-list { list-style: none; }
.member-item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.member-item:first-child { border-top: 1px solid var(--border); }
.member-name  { font-weight: 700; font-size: 0.95rem; }
.member-title { font-size: 0.83rem; color: var(--text-light); }
.member-desc  { font-size: 0.83rem; color: var(--text-light); }
.member-email { font-size: 0.82rem; color: var(--primary-light); word-break: break-all; }

.group-photo-wrap {
  margin-top: 56px;
  text-align: center;
}
.group-photo {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── 業績ページ ──────────────────────────────────────────── */
.pub-section { margin-bottom: 40px; }
.pub-section-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}
.pub-list { list-style: decimal; padding-left: 24px; }
.pub-list li { font-size: 0.9rem; line-height: 1.75; margin-bottom: 8px; }
.pub-more { margin-top: 10px; font-size: 0.9rem; }
.pub-more a { color: var(--primary-light); font-weight: 700; }
.pub-back-link { margin-bottom: 24px; font-size: 0.9rem; }
.pub-back-link a { color: var(--primary-light); }

/* ── アクセスページ ──────────────────────────────────────── */
.access-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.access-info dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; }
.access-info dt { font-weight: 700; color: var(--primary); white-space: nowrap; padding-top: 2px; }
.access-info dd { font-size: 0.95rem; line-height: 1.7; }
.map-placeholder {
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.85rem;
  padding: 16px;
  text-align: center;
}
#mapContainer iframe { border-radius: var(--radius); display: block; }

/* ── プロジェクト詳細ページ ──────────────────────────────── */
.project-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 28px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary-light);
  transition: color var(--transition);
}
.project-back-link:hover { color: var(--primary); text-decoration: none; }

.project-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--primary);
}
.project-detail-icon  { font-size: 3rem; flex-shrink: 0; line-height: 1; }
.project-detail-title { font-size: clamp(1.4rem, 4vw, 2.1rem); font-weight: 700; color: var(--primary); line-height: 1.3; }

.project-detail-image {
  margin: 24px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
  text-align: center;
}
.project-detail-image img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.project-detail-lead {
  font-size: 1.05rem;
  color: var(--text-light);
  margin-bottom: 32px;
  font-style: italic;
  line-height: 1.8;
}
.project-detail-body p { margin-bottom: 18px; line-height: 1.9; }
.project-detail-body strong { color: var(--primary); font-weight: 700; }

.project-meta-section { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.project-meta-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.project-keywords { display: flex; flex-wrap: wrap; gap: 8px; }
.keyword-tag {
  font-size: 0.85rem;
  color: var(--text-light);
}
.project-pub-list { list-style: disc; padding-left: 20px; }
.project-pub-list li { font-size: 0.9rem; line-height: 1.7; margin-bottom: 8px; }

.project-nav-footer { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 900px) {
  .about-block { grid-template-columns: 1fr; gap: 28px; }
  .access-content { grid-template-columns: 1fr; }
  .nav-list a { font-size: 0.83rem; padding: 6px 8px; }
}

@media (max-width: 720px) {
  :root { --header-h: 56px; }

  .menu-toggle { display: block; }
  .nav-list {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    gap: 0;
  }
  .nav-list.open { display: flex; }
  .nav-list li { width: 100%; }
  .nav-list a { display: block; padding: 12px 24px; border-radius: 0; font-size: 1rem; }
  .nav-list .lang-toggle { margin: 8px 24px; width: calc(100% - 48px); display: block; text-align: center; }

  .slideshow-wrap { height: 33.3vw; min-height: 180px; margin-bottom: 28px; }
  .slide-prev, .slide-next { width: 36px; height: 46px; font-size: 1.2rem; }
  .slide-caption { font-size: 0.78rem; padding: 20px 16px 10px; gap: 5px; }

  .page-main { padding-top: calc(var(--header-h) + 32px); }
  .page-title { margin-bottom: 32px; }

  .research-grid { grid-template-columns: 1fr; }
  .rt-inner { flex-direction: column; }
  .rt-img { width: 100%; order: 1; }
  .rt-body { order: 2; }

  .access-info dl { grid-template-columns: 1fr; }
  .access-info dt { margin-top: 12px; }
  .access-info dd { margin: 0; }

  .news-item { flex-direction: column; gap: 3px; }

  .project-detail-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .project-detail-icon { font-size: 2.2rem; }
}


/* ── アクセシビリティ ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
  #intro, #news { opacity: 1; transform: none; }
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
