/* * {
  outline: 1px solid red !important;
} */

/* ========== ヒーロー背景セクション ========== */
.hero-scene {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: 0;
  transition: opacity 0.6s ease;
}

.hero-scene.fade-out {
  opacity: 0;
  pointer-events: none;
}

.hero-sns-links {
  position: absolute;
  top: 50%; /* 上下中央に配置 */
  left: 1rem; /* 画面の左端からの距離 */
  transform: translateY(-50%); /* さらに正確に中央揃え */
  z-index: 10; /* テキストやキャラクターより手前に表示 */
  display: flex;
  flex-direction: column; /* アイコンと文字を縦に並べる */
  gap: 0.25rem; /* 各リンク間の余白 */
}

/* 各SNSリンク（アイコン＋文字）のスタイル */
.sns-link {
  display: flex;
  align-items: center; /* アイコンと文字を上下中央揃え */
  gap: 1rem; /* アイコンと文字の間の余白 */
  color: white;
  font-weight: bold;
  /* text-decoration: none; */
  /* text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); 文字の視認性を上げるための影 */
  transition: opacity 0.2s ease;
  pointer-events: none; /* ★リンク全体をクリック不可にする */
}

/* アイコン画像だけクリックを有効化 */
.sns-link > img {
  pointer-events: auto;
}

/* アイコン画像のスタイル */
.sns-link img {
  width: auto; /* アイコンのサイズを統一 */
  height: 80px;
}

.sns-link span {
  font-size: 1.2rem; /* アイコンの隣の文字サイズ */
}

/* テキスト画像を囲むspanのスタイル */
.text-wrap {
  display: inline-block;
  vertical-align: middle;
  pointer-events: none;
}

/* テキスト画像の【初期状態】を設定 */
.text-wrap img {
  opacity: 0; /* ★最初は透明にして見えなくする */
  transform: translateY(10px); /* ★少し下に配置しておく */
  transition: opacity 0.4s ease, transform 0.4s ease; /* ★アニメーションの準備 */
}

/* リンク全体にホバーした時にテキスト画像を【表示】 */
.sns-link > img:hover ~ .text-wrap img {
  opacity: 1; /* ★不透明度を1にして表示 */
  transform: translateY(0); /* ★本来の位置に戻す */
}

@media (max-width: 770px) {
  /* テキスト画像を囲んでいるspan(.text-wrap)を非表示にする */
  .sns-link .text-wrap {
    display: none;
  }
}

/* ========== 背景画像 ========== */
.scene-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("/assets/images/top-page/background.webp") no-repeat center
    center;
  background-size: cover;
  position: relative;
  transition: filter 0.2s ease, transform 0.2s ease;
  will-change: filter, transform;
}

/* ========== キャラクター表示 ========== */
.character {
  position: absolute;
  bottom: -90px;
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 1.5s ease-out, transform 1.5s ease-out;
  height: auto;
  /* width: 35%; */
  width: clamp(700px, 25vw, 1000px);
  z-index: 1;
}

.shisa {
  /* left: calc(44% + 10vw); */
  right: 0%;
  animation: fadeInLeft 1.5s ease-out forwards;
  animation-delay: 1s;
}

/* 画面幅が768px以下の時のスタイル */
@media (max-width: 700px) {
  .shisa {
    /* キャラクターが小さくなるのに合わせて、左の余白も調整 */
    left: 2%;
  }
}

.shisa.is-pinned {
  position: fixed; /* ビューポート基準で位置を固定 */
  top: 0; /* 画面の最上部に配置 */
  bottom: auto; /* 元のbottom指定を上書きしてリセット */
}

@media (max-width: 950px) and (max-height: 450px) {
  .shisa {
    right: -15%;
  }
}

@keyframes fadeInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hibiscus {
  position: absolute;
  bottom: 0px;
  /* left: 50%; */
  /* transform: translateX(-50%); */
  height: auto;
  width: 350px;
  z-index: 0;
}

