/*
 Theme Name:   krc60th Child Theme
 Template:     astra
 Version:      1.0.0
*/

/* ===================================================
   1. パソコン用の標準設定（画面幅が 1025px 以上のとき）
   =================================================== */
.catchcopy-container {
  line-height: 1.6;
}

/* 最初は生テキストを隠す（重なり順の修正版） */
.catchcopy-container h1.animate-text,
.catchcopy-container h2.animate-text {
  margin: 0;
  opacity: 0; 
  position: relative; /* 重なり順を指定可能にする */
  z-index: 10;        /* 数値が大きいほど手前に表示（下のコンテナより上に浮かせます） */
}

/* --- h1（白文字）のサイズ設定 --- */
.catchcopy-container h1.animate-text {
  font-family: 'Josefin Sans', 'Helvetica Neue', Arial, sans-serif;
  font-weight: bold;
  font-size: 7rem;
  padding: 10px 50px;
}

/* テキストの塊（h1）に対する影の調整 */
.catchcopy-container h1.animate-text {
  text-shadow: 
    0px 2px 4px rgba(74, 70, 64, 0.2),
    0px 6px 14px rgba(74, 70, 64, 0.2),
    0px 15px 30px rgba(74, 70, 64, 0.15) !important;
}

/* --- h2（黒文字）のサイズ設定 --- */
.catchcopy-container h2.animate-text {
  font-family: 'Josefin Sans', 'Helvetica Neue', Arial, sans-serif;
  font-weight: bold;
  font-size: 5rem;
  margin-top: 20px;
  padding: 30px 0 10px 0;
}

/* ===================================================
   2. タブレット用の設定（画面幅が 1024px 以下のとき）
   =================================================== */
@media screen and (max-width: 1024px) {
  .catchcopy-container {
    padding: 0;
  }
  .catchcopy-container h1.animate-text {
    font-size: 3.5rem;
  }
  .catchcopy-container h2.animate-text {
    font-size: 3.5rem;
  }
}

/* ===================================================
   3. スマホ用の設定（画面幅が 599px 以下のとき）
   =================================================== */
@media screen and (max-width: 599px) {
  .catchcopy-container {
    padding: 10px;
    line-height: 1.3;
  }
  .catchcopy-container h1.animate-text {
    font-size: 2.1rem;
    padding: 10px 10px;
  }
  .catchcopy-container h2.animate-text {
    font-size: 2.6rem;
    margin-top: 15px;
    padding: 10px 0 0;
  }
}

/* ===================================================
   4. アニメーション共通設定
   =================================================== */
.catchcopy-container .animate-text {
  opacity: 0 !important; 
}

.catchcopy-container .animate-text.is-animated {
  opacity: 1 !important; 
}

.catchcopy-container .animate-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px);
  will-change: transform, opacity;
}

