/* ▼▼▼ 1. ページ基本スタイル ▼▼▼ */
.swiper-pattern-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
    margin-top: 1rem;
    border-bottom: 2px solid #c84c54;
    padding-bottom: 0.5rem;
}

.swiper-pattern-content {
    width: 100%;
    max-width: 1200px;
    padding: 0 1rem;
    box-sizing: border-box;
}

.swiper-pattern-section {
    width: 100%;
    /* height: 100%; */
    margin-bottom: 3rem;
}

/* ▼▼▼ 2. Swiper共通スタイル ▼▼▼ */
.swiper-container-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    /* min-height: 70vh; */
    overflow: hidden;
    /* ループ時のスライドはみ出し防止のため追加 */
    /* padding: 0 1rem; */
    box-sizing: border-box;
}

/* Swiper初期化前のちらつき防止 */
.swiper:not(.swiper-initialized) {
    visibility: hidden;
}


/* ▼▼▼【改善点 1】JSが実行される前のレイアウト崩れを防ぐ ▼▼▼ */
.swiper-wrapper>* {
    /* スライドの基本レイアウト（FOUC防止） */
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;

    /* CMSが出力する <p> タグなどのマージンをリセット */
    margin: 0;

    /* スライドの共通デザイン */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    background-size: cover;
    background-position: center;
}

/* スライド内の画像がコンテナいっぱいに広がるように設定 */
.swiper-wrapper>* img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* アスペクト比を維持したままコンテナを覆う */
    object-position: center;
    /* 中央を基準に表示 */
}

/* ▲▲▲【改善点 1】ここまで ▲▲▲ */

/* JSで .swiper-slide クラスが付与された後のスタイル (念のため) */
.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    background-size: cover;
    background-position: center;
}


.swiper-controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    width: 100%;
    max-width: 800px;
    position: relative;
}

.single-slide .swiper-controls-wrapper {
    display: none;
}

/* 再生/停止ボタン (CSS描画) */
.autoplay-controls {
    margin-right: 0.75rem;
    display: flex;
}

.autoplay-controls button {
    padding: 0;
    background: #FFF;
    cursor: pointer;
    width: 24px;
    height: 24px;
    vertical-align: middle;
    position: relative;
    border: solid 2px #00759C;
}

.play-button,
.stop-button {
    background-color: #FFF;
    box-shadow: none;
    border: 1px solid #333;
    border-radius: 50%;
    box-sizing: border-box;
}

.play-button::after {
    content: '';
    display: block;
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid #00759C;
    transform: translate(-50%, -50%);
    margin-left: 2px;
}

.stop-button::before,
.stop-button::after {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    width: 4px;
    height: 12px;
    background-color: #00759C;
    transform: translateY(-50%);
}

.stop-button::before {
    left: 5px;
}

.stop-button::after {
    right: 5px;
}

/* 左右矢印共通 */
.swiper-button-prev,
.swiper-button-next {
    position: static;
    width: 24px;
    height: 24px;
    margin-top: 0;
    margin-bottom: 0;
    background-color: #00759C;
    background-image: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: solid 1px #00759C;
    box-sizing: border-box;
}

.swiper-button-prev {
    margin-right: 1.5rem;
    transform: rotate(180deg);
}

.swiper-button-next {
    margin-left: 1.5rem;
}

.swiper-button-prev::after,
.swiper-button-next::after {
    content: '';
    box-sizing: border-box;
    width: 11px;
    height: 11px;
    border-top: 3px solid #FFF;
    border-right: 3px solid #FFF;
    transform: translateX(-2px) rotate(45deg);
}

/* ページネーション (ドット) スタイル */
.swiper-pagination {
    position: static;
    width: auto !important;
    display: flex;
    gap: 8px;
    align-items: center;
}

.swiper-pagination-bullet {
    width: 24px;
    height: 24px;
    background-color: #FFF;
    opacity: 1;
    margin: 0;
    border-radius: 50%;
    transition: background-color 0.3s;
    border: solid 2px #00759C;
    box-sizing: border-box;
}

.swiper-pagination-bullet-active {
    width: 30px;
    height: 30px;
    background-color: #FFE32B;
}

svg.swiper-navigation-icon {
    display: none;
}

/* ▼▼▼ 3. 各パターン固有スタイル ▼▼▼ */

.swiper-multi .swiper-container {
    width: 100%;
    max-height: 100vh;
    /* aspect-ratio: 16 / 9; */
    overflow: hidden;
}

.swiper-peek .swiper-container {
    width: 100%;
    max-height: 100vh;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.swiper-peek .swiper-wrapper>* {
    /* クラス付与前 */
    width: 80%;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.swiper-peek .swiper-slide {
    /* クラス付与後 */
    width: 80%;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.swiper-peek .swiper-slide-active {
    opacity: 1;
}

.swiper-peek .swiper-controls-wrapper {
    z-index: 2;
}

.swiper-coverflow .swiper-container {
    width: 100%;
    /* max-width: 100vw; */
    /* はみ出しの原因となるため削除 */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: visible;
    padding-top: 50px;
    padding-bottom: 50px;
}

.swiper-coverflow .swiper-wrapper>* {
    /* クラス付与前 */
    width: 60%;
    aspect-ratio: 16 / 9;
}

.swiper-coverflow .swiper-slide {
    /* クラス付与後 */
    width: 60%;
    aspect-ratio: 16 / 9;
}

.swiper-grid .swiper-container {
    width: 100%;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.swiper-grid .swiper-wrapper>* {
    /* クラス付与前 */
    height: auto;
    aspect-ratio: 16 / 9;
    box-sizing: border-box;
}

.swiper-grid .swiper-slide {
    /* クラス付与後 */
    height: auto;
    aspect-ratio: 16 / 9;
    box-sizing: border-box;
}