/* 背景画像のスタイル */
.news-container {
  position: absolute;
  bottom: 20px;
  height: 100px; /* ◆ 高さは常に固定 */
  z-index: 10;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.1); /* 背景色（半透明の白） */
  border: 1px solid rgba(255, 255, 255, 0.3); /* 枠線 */
  border-radius: 12px; /* 角丸 */
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); /* 影 */
  backdrop-filter: blur(5px); /* すりガラス効果 */
  -webkit-backdrop-filter: blur(5px); /* Safari向け */

  /* --- スマホ表示（デフォルト） --- */
  width: 90vw;
  left: 50%;
  transform: translateX(-50%);
}

/* PC表示のスタイル */
@media (min-width: 768px) {
  .news-container {
    width: 500px;
    left: 20px;
    transform: none;
  }
}

/* テキストコンテンツのスタイル */
.news-container .news-content {
  position: relative;
  z-index: 2;
  padding: 1rem;
  width: 100%;
  height: 100%;
  overflow-y: hidden;
  overflow-x: hidden;
  color: black;
}

/* ★アニメーション用の新しいラッパーにスタイルを適用 */
.news-dynamic-content {
  display: flex; /* ← 子要素を横並びにする */
  align-items: baseline; /* ← テキストの下のライン（ベースライン）で揃える */
  gap: 1em; /* ← 日付と要約の間のスペース */
}

/* ★アニメーション中のクラスも新しいラッパーを対象にする */
.news-dynamic-content.is-hiding {
  opacity: 0;
  transform: translateX(20px);
}

/* テキストのスタイル */
.news-container h3 {
  font-size: 1.5rem;
  margin-bottom: 0.15rem;
}
.news-container p {
  font-size: 1rem;
  line-height: 1.5;
}
#news-date {
  flex-shrink: 0; /* ← ウィンドウが狭くても日付が縮まないようにする */
  font-weight: bold;
}

/* ニュース要約のコンテナ（はみ出しを隠す）*/
#news-summary {
  flex-grow: 1; /* ← 残りのスペースを全て使うようにする */
  min-width: 0; /* ← Flexbox内でoverflowを正しく機能させるための重要なおまじない */
  overflow: hidden;
  white-space: nowrap;
}

/* 実際に動くテキストのスタイル */
.news-summary-text {
  display: inline-block; /* アニメーション適用のため */
  padding-left: 100%; /* 右端からスタートさせるため */
}

/* スクロールアニメーションの定義 */
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* テキストが長い場合にJSで追加するクラス */
.news-summary-text.is-scrolling {
  animation-name: marquee;
  animation-timing-function: linear; /* 一定速度で動かす */
  /* animation-duration はJSで動的に設定します */
}

@media (max-width: 950px) and (max-height: 450px) {
  /* ニュースボックス全体を調整 */
  .news-container {
    height: 7vw;
    width: 90vw;
    max-width: 600px;
    bottom: 15px;
    left: 20px;
    right: auto;
    transform: none;
  }

  /* 「h3」と「.news-dynamic-content」を横に並べる */
  .news-container .news-content {
    display: flex;
    align-items: center;
    width: 100%;
  }

  /* 「NEWS」の見出しは縮まないようにする */
  .news-container h3 {
    flex-shrink: 0;
    margin-right: 1.5rem; /* 「日付」との間隔を調整 */
    white-space: nowrap;
  }

  /* 「日付」と「説明文」を横に並べる */
  .news-dynamic-content {
    display: flex;
    align-items: baseline;
    flex-grow: 1; /* 残りのスペースをすべて使う */
    overflow: hidden; /* はみ出したスクロールテキストを隠す */
  }

  /* 日付は縮まないようにする */
  #news-date {
    flex-shrink: 0;
    margin-right: 1rem; /* 「説明文」との間隔を調整 */
    white-space: nowrap;
  }

  /* 説明文のコンテナ（p#news-summary） */
  #news-summary {
    flex-grow: 1; /* 内側のFlexboxで残りのスペースをすべて使う */
    overflow: hidden;
    margin: 0;
    padding: 0;
  }

  /* 実際に流れるテキスト（spanタグ） */
  .news-description-text {
    display: block;
    /* white-space: nowrap; */
  }
}

