/* ==========================================================================
   top.css
   役割: トップページ（index.html）専用のスタイル
   読み込み: index.html のみ common.css の後に読み込む
   ========================================================================== */

/* --------------------------------------------------------------------------
   ヒーローセクション
   -------------------------------------------------------------------------- */

#hero {
  display: flex;
  flex-direction: column;
  height: 631px;
  min-height: 260px;
  flex-shrink: 0;
  padding: 0;

  @media (max-width: 840px) {
    height: auto;
  }
}

#hero .info-bar {
  border-top: none;
  border-left: none;
  border-right: none;
}

.hero-logo-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-lg);

  @media (max-width: 840px) {
    padding: 132px var(--space-lg);
  }
}

/* ---- ロゴ フェードイン アニメーション ----
   初期状態のセット・クラス付与タイミングは top.js で制御する。
   .hero-logo--animate が付いてから transition が有効になる。
   ---------------------------------------- */
.hero-logo {
  width: 520px;
  height: auto;

  @media (max-width: 840px) {
    width: 100%;
    max-width: 400px;
  }
}

.hero-logo--animate {
  transition:
    opacity 1500ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 1500ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   コンテンツ行
   -------------------------------------------------------------------------- */

.content-row {
  display: flex;
  gap: var(--gap);
  align-items: stretch;

  @media (max-width: 960px) {
    flex-direction: column;
  }
}

.left-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.right-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* --------------------------------------------------------------------------
   About パネル
   -------------------------------------------------------------------------- */

.about-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.about-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-xl);
  padding: 0 var(--space-lg);

  @media (max-width: 840px) {
    gap: var(--space-lg);
  }
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 1em;
  font-family: var(--font-sans);
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  line-height: 1.8;
  text-align: justify;
}

.about-text--en {
  font-family: var(--font-mono);
  font-weight: 300;
  text-align: left;
  line-height: 1.8;
  font-size: var(--text-sm);
  /*SP*/
  @media (max-width: 840px) {
    font-size: 13px;
  }
}

/* Venn ダイアグラム */
.about-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  flex: 1;

  @media (max-width: 840px) {
    padding: var(--space-md);
  }
}

.about-diagram img {
  width: 100%;
  max-width: 443px;
  height: auto;

  @media (max-width: 840px) {
    max-width: unset;
  }
}

/* --------------------------------------------------------------------------
   Research Overview（自動ループ）
   研究テーマカードをゆっくり無限ループする。
   JS（top.js）がカードを複製し requestAnimationFrame で動かす。
   -------------------------------------------------------------------------- */

.research-overview {
  overflow: hidden;
  flex-shrink: 0;
  padding: var(--space-xs) 0;
}

/* ループするトラック（JS で translateX を制御） */
.research-track {
  display: flex;
  align-items: center;
  gap: 38px;
  will-change: transform;

  @media (max-width: 840px) {
    gap: 26px;
  }
}

/* リサーチカード1枚 */
.research-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 11px 13px;
  flex-shrink: 0;
}

/* カード内のサムネイル */
.research-card-img {
  width: 96px;
  flex-shrink: 0;
  overflow: hidden;
}

.research-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* カード内のテキスト */
.research-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-weight: 300;
  color: var(--color-text);
  flex: 1;
}

.research-tag {
  font-size: var(--text-base);
}

.research-card-text p:last-child {
  font-size: var(--text-sm);
}

/* --------------------------------------------------------------------------
   News パネル
   -------------------------------------------------------------------------- */

.news-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  /*SP*/
  @media (max-width: 840px) {
    gap: var(--space-lg);
  }
}

/* ヘッダー（見出し + view all） */
.news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);

  @media (max-width: 840px) {
    padding: 0 var(--space-md);
  }
}

.view-all {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 300;
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  line-height: 1;
  transition: opacity 0.15s ease;

  @media (max-width: 840px) {
    font-size: var(--text-sm);
  }
}

