/* Custom Swiper Block Frontend Styles */
/* 修正: スクロールバーのスタイルをブロック内に限定 (初期定義) */
.wp-block-create-block-custom-swiper .swiper-scrollbar {
	display: none;
}

.wp-block-create-block-custom-swiper {
	max-width: 100%;
	overflow: hidden;
}

.flexible-swiper-container {
	width: 100%;
	max-width: 100%;
	position: relative;
}

/* 修正: swiperコンテナのスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper {
	width: 100%;
	max-width: 100%;
	height: auto;
	overflow: hidden;
}

/* 修正: swiper-wrapperのスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-wrapper {
	width: 100%;height: auto;box-sizing: border-box !important; /* ← すでにあるか確認 */
}

/* 修正: swiper-slideのスタイルをブロック内に限定 (widthは干渉防止のためコメントアウト維持) */
.wp-block-create-block-custom-swiper .swiper-slide {
	/* width: 100%; */
	height: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	box-sizing: border-box !important;
}

/* メインスライド画像 // 修正: swiper-slide-imageのスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-slide-image {
	width: 100%;
	max-width: 100%;
	height: auto;
	aspect-ratio: 3/2;
	-o-object-fit: cover;
	object-fit: cover;
	border-radius: 12px;
	display: block;
}

/* レスポンシブ対応 */
@media (min-width: 1024px) {
	.wp-block-create-block-custom-swiper .swiper-slide-image {
		border-radius: 24px;
	}
}

/* ナビゲーションボタン // 修正: ナビゲーションボタンのスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-button-prev,
.wp-block-create-block-custom-swiper .swiper-button-next {
	display: none;
}

@media (min-width: 1024px) {

	/* 修正: ナビゲーションボタンのスタイルをブロック内に限定 */
	.wp-block-create-block-custom-swiper .swiper-button-prev,
	.wp-block-create-block-custom-swiper .swiper-button-next {
		display: flex;
	}
}

/* ページネーション // 修正: ページネーションコンテナのスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-pagination {
	margin-top: 20px;
	position: relative !important;
	/* left: 50%;
	transform: translateX(-50%);
	width: fit-content; */
	/* text-align: center !important; */
	display: flex !important;
	justify-content: center !important;
	bottom: auto;
}

/* 修正: ページネーションのbulletのスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-pagination-bullet {
	background: #333;
	opacity: 1 !important;
	/* transition: opacity 0.3s ease; */
}

/* 修正: ページネーションのアクティブbulletのスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-pagination-bullet-active {
	opacity: 1 !important;
	background: var(--accent_color) !important;
}

/* スクロールバー // 修正: スクロールバーコンテナのスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-scrollbar {
	margin-top: 20px;
	position: relative;
	bottom: auto;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 4px;
}

/* 修正: スクロールバーのドラッグ要素のスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-scrollbar-drag {
	background: #333;
	border-radius: 4px;
}

/* サムネイル */
.swiper-thumbs {
	margin-top: 16px;
}

@media (min-width: 768px) {
	.swiper-thumbs {
		margin-top: 32px;
	}
}

/* 修正: サムネイルのスライド要素のスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-thumbs .swiper-slide {
	opacity: 0.6;
	cursor: pointer;
	transition: opacity 0.3s ease;
}

/* 修正: サムネイルのアクティブスライドのスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-thumbs .swiper-slide-thumb-active {
	opacity: 1;
}

/* 修正: サムネイル画像要素のスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-thumb-image {
	width: 100%;
	height: auto;
	aspect-ratio: 3/2;
	-o-object-fit: cover;
	object-fit: cover;
	border-radius: 6px;
	display: block;
	transition: transform 0.3s ease;
}

/* 修正: サムネイルホバー時の画像変形をブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-thumbs .swiper-slide:hover .swiper-thumb-image {
	transform: scale(1.05);
}

/* コンテナの最大幅制限 */
.wp-block-create-block-custom-swiper {
	max-width: 1200px; /* 元のコードの 'max-width: 840px;' は '1200px' に戻しました。もし840pxが正しければ修正してください。 */
	margin: 0 auto;
}

/* フォールバック：画像が異常に大きくなるのを防ぐ (セレクタは適切) */
.wp-block-create-block-custom-swiper img {
	max-width: 100% !important;
	width: auto !important;
	height: auto !important;
}

/* セレクタは適切 */
.custom-swiper-slide-editor img,
.wp-block-create-block-custom-swiper .swiper-slide img {
	width: 100%;
	aspect-ratio: 3 / 2;
	-o-object-fit: cover;
	object-fit: cover;
	border-radius: 10px;
}

/* セレクタは適切 */
.wp-block-create-block-custom-swiper h4 {
	margin-top: 0 !important;
	margin-bottom: 8px !important;
	font-size: 18px !important;
}

@media (min-width: 1024px) {
	.wp-block-create-block-custom-swiper h4 {
		font-size: 20px !important;
		/* PC表示時 */
	}
}

/* セレクタは適切 */
.wp-block-create-block-custom-swiper p {
	font-size: 18px !important;
}

@media (min-width: 1024px) {
	.wp-block-create-block-custom-swiper p {
		font-size: 20px !important;
		/* PC表示時 */
	}
}

/* swiper ページネーション (セレクタは適切) */
/* .wp-block-create-block-custom-swiper .swiper-pagination {
	position: relative !important;
	display: flex;
	justify-content: center;
	margin-top: 20px;
	left: 50%;
	transform: translateX(-50%);
	width: fit-content;
} */

/* 修正: ページネーション bullet のスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-pagination-bullet {
	background: var(--gray_color) !important;
	opacity: 1 !important;
}

/* 修正: ページネーション アクティブ bullet のスタイルをブロック内に限定 */
.wp-block-create-block-custom-swiper .swiper-pagination-bullet-active {
	background: var(--accent_color) !important;
}

/* swiper-wrapper (セレクタは適切) */
.wp-block-create-block-custom-swiper .swiper .swiper-wrapper {
	gap: 0 !important;
	margin: 0 !important;
	max-width: 100% !important;
}

/* 1枚＝コンテナ幅に固定（PCだけでもOK） (セレクタは適切) */
.wp-block-create-block-custom-swiper .swiper .swiper-wrapper .swiper-slide {
	/* flex: 0 0 100% !important;width: 100% !important; */
	box-sizing: border-box;
}

/* 念のため (セレクタは適切) */
.wp-block-create-block-custom-swiper .swiper {
	overflow: hidden;
}

.custom-swiper-editor-container {
	display: flex;
	flex-wrap: wrap;
	gap: 4%;
}

.custom-swiper-slide-editor {
	width: 48%;
}

.components-button.image-button-editor {
	height: -moz-fit-content;
	height: fit-content;
}

.wp-admin .components-form-toggle,
.wp-admin .components-form-toggle__track,
.wp-admin .components-form-toggle__thumb {
	pointer-events: auto !important;
	cursor: pointer;
}

.components-flex {
	position: relative;
}

.editor-controls {
	margin-top: 20px;
}

