/* === ダークテーマ適用 (by ChatGPT, 修正版) === */

/* ==================================================
   全体の基本設定
   ページ全体の背景色、文字色、フォントなど基本的なデザインを決める部分
================================================== */
body {
  background-color: #eeeeee;
  color: #2a2a2a;
  font-family: sans-serif;
  line-height: 1.6;
  margin: 0;
}


/* ==================================================
   見出し設定
   h1, h2, h3タグの文字色やスタイルを設定して統一感を出す
================================================== */
h1, h2, h3 {
  color: #2a2a2a;
}

a {
  color: #88cc88;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.btn {
  background: #288f2c;
  color: #fff;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

section,
.panel-section,
.extra-links,

/* ==================================================
   お知らせセクション
   ページ上部の案内や告知部分の背景や下線を設定する
================================================== */
.info-section {
  background-color: #eeeeee;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* -----------------------------------------------
   お知らせの表示スタイル
-------------------------------------------------- */

/* info-section 全体の装飾：背景画像 + 下境界線 */

/* ==================================================
   お知らせセクション
   ページ上部の案内や告知部分の背景や下線を設定する
================================================== */
.info-section {
  position: relative;
  overflow-x: hidden;

/*一時的に無効  background: url('../ameba_img/gray_gradation.png') repeat-x; */
  background-size: auto 100%; /* 高さ100%で横繰り返し */
  padding: 0.2rem 1rem;
  margin-bottom: 2rem;
  border-bottom: 4px solid #e5355b; /* ヘッダーと同じ赤ライン */
}

/* info 内のリンクを左揃え */

/* ==================================================
   お知らせ内のレイアウト
   お知らせ内のテキストやリンクの配置・装飾を整える
================================================== */
.info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;     /* ← 横方向を左揃えに変更 */
  text-align: left;            /* ← テキストも左揃え */
  gap: 0.2rem;
  margin-left: 10%;            /* ← セクション内で左から10%の位置に開始 */
  color: #2e2e2e;                 /* ← 薄めのグレー（任意） */
  font-weight: 500;            /* ← 少し軽めのフォントウェイト（オプション） */
}

/* info 内のリンク */

/* ==================================================
   お知らせ内のレイアウト
   お知らせ内のテキストやリンクの配置・装飾を整える
================================================== */
.info p {
  position: relative;
  padding-left: 1.2em;         /* 四角と文字の間の余白 */
  text-decoration: none;
  color: inherit;
  display: inline-block;
}


/* ==================================================
   お知らせ内のレイアウト
   お知らせ内のテキストやリンクの配置・装飾を整える
================================================== */
.info p::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4em;                  /* 垂直位置の調整 */
  width: 0.6em;
  height: 0.6em;
  background-color: #ff5c8f;   /* とれわるカラーのピンク */
  border-radius: 2px;          /* 四角の角を少し丸める場合 */
}


/* ==================================================
   お知らせ内のレイアウト
   お知らせ内のテキストやリンクの配置・装飾を整える
================================================== */
.info p:hover {
  text-decoration: underline;
}

/* 左下にロゴを重ねる */

/* ==================================================
   お知らせ内のレイアウト
   お知らせ内のテキストやリンクの配置・装飾を整える
================================================== */
.info-logo {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 70%;
  pointer-events: none;
  object-fit: contain;
}

.red-text {
  color: #330000 !important;
  font-weight: bold;
}


/* -----------------------------------------------
   リンク文字を浮き上がらせるコード
-------------------------------------------------- */


/* ==================================================
   カードデザイン
   個々のカードの背景・角丸・影などを設定して見やすくする
================================================== */
.main-sentence a {
  display: inline-block;
  transition: transform 0.2s ease;
}


/* ==================================================
   カードデザイン
   個々のカードの背景・角丸・影などを設定して見やすくする
================================================== */
.main-sentence a:hover {
  transform: translateY(-3px);
}

/* -----------------------------------------------
   補助ブロック（イベント・スタッフ紹介など）の構造
-------------------------------------------------- */

/* ==================================================
   補助ブロック全体
   イベント・スタッフ紹介などのブロック全体のレイアウトを設定
================================================== */
.extra-grid {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  max-width: 1600px;
  margin: auto;
  padding: 2rem;
}

/* 各補助ブロックの全体枠 */

/* ==================================================
   各補助ブロック
   各ブロック間の間隔や重なり、下余白を調整する
================================================== */
.extra-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* --- 補助ブロック間の重なり対策（改良版） --- */

