/* ラッパとなるコンテナ */
.hero-slider-wrapper {
  position: relative; /* 子要素の絶対配置の基準にする */
  width: 100%;
  height: 130vh;      /* 既存と同じ高さにする */
  overflow: hidden;   /* はみ出し防止 */
}

/* スライダー部分（高さを100%に広げる） */
.hero-slider {
  width: 100%;
  height: 100%;
  position: relative; /* スライドをabsolute配置する場合の基準にもなる */
}

/* 個々のスライド */
.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* アクティブなスライド */
.hero-slide.active {
  opacity: 1;
}

/* スライド内の画像 */
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 波形PNGの配置 */
.hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  z-index: 2; /* スライド画像より手前に表示する */
  pointer-events: none; /* クリックイベントなどを通したい場合 */
}

/* 各スライドは全体を被せ、フェード用に opacity を調整 */
.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* アクティブなスライド */
.hero-slide.active {
  opacity: 1;
}

/* 画像はコンテナサイズにフィット */
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}



.hero-text-container {
  /* 全体のサイズと中央寄せ */
  width: 100%;
  max-width: 1270px;
  min-height: 397px; /* 背景画像の高さに合わせる */
  margin: 0 auto;
  
  /* 背景画像の設定 */
  background: url("../../img/fv-bg.png") no-repeat center center;
  background-size: contain; /* 画像全体を縮小/拡大して表示し、はみ出し防止 */

  /* レイアウト */
  display: flex;
  flex-direction: column;
  align-items: center; 
  justify-content: center; /* テキストを上下中央に配置（必要に応じて変更） */

  box-sizing: border-box; 
  padding: 20px; /* 内側に余白を付ける */
}

.hero-message-large,
.hero-message-small {
  margin: 8px 0;
  text-align: center; 
  color: #0a0a0a;
  line-height: 1.4;
}

.hero-message-large p {
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 2px;
}

/* 小さいメッセージのフォント */
.hero-message-small p {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 1.5px;
}

/* めぐみの思いセクション */
.omoi {
    max-width: 1200px;
    background: #F3F0E7;
    padding: 80px 80px;
    margin-top: 160px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* コンテナ */
.omoi-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ヘッダー（画像＋タイトルの順に変更） */
.omoi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

/* 画像（左配置・サイズを統一） */
.omoi-img {
    text-align: left;
    width: 100%;
    height: 664px;
    overflow: hidden;
}

.omoi-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: polygon(0% 2%, 98% 0%, 97% 98%, 0% 98%); 
    transition: transform 0.3s ease;
}

.omoi-container:hover .omoi-img img {
    transform: scale(1.02);
}

/* タイトル（縦書き・右配置） */
.omoi-title {
    font-size: 72px;
    color: #0a0a0a;
    margin: 0;
    writing-mode: vertical-rl; /* **縦書き** */
    text-orientation: upright; /* **縦書きの文字を正しく表示** */
    text-align: right;
}

/* テキスト＋ボタン（下段） */
.omoi-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    margin-top: 40px;
}

/* テキスト（左下） */
.omoi-text p{
    font-size: 18px;
    line-height: 1.8;
    color: #0a0a0a;
    text-align: left;
}

/* ボタン（右下） */
.omoi-button {
    text-align: right;
}

.btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 12px 24px;
font-size: 18px;
font-weight: 500;
color: #0a0a0a;
text-decoration: none;
background-color: transparent;
border: none; /* 外枠を削除 */
border-radius: 5px;
transition: all 0.3s ease;
position: relative;
white-space: nowrap;
}

/* ホバー時のスタイル */
.btn:hover {
color: white;
background-color: #0a0a0a;
}

/* 矢印 */
.btn::after {
content: "＞"; /* 矢印を1つだけ表示 */
margin-left: 10px;
font-size: 18px;
transition: transform 0.3s ease;
}

/* ホバー時の矢印スライド */
.btn:hover::after {
transform: translateX(5px);
}

.carousel-wrapper {
    overflow: hidden;
    width: 100%;
    padding: 60px 0;
    position: relative;
    display: flex;
    justify-content: center;
    margin-top: 100px;
}

.carousel-container {
    display: flex;
    align-items: center;
    gap: 160px;
    white-space: nowrap;
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 400px;
    max-width: 400px;
}

.carousel-slide img {
    width: auto;
    height: auto;
    max-height: 400px;
    max-width: 400px;
    object-fit: cover;
    clip-path: polygon(2% 0%, 99% 0%, 99% 98%, 0% 98%);
    visibility: visible !important; /* **ブラウザの最適化を回避** */
    transform: translateX(0); /* **初回レンダリングを強制** */
}

