/* 東郷研究室 共通スタイル */

html {
  scroll-padding-top: 72px; /* sticky header の高さ分オフセット */
}

:root {
  --primary: #C62828;
  --primary-hover: #B71C1C;
  --primary-light: #EF5350;
  --primary-dark: #8E0000;
  --ink: #1a1a1a;          /* 見出し用のほぼ黒 */
  --text: #374151;         /* 本文 */
  --muted: #6b7280;        /* 補助テキスト */
  --line: #e5e7eb;         /* 区切り線・ボーダー */
  --font-sans: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  --font-display: 'Space Grotesk', 'Noto Sans JP', sans-serif;
  --radius: 8px;           /* 角丸は全サイトこの1値に統一 */
}

/* Tailwind v2 に無い w-fit を補完（ニュースのタグ等が縦積み時に伸びるのを防ぐ） */
.w-fit { width: fit-content; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--ink); }
footer h1, footer h2, footer h3, footer h4 { color: #fff; }

.font-display { font-family: var(--font-display); }

/* ヒーローの英字ラベル（Tailwind v2 は tracking-[0.3em] 記法非対応のため自前定義） */
.hero-eyebrow { letter-spacing: 0.3em; }

.text-primary { color: var(--primary); }
.hover\:text-primary:hover { color: var(--primary); }
.group:hover .group-hover\:text-primary { color: var(--primary); }
.bg-primary { background-color: var(--primary); }
.hover\:bg-primary-hover:hover { background-color: var(--primary-hover); }
.border-primary { border-color: var(--primary); }

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

/* セクション見出し（英字オーバーライン + 左揃え） */
.section-header { margin-bottom: 3rem; }
.section-eyebrow {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.section-eyebrow::before {
  content: "";
  width: 2rem;
  height: 2px;
  background: var(--primary);
}
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 900;
  line-height: 1.2;
}

.transition-colors { transition-property: color, background-color, border-color; transition-duration: 300ms; }
.transition-transform { transition-property: transform; transition-duration: 300ms; }
.hover\:scale-105:hover { transform: scale(1.05); }

/* モバイルメニュー */
.mobile-menu { transform: translateX(100%); transition: transform 0.3s ease-in-out; }
.mobile-menu.open { transform: translateX(0); }
.overlay { opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.overlay.open { opacity: 1; visibility: visible; }

/* カスタムアニメーション */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.animate-bounce-custom {
  animation: bounce 2s infinite;
}

/* カード効果 */
.card-hover {
  border: 1px solid var(--line);
  transition: border-color 0.2s ease;
}
.card-hover:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--primary);
}

/* タブ（アンダーライン型） */
.tab-active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

/* タブ（下線型、index.html用） */
.tab-button {
  background: none;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.tab-button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-button:hover {
  background: none;
  color: var(--primary);
}
/* タブの安全なセンタリング（中央寄せしつつオーバーフロー時も左端までスクロール可能） */
.tab-scroll > .tab-button:first-child { margin-left: auto; }
.tab-scroll > .tab-button:last-child { margin-right: auto; }

/* タブ横スクロールの気配（端に影。スクロール末端に着くと自動で消える） */
.tab-scroll {
  background:
    linear-gradient(90deg, #F9FAFB 30%, rgba(249, 250, 251, 0)) left / 40px 100%,
    linear-gradient(270deg, #F9FAFB 30%, rgba(249, 250, 251, 0)) right / 40px 100%,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.22), transparent) left / 14px 100%,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.22), transparent) right / 14px 100%;
  background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* タブ高さ統一（index.html用）：全タブを同一グリッドセルに重ね，最大高さを共有 */
.tab-contents { display: grid; }
.tab-contents > .tab-content { display: block; grid-area: 1 / 1; visibility: hidden; }
.tab-contents > .tab-content.active { visibility: visible; }

/* 丸いアイコン（index.html用） */
.circle-icon {
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--primary);
}

/* プロジェクト個別ページのトップ画像（スクリム＋ドットで解像度差を均す） */
.project-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}
.project-hero img {
  display: block;
  width: 100%;
  filter: saturate(0.92) contrast(1.04);
}
.project-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(rgba(0, 0, 0, 0.10) 1px, transparent 1px) 0 0 / 3px 3px,
    linear-gradient(180deg, rgba(0, 0, 0, 0.02) 55%, rgba(0, 0, 0, 0.22));
  pointer-events: none;
}

/* スクロールフェードイン */
.fade-in-up { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in-up.is-visible { opacity: 1; transform: none; }

/* ヒーロー（ライト・スプリット、index.html用） */
.hero-split { background: #f6f1ea; }
.hero-split h1 {
  font-size: clamp(2rem, 3.8vw, 3.4rem);
  line-height: 1.2;
}
.hero-split-img { object-position: 45% 62%; }
@media (min-width: 768px) {
  .hero-split { height: calc(100vh - 73px); }
}

/* 以下 .hero-section / .hero-copy は旧ダークヒーロー用。index_en.html が使用中のため残置 */
/* ヒーロー文言を画像の主題から逃がす */
.hero-copy {
  max-width: 48rem;
}

.hero-copy h1 {
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1.15;
}

.hero-copy p {
  line-height: 1.5;
}

.hero-copy p:last-child {
  margin-bottom: 0;
  font-size: 0.95rem;
}

@media (max-width: 767px) {
  .hero-section {
    background-position: 58% center;
  }

  .hero-copy {
    align-items: center;
    justify-content: flex-start;
    padding-top: 0.75rem;
  }

  .hero-copy h1 {
    font-size: 1.75rem;
  }
}

@media (min-width: 768px) {
  .hero-section {
    background-position: center center;
    height: calc(100vh - 64px);
  }

  .hero-copy {
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    padding-top: 16vh;
    padding-left: clamp(2rem, 6vw, 5rem);
    margin-left: 0;
  }
}