/* ==================================================
   各補助ブロック
   各ブロック間の間隔や重なり、下余白を調整する
================================================== */
.extra-block {
  margin-bottom: 3rem;
  position: relative;
  z-index: 1;
  min-height: calc(100% + 40px); /* ← アニメーションによる押し出し空間を確保 */
}



/* ==================================================
   各補助ブロック
   各ブロック間の間隔や重なり、下余白を調整する
================================================== */
.extra-block:last-child {
  margin-bottom: 5rem;   /* フッターとの距離を少し多めに */
}


/* ==================================================
   各補助ブロック
   各ブロック間の間隔や重なり、下余白を調整する
================================================== */
.extra-block:not(:last-child)::after {
  content: "";
  display: block;
  height: 40px; /* fade-inで下にずれる分 */
}



/* ==================================================
   スマホ表示調整
   768px以下でのスマホ向けレイアウト調整
================================================== */
@media (max-width: 768px) {

/* ==================================================
   各補助ブロック
   各ブロック間の間隔や重なり、下余白を調整する
================================================== */
  .extra-block {
    margin-bottom: 4rem;
  }
}

/* タイトルとその下に赤いライン */
.extra-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  position: relative;
}
.extra-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: #ff5c8f;
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

/* 補助ブロックのリンクと画像を横並び 

/* ==================================================
   カードレイアウト
   補助ブロック内のカードを2列グリッドで並べる設定
================================================== */
.extra-row {
  display: grid;
  grid-template-columns: auto auto;
  gap: 1rem;
  justify-content: center;
  padding-bottom: 3rem;      /* ← 下方向の逃げスペースを物理的に確保 */
}*/


/* ==================================================
   カードレイアウト
   補助ブロック内のカードを2列グリッドで並べる設定
================================================== */
.extra-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 3rem;
  justify-content: space-evenly; /* 横方向に等間隔配置 */
  padding-bottom: 3rem;
  max-width: 1200px; /* 全体の横幅上限を設定（必要に応じて調整） */
  margin: 0 auto;
}





/* 各カード（main-sentence）の余白補正 */

/* ==================================================
   カードレイアウト
   補助ブロック内のカードを2列グリッドで並べる設定
================================================== */
.extra-row .main-sentence {
  margin-bottom: 2rem;       /* 下のカードとの間隔を確実に確保 */
  width: 100%;
  flex: 1 1 auto; /* グリッドセルの幅いっぱいに伸ばす */
  box-sizing: border-box;
}




/* リンクが含まれるブロックの装飾 */

/* ==================================================
   カードデザイン
   個々のカードの背景・角丸・影などを設定して見やすくする
================================================== */
.main-sentence {
  /*background: transparent !important; */

  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  text-align:  center;        /* 中央寄せ */
}

/* 各カードに背景と角丸・影（上品に） */

/* ==================================================
   カードデザイン
   個々のカードの背景・角丸・影などを設定して見やすくする
================================================== */
.main-sentence {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 1.5rem;
  overflow: hidden;
  position: relative;
  z-index: 0;                /* transformの重なり順をリセット */
  transform: translateZ(0);  /* ← transformの新しいコンテキストをリセット */
  margin-bottom: 40px; /* transformで下にズレる分の見かけ高さを確保 */
}



/* リスト内の点を非表示にし、整列 */

/* ==================================================
   カードデザイン
   個々のカードの背景・角丸・影などを設定して見やすくする
================================================== */
.main-sentence ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  width: 100%;
}

/* 各リンクアイテムの間隔 */

/* ==================================================
   カードデザイン
   個々のカードの背景・角丸・影などを設定して見やすくする
================================================== */
.main-sentence li {
  margin: 1rem 0;
}

/* 台形ボタン風のリンク装飾 */

/* ==================================================
   カードデザイン
   個々のカードの背景・角丸・影などを設定して見やすくする
================================================== */
.main-sentence a {
  display: block;
  width: 100%;
  height: 50px;
  background: url('../ameba_img/button_gray.png') no-repeat center center;
  background-size: 100% 100%;
  text-align: center;
  line-height: 50px;
  color: white;
  font-weight: bold;
  text-decoration: none;
  margin: 0 auto;
  transition: filter 0.3s ease;
}

/* ==================================================
   カードデザイン
   個々のカードの背景・角丸・影などを設定して見やすくする
================================================== */
.main-sentence a:hover {
  filter: brightness(80%);
}

/* スタッフリンク用のボタンを左右反転表示（文字は再反転） */
.staff-link-block a {
  transform: scaleX(-1);
  transition: transform 0.2s ease;
}
.staff-link-block a:hover {
  transform: scaleX(-1) translateY(-3px);
}

.staff-link-block a span {
  display: inline-block;
  transform: scaleX(-1);
}