/* コンテナを中央寄せにするスタイル */
/* 中央寄せの器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 絶対配置をやめてGridに */
.about-content {
  position: relative;
  padding-top: 0;
  display: grid;
  grid-template-columns: 1fr; /* デフォは縦積み */
  flex: 1; /* 残りの利用可能なスペースをすべて使う */
  min-width: 0; /* flexアイテムの縮小に関するバグを防ぐおまじない */
}

.corner-links {
  position: absolute; /* 絶対配置に設定 */
  top: clamp(0px, 10vw, 75px);
  right: 0px;
  width: clamp(180px, 40vw, 1000px);
}

/* テキスト：読みやすい行幅を確保 */
.text-block {
  /* ★行の長さを制御（読みやすさUP） */
  color: #fff;
  padding: 1.5rem 0;
  position: relative;
  z-index: 2;
}

/* 画像：枠内で自然に縮む／大きくなる */
.image-block {
  position: relative;
}
.about-image {
  width: 100%;
  height: auto;
  display: block;
}

/* 見出し＆アイコン */
.text-block h2 {
  display: flex;
  align-items: center;
  font-size: clamp(0.938rem, 0.369rem + 2.84vw, 2.5rem);
  margin-bottom: 0.5em;
}
.ryumofu-icon {
  height: 4.5em;
  vertical-align: middle;
  margin-right: 0.2em;
  filter: drop-shadow(-3px 2px 0.3px gray);
}

/* 本文サイズ */
.text-block p {
  font-size: clamp(0.938rem, 0.369rem + 2.84vw, 2.5rem);
  line-height: 1.6;
}

.highlight-text {
  color: #d7743b;
  font-weight: bold;
  font-size: clamp(1.25rem, 0.227rem + 5.11vw, 4.063rem);
}

/* スマホ：右上固定＋縦並び＋テキストと“同じ高さスタート”にする */
@media (max-width: 768px) {
  /* ←テキスト側を右に逃がして“重なりなし”で上揃えを維持 */
  .text-block {
    margin-top: 0; /* 余計な上マージンはゼロに */
  }
}

/* 1024px以上で重ねに切り替え */
@media (min-width: 1024px) {
  .about-content {
    grid-template-columns: 1.1fr 0.9fr;
    min-height: clamp(420px, 60vw, 720px); /* 画像の“置き場”を確保 */
  }
  .text-block {
    grid-column: 1 / 2;
    align-self: start;
    max-width: 60ch;
    padding: 1.5rem 0;
  }
  .image-block {
    grid-column: 1 / -1; /* 全体をまたいで背面に */
  }
  .about-image {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(75%, 1060px); /* 既存の60%感を踏襲しつつ上限 */
    height: auto;
    z-index: 1;
  }
}

/* ナビゲーションとコンテンツ全体を囲むラッパー */
.content-wrapper {
  position: relative;
}

/* ナビゲーションボタンのコンテナ */
.component-nav {
  position: absolute;
  top: 25px;
  right: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap; /* 最初から折り返しを有効にする */
  /* ボタン2つ分の横幅を指定して、3つ目が自動的に改行されるようにする */
  /* 計算: (下のボタン最大幅 180px * 2) + (gap 10px * 1) = 370px */
  width: 370px;
}

/* 各ナビゲーションボタンの共通スタイル */
.nav-button {
  position: relative; /* ::beforeを配置するための基準点にする */
  z-index: 3; /* テキストが背景アニメーションより手前に来るようにする */
  background-color: #fff; /* 元の背景色は透明にする */
  transition: color 300ms; /* 文字色の変化を滑らかにする */
  overflow: hidden; /* 角丸からはみ出る背景を隠す */

  /* --- 以下は既存のスタイル --- */
  width: min(160px, 35vw);
  padding: 10px 0;
  font-size: clamp(14px, 1.3vw, 18px);
  text-align: center;
  display: inline-block;
  /* colorは元の文字色を指定 */
  color: #333;
  text-decoration: none;
  border: 2px solid #d7743b;
  border-radius: 4px;
}