/* 園のことセクション */
.en {
    max-width: 1200px;
    background: #F3F0E7;
    padding: 80px 80px;
    margin-top: 160px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* タイトル＋コンテンツ */
.en-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
}

/* 上部エリア（タイトル + 画像） */
.en-top {
    display: flex;
    justify-content: space-between; /* タイトルと画像を左右に配置 */
    align-items: flex-start; /* 上揃え */
    width: 100%;
}

/* タイトル（左寄せ） */
.en-title {
    font-size: 72px;
    color: #0a0a0a;
    writing-mode: vertical-rl;
    text-orientation: upright;
    margin: 0;
    padding-left: 20px; /* 左に余白 */
}

/* 画像（右側に配置・縦幅固定） */
.en-img {
    flex: 1;
    max-width: 1000px; /* 画像の最大幅 */
    width: 100%;
    height: 600px;
    text-align: right;
    overflow: hidden;
}

.en-img img {
    width: 100%; /* **横幅はコンテンツに合わせて調整** */
    height: 600px; /* **縦幅を固定** */
    max-height: 600px;
    clip-path: polygon(0% 2%, 98% 0%, 97% 98%, 0% 98%);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.en-container:hover .en-img img {
    transform: scale(1.02);
}

/* 下部エリア（テキスト + ボタン） */
.en-bottom {
    display: flex;
    justify-content: space-between; /* テキストとボタンを左右に配置 */
    align-items: flex-end; /* **下端を揃える** */
    width: 100%;
    margin-top: 40px; /* 上との間隔 */
}

/* テキスト（左側に配置） */
.en-text p{
    font-size: 18px;
    line-height: 1.8;
    color: #0a0a0a;
    text-align: left;
}

/* ボタン（右側に配置・下端揃え） */
.en-button {
    text-align: right;
    padding-right: 20px; /* 右に余白 */
}

/* ボタンのデフォルトスタイル */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: 500;
    color: #0a0a0a;
    text-decoration: none;
    background-color: transparent;
    border: 2px solid #0a0a0a; /* **ボーダーを追加** */
    border-radius: 5px;
    transition: all 0.3s ease; /* **スムーズなアニメーション** */
    position: relative;
    white-space: nowrap;
}

/* ホバー時のスタイル */
.btn:hover {
    color: white;
    background-color: #0a0a0a;
}

/* 矢印 */
.btn::after {
    content: "＞"; /* **矢印を1つだけ表示** */
    margin-left: 10px;
    font-size: 18px;
    transition: transform 0.3s ease;
}

/* ホバー時の矢印スライド */
.btn:hover::after {
    transform: translateX(5px);
}

