/* ============================================
   SB Gallery Slider v1.1 - フロントエンド
   ============================================ */

.sbgs-wrap {
	display: flex;
	gap: 10px;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin-bottom: 24px;
	align-items: flex-start;
}

/* ---- メイン画像 ---- */
.sbgs-main {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	background: #111;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 4px;
}

.sbgs-main-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---- 矢印 ---- */
.sbgs-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0,0,0,.45);
	color: #fff;
	border: none;
	padding: 10px 14px;
	font-size: 18px;
	cursor: pointer;
	border-radius: 3px;
	line-height: 1;
	z-index: 2;
	transition: background .2s;
}
.sbgs-arrow:hover { background: rgba(0,0,0,.7); }
.sbgs-prev { left: 8px; }
.sbgs-next { right: 8px; }

/* ---- サムネイルエリア共通 ---- */
.sbgs-thumbs {
	flex-shrink: 0;
	display: grid;
	gap: 6px;
	overflow: hidden;   /* スクロールバーなし */
	align-content: start;
}

/* 列数バリエーション */
.sbgs-thumbs-cols-1 { width: 90px;  grid-template-columns: 1fr; }
.sbgs-thumbs-cols-2 { width: 186px; grid-template-columns: repeat(2, 1fr); }
.sbgs-thumbs-cols-3 { width: 282px; grid-template-columns: repeat(3, 1fr); }

/* ---- サムネイル1枚 ---- */
.sbgs-thumb {
	cursor: pointer;
	border-radius: 3px;
	overflow: hidden;
	border: 2px solid transparent;
	aspect-ratio: 1 / 1;
	opacity: .6;
	transition: border-color .2s, opacity .2s;
}
.sbgs-thumb:hover  { opacity: .85; }
.sbgs-thumb.is-active { border-color: #2196f3; opacity: 1; }

.sbgs-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---- レスポンシブ（スマホ） ---- */
@media (max-width: 640px) {
	.sbgs-wrap {
		flex-direction: column;
	}
	.sbgs-thumbs,
	.sbgs-thumbs-cols-1,
	.sbgs-thumbs-cols-2,
	.sbgs-thumbs-cols-3 {
		width: 100%;
		grid-template-columns: repeat(4, 1fr);
		overflow-x: auto;
		overflow-y: hidden;
	}
}