/* === 推奨車両ボタン（競合を避けるための記述） === */

/* ==================================================
   カードデザイン
   個々のカードの背景・角丸・影などを設定して見やすくする
================================================== */
.main-sentence .btn {
  width: auto;              /* 台形ボタンの100%幅を解除 */
  height: auto;             /* 固定高さ解除 */
  background: linear-gradient(to right, #fff, #e0e0e0);
  background-size: auto;
  color: #000;
  line-height: normal;
  margin: 1rem auto 0;      /* 自然に中央寄せ */
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  display: inline-block;
  text-align: center;
}


/* ==================================================
   カードデザイン
   個々のカードの背景・角丸・影などを設定して見やすくする
================================================== */
.main-sentence .btn:hover {
  background: #ccc;
  transform: translateY(-2px);
}


/* -----------------------------------------------
   アニメーション：ふわっと表示する各要素
-------------------------------------------------- */


/* ==================================================
   アニメーション設定
   左からフェードインで表示するアニメーション効果
================================================== */
.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 1s ease, transform 1s ease;}


/* ==================================================
   アニメーション設定
   右からフェードインで表示するアニメーション効果
================================================== */
.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 1s ease, transform 1s ease;}


/* ==================================================
   アニメーション設定
   下からフェードインで表示するアニメーション効果
================================================== */
.fade-in-bottom {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease, transform 1s ease;
}

.half {
  width: 50%;
  margin:  0 auto;            /* 中央寄せ */
}

/* ==================================================
   フェードインを遅らせる設定
================================================== */

.fade-delay1 {
  transition-delay: 1s;
}

.fade-delay2 {
  transition-delay: 2s;
}

.fade-delay3 {
  transition-delay: 3s;
}


/* ==================================================
   アニメーションの表示状態
   フェードインが完了した状態を示す設定
================================================== */
.visible {
  opacity: 1 !important;
  transform: translate(0, 0) !important;
}

/* fade-img クラス内の画像装飾 */
.fade-img img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- fade-inアニメによるカード重なりの最終調整 --- */
.fade-in-bottom,
.fade-in-left,

/* ==================================================
   アニメーション設定
   右からフェードインで表示するアニメーション効果
================================================== */
.fade-in-right {
  will-change: transform; /* GPUに描画を預けることでズレ抑制 */
}


/* ==================================================
   カードレイアウト
   補助ブロック内のカードを2列グリッドで並べる設定
================================================== */
.extra-row {
  row-gap: 4rem !important; /* グリッドの縦方向gapを明示的に拡張 */
}


/* ==================================================
   カードデザイン
   個々のカードの背景・角丸・影などを設定して見やすくする
================================================== */
.main-sentence.visible {
  transform: none !important; /* 表示後の位置を確定し、重なりを防ぐ */
}


/* -----------------------------------------------
   ヘッダーの色とスライドショーの設定
-------------------------------------------------- */


/* ヘッダーの色は緑 */
.header-border {
  background-color: #e5355b;　/* 赤 */

}

/* メインビジュアル（スライドショー） */

/* ==================================================
   スライドショー画像設定
   ページ上部のスライドショー画像のサイズ・位置を制御する
================================================== */
.heroa {
  width: 100%;
  height: 25vh;
  background-size: cover;
  background-position: center bottom; /* ← bottom から center bottom に変更 */
  transition: background-image 1s ease-in-out;
  position: relative;
  z-index: 1;
}



/* ==================================================
   スマホ表示調整
   768px以下でのスマホ向けレイアウト調整
================================================== */
@media (max-width: 768px) {

/* ==================================================
   スライドショー画像設定
   ページ上部のスライドショー画像のサイズ・位置を制御する
================================================== */
.heroa {  width: 100%;
  height: 15vh;  background-size: cover;
  background-position: right bottom;
  transition: background-image 1s ease-in-out;
  position: relative;
  z-index: 1;
}
}


/* スライドショーの上に開催情報を表示 */

/* ==================================================
   スライドショーテキスト
   スライド画像の上に重ねて表示されるテキストの位置調整
================================================== */
.overlay-kaisai {
  position: absolute;
  top: 45%;            /* 表示位置の調整（上から） */
  left: 50%;         /* 表示位置の調整（右から） */
  transform: translate(-50%);  /* 自分の大きさの半分だけ引いて中央化 */
  z-index: 10;         /* 背景より前に出す */
  height: 100%;        /* 必要に応じて画像サイズ調整 */
  pointer-events: none; /* クリックを透過させたい場合はこれ */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90vw; /* モバイル端末でも画面外にはみ出さない */
}