@media (hover: hover) {
  .view-all:hover {
    background-color: var(--color-accent);
  }
}

/* --------------------------------------------------------------------------
   ニュース一覧
   .news-list にすべての .news-item を並べるだけでよい。
   PHP はループで <div class="news-item"> を出力するだけ。
     - :first-child → フィーチャード（フル幅・大サムネイル）
     - :not(:first-child) → 2カラムグリッド・小サムネイル
   -------------------------------------------------------------------------- */

.news-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);

  @media (max-width: 840px) {
    gap: var(--space-md);
    padding: 0 var(--space-md);
  }
}

/* --- アイテム共通 --- */
.news-item {
  display: flex;
  flex-direction: column;
  min-width: 0; /* グリッドアイテムがコンテンツ幅より小さく縮めるよう許可 */
  border: var(--border);
  text-decoration: none;
  color: inherit;
  transition: 0.15s ease;
}

/* 日付バッジ */
.news-date {
  align-self: flex-start;
  border-right: var(--border);
  padding: 11px var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: 0.02em;
  flex-shrink: 0;
  /*SP*/
  @media (max-width: 840px) {
    font-size: var(--text-sm);
    padding: 4px var(--space-xs);
  }
}

/* サムネイル */
.news-thumb {
  overflow: hidden;
  flex-shrink: 0;
  padding: 0 var(--space-xs);
  border-top: var(--border);
  border-bottom: var(--border);
}

.news-thumb-inner {
  aspect-ratio: 234 / 156;
  border-left: var(--border);
  border-right: var(--border);
  overflow: hidden;
  position: relative;
  background-image: url("/common/images/thumb_default_grayblack.jpg");
  background-size: 100%;
  background-position: center;
}

.news-thumb img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease-out;
  will-change: transform;
}

.news-thumb-inner:has(img)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

@media (hover: hover) {
  .news-item:hover {
    background-color: var(--color-accent);
  }

  .news-item:hover .news-thumb img {
    transform: scale(1.04);
  }
}

/* タイトル */
.news-title {
  padding: var(--space-md) var(--space-sm) var(--space-xl);
  flex: 1;
  display: flex;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 2px;
  /*SP*/
  @media (max-width: 840px) {
    font-size: var(--text-sm);
    padding: var(--space-xs);
  }
}

/* --- 2件目以降：グリッド余白 ---
   偶数（2,4件目）= 左カラム → 左に23px
   奇数かつ1件目以外（3,5件目）= 右カラム → 右に23px */
.news-list .news-item:nth-child(even) {
  margin-left: 23px;

  @media (max-width: 840px) {
    margin-left: 0;
  }
}

.news-list .news-item:nth-child(odd):not(:first-child) {
  margin-right: 23px;

  @media (max-width: 840px) {
    margin-right: 0;
  }
}

/* --- 1件目：フィーチャード（自動適用） --- */
.news-list .news-item:first-child {
  grid-column: 1 / -1;
  border-right: none;
  border-left: none;
  /*SP*/
  @media (max-width: 840px) {
    border-right: var(--border);
    border-left: var(--border);
  }
}

.news-list .news-item:first-child .news-date {
  font-size: var(--text-base);
  /*SP*/
  @media (max-width: 840px) {
    font-size: inherit;
  }
}

.news-list .news-item:first-child .news-thumb {
  padding: 0 var(--space-lg);

  @media (max-width: 840px) {
    padding: 0 var(--space-sm);
  }
}

.news-list .news-item:first-child .news-thumb .news-thumb-inner {
  aspect-ratio: 524 / 280;
  background-size: cover;
  /*SP*/
  @media (max-width: 840px) {
    aspect-ratio: 234 / 156;
    background-size: 100%;
  }
}

.news-list .news-item:first-child .news-title {
  padding: 10px var(--space-sm);
}

.news-list .news-item:first-child .news-title a {
  font-size: var(--text-base);
}