.nav-button:hover {
  color: #fff; /* ホバー時に文字色を白に変更 */
}

.nav-button::before {
  content: ""; /* 必須のプロパティ */
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0; /* アニメーション前の初期状態として、幅を0にする */
  background-color: #d7743b; /* アニメーションの色（焦茶色系のサンプル） */
  z-index: -1; /* テキストの背面に配置 */
  transition: width 300ms; /* widthの変化を0.3秒かけてアニメーション */
}

.nav-button:hover::before {
  width: 100%; /* ホバー時に背景の幅を100%に広げる */
}

@media (min-width: 1536px) {
  .component-nav {
    /* 横幅の固定を解除し、ボタンが1列に収まるようにする */
    width: auto;

    /* 折り返しを無効にして、横一列表示を強制する */
    flex-wrap: nowrap;
  }
}

@media (max-width: 1023px) {
  .component-nav {
    width: auto; /* 横幅の固定を解除 */
    flex-direction: column; /* 縦一列にする */
    align-items: flex-end;
    margin-bottom: 20px;
  }
}

/* ========== サークルキャラクターのスライド表示 ========== */

.character-slide {
  opacity: 0;
  transform: translateX(0);
  transition: all 0.8s ease-out;
}

.character-slide.slide-right {
  transform: translateX(100px);
}

.character-slide.slide-left {
  transform: translateX(-100px);
}

.character-slide.slide-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ========== Charactersセクション ========== */
#characters .character-header {
  text-align: center;
  margin-bottom: 3rem; /* 48px */
}

#characters .character-header h2 {
  font-size: 2.25rem; /* 36px */
  line-height: 2.5rem;
  font-weight: 700; /* font-bold */
  margin-bottom: 1rem; /* 16px */
  color: #ffffff;
}

#characters .character-header p {
  font-size: 1.125rem; /* 18px */
  line-height: 1.75rem;
  color: #d7743b; /* text-neutral-300 */
}

/* Character Layout Block */
.character-layout {
  display: flex;
  flex-direction: column; /* Default: mobile is vertical */
  align-items: center;
}

.character-image {
  width: 12rem; /* 192px, w-48 */
  height: auto;
  margin-bottom: 1.5rem; /* 24px, mb-6 */
}

.character-info {
  color: #ffffff;
  text-align: center; /* Default: mobile is centered */
}

.character-info h3 {
  font-size: 3.75rem; /* 60px, text-6xl */
  line-height: 1;
  font-weight: 700; /* font-bold */
  margin-bottom: 0.5rem; /* 8px, mb-2 */
}

.character-info p {
  padding-top: 2.5rem; /* 40px, py-10 */
  padding-bottom: 2.5rem; /* 40px, py-10 */
  color: #d7743b; /* text-neutral-300 */
}

/* ========== Main Activity Section ========== */
#main-activity .activity-header {
  text-align: center;
  margin-bottom: 3rem; /* 48px, mb-12 */
}

#main-activity .activity-header h2 {
  font-size: 1.875rem; /* 30px, text-3xl */
  line-height: 2.25rem;
  font-weight: 700; /* font-bold */
  color: #ffffff;
}

/* Grid Layout */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr)); /* Default: 1 column */
  gap: 2rem; /* 32px, gap-8 */
}

/* Individual Activity Cards */
.activity-card .card-image-wrapper {
  background-color: rgba(255, 255, 255, 0.05); /* bg-white/5 */
  border-radius: 0.75rem; /* 12px, rounded-xl */
  overflow: hidden;
  margin-bottom: 1rem; /* 16px, mb-4 */
}

.activity-card .work-card-image {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.activity-card h3,
.activity-card a {
  font-size: 1.25rem; /* 20px, text-xl */
  font-weight: 700; /* font-bold */
  color: #ffffff;
}

.activity-card p {
  font-size: 0.875rem; /* 14px, text-sm */
  color: #d7743b; /* text-neutral-400 */
}

/* ========== Responsive Styles ========== */

/* Medium screens (md) */
@media (min-width: 768px) {
  #main-activity .activity-header h2 {
    font-size: 2.25rem; /* 36px, md:text-4xl */
    line-height: 2.5rem;
  }

  .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 columns */
  }
}