/* ==================================================
   スマホ表示調整
   768px以下でのスマホ向けレイアウト調整
================================================== */
@media (max-width: 768px) {

/* ==================================================
   スライドショーテキスト
   スライド画像の上に重ねて表示されるテキストの位置調整
================================================== */
  .overlay-kaisai {
    left: 50%;                             /* 中央基準に */
    transform: translateX(-50%);          /* 自身の幅の半分左に寄せて真正面 */
  }
}



/* -----------------------------------------------
   スマホ表示における補助ブロックのレイアウト調整
-------------------------------------------------- */


/* スマホ表示時の補助ブロックレイアウト調整 */

/* ==================================================
   スマホ表示調整
   768px以下でのスマホ向けレイアウト調整
================================================== */
@media (max-width: 768px) {

/* ==================================================
   カードレイアウト
   補助ブロック内のカードを2列グリッドで並べる設定
================================================== */
  .extra-row {
    grid-template-columns: 1fr !important;
  }


}

/* -----------------------------------------------
   補助ブロックの背景設定
-------------------------------------------------- */

/* === 「とれいんわーるどとは」内の背景設定 === */

/* ==================================================
   カードデザイン
   個々のカードの背景・角丸・影などを設定して見やすくする
================================================== */
.main-sentence {
  background-size: cover;
  background-position: center;
  border-radius: 16px;       /* ← 角丸 */
  overflow: hidden;          /* ← 内容が角からはみ出ないように */
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  color: #222;               /* 背景とのコントラスト確保 */
}

/* 補助ブロックの背景を自動的に変える */

/* ==================================================
   カードデザイン
   基本背景
================================================== */
.main-sentence:nth-of-type(4n + 1) {
 background-image: url('../ameba_img/world/tw_haikei01.png');
 }

.main-sentence:nth-of-type(4n + 2) {
 background-image: url('../ameba_img/world/tw_haikei02.png');
 }

.main-sentence:nth-of-type(4n + 3) {
 background-image: url('../ameba_img/world/tw_haikei03.png');
 }

.main-sentence:nth-of-type(4n + 4) {
 background-image: url('../ameba_img/world/tw_haikei04.png');
 }

/* ==================================================
   カードデザイン
   個別背景指定（bg1Xを付加することで基本設定より優先)
================================================== */

.extra-row .main-sentence.bg11 {
  background-image: url('../ameba_img/world/tw_haikei11.png') !important;
}

.extra-row .main-sentence.bg12 {
  background-image: url('../ameba_img/world/tw_haikei12.png') !important;
}

.extra-row .main-sentence.bg13 {
  background-image: url('../ameba_img/world/tw_haikei13.png') !important;
}

.extra-row .main-sentence.bg14 {
  background-image: url('../ameba_img/world/tw_haikei14.png') !important;
}

/* ==================================================
 --- ギャラリー：メイン＋サブ構成 --- 
================================================== */

/* --- ギャラリー：メイン＋サブ構成（完全フル幅・余白ゼロ・左端ズレ防止） --- */

/* コンテナ制約を無視して全幅展開 */
.gallery-feature,
.gallery-sub {
  position: relative;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  margin: 0;              /* ← 余白完全削除 */
  padding: 0;
  line-height: 0;         /* ← 画像下の隙間防止 */
  overflow: hidden;
  border: none;
}

/* メイン画像 */
.gallery-feature img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  object-fit: cover;
  box-shadow: none;
  vertical-align: bottom;
}

/* サブ画像：高さ揃え、間の隙間もゼロ */
.gallery-sub {
  display: grid;
  grid-template-columns: 1fr 2fr;  /* ← 左1/3・右2/3 */
  gap: 0;                          /* ← 間隔ゼロ */
}

.gallery-sub img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  vertical-align: bottom;
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* ホバー演出（控えめ） */
.gallery-sub img:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

/* ギャラリー全体から開催実績へ移動 */
.history-gallery-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.history-gallery-link:hover .gallery-feature img,
.history-gallery-link:hover .gallery-sub img {
  filter: brightness(1.06);
}

/* .gallery-feature の直後に .gallery-sub がある .extra-block では gap を無効化 */
.extra-block:has(.gallery-feature + .gallery-sub) {
  gap: 0 !important;
}

/* タイトルとの間だけは適度に空ける（必要なら調整） */
.extra-block:has(.gallery-feature + .gallery-sub) .extra-title {
  margin-bottom: 1.25rem;
}


/* スマホ：縦並び */
@media (max-width: 768px) {
  .gallery-sub {
    grid-template-columns: 1fr;
  }
}