/* 保育のことセクション */
.hoiku {
    max-width: 1200px;
    background: #F3F0E7;
    padding: 80px 80px;
    margin-top: 160px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* コンテナ */
.hoiku-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* ヘッダー（タイトル＋ボタンを横並び） */
.hoiku-header {
    display: flex;
    justify-content: space-between; /* タイトルとボタンを左右に配置 */
    align-items: center;
    width: 100%;
    max-width: 760px; /* **画像の幅に揃える** */
}

/* タイトル（左寄せ） */
.hoiku-title {
    font-size: 56px;
    color: #0a0a0a;
    margin: 0;
}

/* ボタン（右寄せ） */
.hoiku-button {
    text-align: right;
    align-items: center;
}

/* ボタンのデフォルトスタイル */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: 500;
    color: #0a0a0a;
    text-decoration: none;
    background-color: transparent;
    border: 2px solid #0a0a0a;
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

/* ホバー時のスタイル */
.btn:hover {
    color: white;
    background-color: #0a0a0a;
}

/* 矢印 */
.btn::after {
    content: "＞"; /* 矢印を1つだけ表示 */
    margin-left: 10px;
    font-size: 18px;
    transition: transform 0.3s ease;
}

/* ホバー時の矢印スライド */
.btn:hover::after {
    transform: translateX(5px);
}

/* 画像（タイトルとボタンの幅いっぱいに広げる） */
.hoiku-img {
    width: 100%;
    max-width: 760px; /* **タイトル＋ボタンと同じ幅に揃える** */
    text-align: center;
    margin-top: 20px; /* タイトルとの間隔 */
    overflow: hidden;
}

.hoiku-img img {
    width: 100%;
    height: 664px; /* **高さは固定** */
    object-fit: cover;
    clip-path: polygon(2% 0%, 100% 1%, 100% 99%, 0% 98%); /* **四隅が欠けた不定形な四角形** */
    transition: transform 0.3s ease;
}

.hoiku-container:hover .hoiku-img img {
    transform: scale(1.02);
}

/* 学童のことセクション（保育のことと統一） */
.gakudo {
    max-width: 1200px;
    background: #F3F0E7;
    padding: 80px 80px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* コンテナ */
.gakudo-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* ヘッダー（タイトル＋ボタン） */
.gakudo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 760px;
}

/* タイトル（左寄せ） */
.gakudo-title {
    font-size: 56px;
    color: #0a0a0a;
    margin: 0;
}

/* ボタン（右寄せ） */
.gakudo-button {
    text-align: right;
    align-items: center;
}

/* 画像（タイトル＋ボタンの幅に合わせる） */
.gakudo-img {
    width: 100%;
    max-width: 760px;
    text-align: center;
    margin-top: 20px;
    overflow: hidden;
}

.gakudo-img img {
    width: 100%;
    height: 664px;
    object-fit: cover;
    clip-path: polygon(2% 0%, 100% 1%, 100% 99%, 0% 98%);
    transition: transform 0.3s ease;
}

.gakudo-container:hover .gakudo-img img {
    transform: scale(1.02);
}


@media (max-width: 1024px) {

    .hero-text-container {
        /* 背景画像切り替え */
        max-width: 317px;      /* 画像に合わせる */
        min-height: 394px;     /* 縦サイズに合わせる */
        background: url("../../img/sp-fv-bg.png") no-repeat center center;
        background-size: contain; 
        margin: 0 auto;
    
        /* テキストを左右に並べるため、flex方向をrowに */
        flex-direction: row;
        /* 中身を中央寄せ */
        justify-content: center;
        align-items: center; /* 縦の位置を下揃えにするなら center→flex-endなど微調整 */
        padding: 16px;
      }
    
      /* 大・小メッセージを左右に並べる & 縦書き */
      .hero-message-large,
      .hero-message-small {
        margin: 0 8px; /* 左右にちょっと余白 */
        text-align: center;
        writing-mode: vertical-rl;  /* 縦書き */
        text-orientation: upright;  /* 文字を縦向きに */
        display: flex;             /* 縦方向に段落を積む */
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        
        margin: 0 8px; /* 左右の余白 */

      }
    
      /* 大きいメッセージを右に、小さいメッセージを左に */
      .hero-message-large {
        order: 2; /* 右側 */
      }
      .hero-message-small {
        order: 1; /* 左側 */
        display: none;
      }
    
      .hero-message-large p {
        font-size: 20px;
        letter-spacing: 1.5px;
      }
      .hero-message-small p {
        font-size: 20px;
        letter-spacing: 1.5px;
      }

    .omoi{
        padding: 0;
        margin-top: 80px;
        margin-left: 0;
    }


    /* 思いセクションのレイアウト調整 */
    .omoi-header {
        display: flex;
        flex-direction: column;
        align-items: left; /* 画像を中央配置 */
        text-align: left; /* テキストを左揃え */
        gap: 20px;
    }

    .omoi-title{
        padding-left: 40px;
    }

    .omoi-img {
        width: 100%; /* 画面幅いっぱいに広げる */
        max-width: none; /* 最大幅の制限を解除 */
        height: auto;
        aspect-ratio: unset; /* 比率制限を解除 */
    }

    .omoi-img img {
        width: 90%; /* 画像自体も親要素いっぱいに広げる */
        height: auto; /* 高さを自動調整 */
        object-fit: cover; /* 画像を適切にトリミング */
    }

    /* タイトル */
    .omoi-title {
        font-size: 36px;
        writing-mode: horizontal-tb; /* スマホ時は横書きに変更 */
        text-align: left;
    }

    /* テキスト＋ボタンの配置 */
    .omoi-content {
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* 左揃え */
        text-align: left;
        margin-top: 20px;
        padding: 0 40px;
        gap: 20px;
    }

    /* テキスト */
    .omoi-text {
        font-size: 20px;
        line-height: 2;
        color: #0a0a0a;
    }

    /* ボタン */
    .omoi-button {
        text-align: left;
    }

    .carousel-wrapper {
        margin-top: 80px;
    }

    .carousel-slide {
        max-width: 300px;
        max-height: 300px;
    }
    .carousel-slide img {
        max-width: 300px;
        max-height: 300px;
    }

    .en{
        margin-top: 80px;
        margin-left: 0;
        padding: 0;
    }

    /* 園のことセクションのレイアウト調整 */
    .en-top {
        display: flex;
        flex-direction: column-reverse; /* 画像を上・タイトルを下に配置 */
        align-items: left;
        text-align: left;
    }

    .en-img {
        width: 100%; /* 画像を画面幅いっぱいに広げる */
        max-width: none;
        height: auto;
        margin-bottom: 20px; /* タイトルとの間隔 */
    }

    .en-img img {
        width: 90%;
        height: auto;
        object-fit: cover;
        display: flex;
    }

    /* タイトル（画像の下に配置し、左揃え） */
    .en-title {
        font-size: 36px;
        writing-mode: horizontal-tb; /* 横書きに変更 */
        text-align: left;
        margin-bottom: 16px;
        padding-left: 40px;

    }

    /* テキスト＋ボタンの配置 */
    .en-bottom {
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* 左揃え */
        text-align: left;
        margin-top: 0;
        gap: 20px;
        padding: 0 40px;
    }

    /* テキスト */
    .en-text {
        font-size: 20px;
        line-height: 2;
        color: #0a0a0a;
    }
	
	.force-break {
        display: block;
    }

    /* ボタン */
    .en-button {
        text-align: left;
    }

    .hoiku {
        padding: 0 40px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;  /* 全体左寄せ */
        text-align: left;
        background: #F3F0E7;
        margin-top: 80px;
    }
    
    /* コンテナの幅を学童と統一 */
    .hoiku-container {
        width: 600px;
        max-width: 100%;
    }
    
    /* ヘッダー（タイトル＋ボタン） */
    .hoiku-header {
        display: flex;
        flex-direction: column;
        align-items: flex-start;  /* 左寄せ */
        width: 100%;
        margin-top: 20px;
        padding: 0;
    }
    
    /* タイトル */
    .hoiku-title {
        font-size: 24px;
        margin-bottom: 16px;
    }
    
    /* ボタン */
    .hoiku-button {
        text-align: left;
        width: 100%;
    }
    
    /* 画像エリア */
    .hoiku-img {
        width: 100%;
        margin-top: 20px;
        padding: 0;
    }
    .hoiku-img img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    /* 矢印のアニメーション */
    @keyframes arrow-move {
        0% { transform: translateX(0); }
        50% { transform: translateX(5px); }
        100% { transform: translateX(0); }
    }

    .gakudo {
        padding: 0 40px;
        display: flex;
        flex-direction: column;
        align-items: flex-end; 
        text-align: left;
        background: #F3F0E7;
        margin-bottom: 80px;
    }
    
    /* コンテナを画面いっぱいに広げる */
    .gakudo-container {
        width: 600px;
        max-width: 100%;
    }
    
    /* ヘッダー（タイトル＋ボタン） */
    .gakudo-header {
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* 左寄せ */
        width: 100%;
        margin-top: 20px;
        padding: 0;
    }
    
    /* タイトルのサイズ調整（必要に応じて） */
    .gakudo-title {
        font-size: 24px;
        margin-bottom: 16px;
    }
    
    /* ボタンも左寄せに */
    .gakudo-button {
        text-align: left;
        width: 100%;
    }
    
    /* 画像エリア */
    .gakudo-img {
        width: 100%;
        margin-top: 20px;
        padding: 0;
    }
	
    .gakudo-img img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    /* 矢印のアニメーション */
    @keyframes arrow-move {
        0% { transform: translateX(0); }
        50% { transform: translateX(5px); }
        100% { transform: translateX(0); }
    }

    .omoi-button a,
    .en-button a,
    .hoiku-button a,
    .gakudo-button a {
        display: inline-flex;
        align-items: center;
        padding: 8px 16px;
        font-size: 14px;
        font-weight: 500;
        color: #0a0a0a;
        text-decoration: none;
        background-color: transparent;
        border: 1px solid #0a0a0a;
        position: relative;
        overflow: hidden;
        white-space: nowrap;
    }

    /* 矢印（1秒ごとに動くアニメーション） */
    .omoi-button a::after,
    .en-button a::after,
    .hoiku-button a::after,
    .gakudo-button a::after {
        content: "＞"; /* 矢印を表示 */
        margin-left: 10px;
        font-size: 18px;
        transition: transform 0.3s ease;
        display: inline-block;
        animation: arrow-move 1s infinite ease-in-out;
    }

    /* 矢印のアニメーション（1秒ごとに動く） */
    @keyframes arrow-move {
        0% { transform: translateX(0); }
        50% { transform: translateX(5px); }
        100% { transform: translateX(0); }
    }
}

/* PC画面（768px以上）の場合、タイトルを折り返さないようにする */
@media (min-width: 769px) {
    .omoi-title, .en-title {
        white-space: nowrap; /* 改行させない */
        max-height: none; /* 高さの制限を解除 */
        overflow: visible; /* 必要に応じてオーバーフロー処理 */
    }
}