.catchcopy-container .animate-text.is-animated span {
  animation: fudeUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.catchcopy-container h1.animate-text span {
  color: #FFF !important; 
}

.catchcopy-container h2.animate-text span {
  color: #000 !important; 
}

.catchcopy-container .animate-text span.space {
  width: 0.25em;
}

@keyframes fudeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =======================================================
   1. 大元の親コンテナ（波型シェイプ付き）の設定
   ======================================================= */

/* 記念ページ（page-id-7）全体のAstraコンテナの制限を解除 */
.page-id-7 #content .ast-container {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ロゴやキャッチコピーが入っている大元の親コンテナ */
.elementor-element-bb98585 {
  max-width: 100% !important;
  width: 100% !important;
  /* 波型シェイプの裏側の透明な壁が、ギャラリーをカットするのを強制的に防ぐ */
  overflow: visible !important; 
}


/* =======================================================
   2. 【最重要】ギャラリーの入った子コンテナだけを画面幅いっぱいに広げる
   ======================================================= */
.elementor-element-c6cf340 {
  /* 親コンテナの横幅を無視して、ブラウザの画面幅（vw）を基準に100%に強制拡張 */
  width: 100vw !important;
  max-width: 100vw !important;
  
  /* 画面のド真ん中を基準にして左右の隙間を物理的にゼロにする数式 */
  position: relative !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  
  /* 1段目の上がカットされるのを防ぐため、このコンテナの透明な壁を無くす */
  overflow: visible !important;
}


/* =======================================================
   3. ギャラリー（無限ループ）のベース設定（今朝の状態を再現）
   ======================================================= */

/* 最外枠のラッパー：傾きではみ出た部分「だけ」をここでカット */
.gallery-marquee-wrapper {
  overflow: hidden !important;
  box-sizing: border-box;
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  
  /* 上下の余白：波型シェイプと衝突しないよう、マージンではなく安全なパディングで高さを確保 */
  padding-top: 280px !important; 
  padding-bottom: 240px !important;
  margin-top: -200px !important;   
  margin-bottom: -120px !important;
  background-color: transparent !important;

  /* 傾き処理 */
  transform: rotate(-10deg) !important;
  transform-origin: center center !important;
}

/* 3段を包むコンテナ */
.gallery-marquee-container {
  width: 100% !important;
  overflow: visible !important;
}

/* 各段（トラック）の共通スタイル：画像を一直線に並べる */
.marquee-track {
  display: flex !important;
  overflow: visible !important; 
  width: max-content !important; 
  /* 各段の上下の隙間を自然に確保（今朝の表示の再現） */
  margin-bottom: 25px !important;
}

.marquee-track:last-child {
  margin-bottom: 0 !important;
}

/* 写真を横一列に並べる塊 */
.marquee-group {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 20px !important;
  width: max-content !important; 
  padding-right: 20px !important;
}

/* 写真を囲む枠のサイズを固定 */
.img-clipper {
  width: 320px !important;
  max-width: 320px !important;
  height: 180px !important;
  max-height: 180px !important;
  flex: 0 0 320px !important; 
  display: block !important;
  overflow: hidden !important; 
  border-radius: 12px !important;
  
  /* 写真の水平カット（クリッピングバグ）を完全に防ぐ3D空間固定 */
  transform: translateZ(0) !important;
  will-change: transform;
}

/* 画像自体のサイズ比率維持 */
.img-clipper img {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  image-rendering: -webkit-optimize-contrast; 
  transform: translate3d(0, 0, 0) rotate(0deg) scale(1) !important; 
}

/* アニメーションの指定 */
.track-left .marquee-group {
  animation: scroll-left-final 35s linear infinite !important;
}

.track-right .marquee-group {
  animation: scroll-right-final 35s linear infinite !important;
}

@keyframes scroll-left-final {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

@keyframes scroll-right-final {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}


/* ==========================================
   📱 スマホ・タブレット用のレスポンシブ設定
   ========================================== */
@media screen and (max-width: 767px) {
  
  .gallery-marquee-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    padding-top: 240px !important; 
    padding-bottom: 200px !important;
    margin-top: -160px !important;   
    margin-bottom: -100px !important;
  }
  
  .marquee-track {
    margin-bottom: 12px !important;
  }
  
  .marquee-group {
    gap: 12px !important;
    padding-right: 12px !important; 
  }

   /* 【ここを修正】スマホの時だけ、メモリを食い潰す3D命令を安全に引き算します */
  .img-clipper {
    width: 200px !important;       
    max-width: 200px !important;
    height: 113px !important;      
    max-height: 113px !important;
    flex: 0 0 200px !important;    
    border-radius: 8px !important; 
    
    /* 1. スマホでの事前メモリ確保（will-change）を解除して脳を休ませる */
    will-change: auto !important;
    /* 2. 重いtranslateZではなく、スマホが最も得意な2Dの平らな命令に上書き */
    transform: none !important;
  }

  /* 3. 【追記】画像自体の3D命令も、スマホの時だけは解除して蓄積疲労をゼロにする */
  .img-clipper img {
    transform: none !important;
    will-change: auto !important;
  }

  /* スマホの流れる速度調整 */
  .track-left .marquee-group {
    animation-duration: 20s !important; 
  }
  .track-right .marquee-group {
    animation-duration: 30s !important; 
  }
}


/* =======================================================
   4. スマホでの右側50pxはみ出し（横揺れ）を絶対に防ぐ防護壁
   ======================================================= */
html, body {
  overflow-x: hidden !important;
}

@media (max-width: 921px) {
  html, body {
    overflow-x: hidden !important;
    position: relative;
    width: 100% !important;
  }
}