/* Large screens (lg) */
@media (min-width: 1024px) {
  .activity-grid {
    gap: 3rem; /* 48px, lg:gap-12 */
  }
}

/* Responsive styles for medium screens and up (md) */
@media (min-width: 768px) {
  .character-layout {
    flex-direction: row; /* Becomes horizontal */
  }

  .character-image {
    margin-bottom: 0;
    margin-right: 2.5rem; /* 40px, md:mr-10 */
  }

  .character-info {
    text-align: left; /* Becomes left-aligned */
  }
}

/* ========== 各セクションの共通背景パターン ========== */
/* scrolling-patternクラスを持つすべてのsectionに適用 */
section.scrolling-pattern {
  position: relative; /* z-indexを機能させるための基準点 */
  overflow: hidden; /* はみ出した要素を隠す */

  /* ▼ 背景画像とアニメーション */
  background-image: url("/assets/images/top-page/minsa.webp"); /* ★ファイル名にハイフン(-)が必要です */
  background-repeat: repeat-x;
  background-size: auto 60px;
  background-position: top center;
  animation: scroll-left 30s linear infinite;
}

/* ★★★ パターンを持つセクション内のコンテナのスタイル ★★★ */
section.scrolling-pattern > .container {
  position: relative; /* positionを設定してz-indexを有効化 */
  z-index: 2; /* 背景(z-index: 1相当)より手前に配置 */

  padding: 4rem 1.5rem; /* 内側の余白 */
  border-radius: 12px; /* 角を丸くする */
}

/* ★★★ アニメーション本体の定義 (変更なし) ★★★ */
@keyframes scroll-left {
  from {
    background-position-x: 0;
  }
  to {
    background-position-x: -1810px; /* 画像の横幅に合わせてください */
  }
}

.character-section {
  position: relative;
  z-index: 1;
  padding: 2rem;
}

.content-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem; /* テキストと画像の間隔 */
  flex-wrap: wrap; /* 小画面で折り返す */
}

/* --- 左側のテキストコンテンツ --- */
.text-container {
  max-width: 500px;
  flex: 1;
  min-width: 300px;
}

.main-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
  color: #ffffff;
}

.subtitle {
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  margin: 0.5rem 0 2rem 0;
}

.character-name {
  font-size: 4.5rem; /* 88px */
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15);
}

.description {
  font-size: 1.75rem; /* 28px */
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

/* --- ボタン --- */
.button-group {
  display: flex;
  gap: 1.5rem; /* ボタン同士の間隔 */
}

.btn {
  padding: 1rem 2.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem; /* 18px */
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease-in-out;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.btn-profile {
  background-color: #e8825d;
  color: white;
}

.btn-details {
  background-color: #f7d26c;
  color: #5f4c0a; /* 文字色を濃くして可読性を確保 */
}

/* --- 右側の画像コンテンツ --- */
.image-container {
  flex: 1;
  min-width: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.character-image {
  max-width: 400px;
  width: 100%;
  height: auto;
  /* イラストを際立たせるドロップシャドウ */
  filter: drop-shadow(5px 5px 15px rgba(0, 0, 0, 0.25));
}

/* --- スマートフォン向けのレスポンシブ対応 --- */
@media (max-width: 768px) {
  .content-wrapper {
    flex-direction: column; /* 縦積みに変更 */
    text-align: center;
    gap: 2rem;
  }

  .main-title {
    font-size: 2.25rem; /* 36px, md:text-4xl */
    line-height: 2.5rem;
  }

  .subtitle {
    font-size: 1rem; /* 20px */
  }

  .character-name {
    font-size: 3rem;
  }

  .description {
    font-size: 1.5rem; /* 24px */
  }
  .button-group {
    justify-content: center;
  }
  .character-image {
    max-width: 320px;
  }
}
