/**
 * 施工事例(works) 拡張lightbox スタイル
 *
 * @package x-t9-child
 */

/* ギャラリー画像にズーム可能であることを示す */
.bp-works-gallery a.bp-wg-lightbox {
	cursor: zoom-in;
	display: block;
	height: 100%;
}

/* ===== オーバーレイ本体 ===== */
.bp-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	overflow: hidden;
}

.bp-lb.is-open {
	display: block;
}

body.bp-lb-open {
	overflow: hidden; /* 背景スクロール防止 */
}

.bp-lb__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 15, 17, 0.92);
	cursor: zoom-out;
}

/* ===== メイン画像 ===== */
.bp-lb__stage {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 132px; /* サムネイル一覧の高さ分を空ける */
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px clamp(48px, 9vw, 110px);
	pointer-events: none; /* 画像外クリックは背景に通す */
}

.bp-lb__img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
	transition: opacity 0.25s ease;
	pointer-events: auto;
}

/* ===== 前後ナビ矢印 ===== */
.bp-lb__nav {
	position: absolute;
	top: calc((100% - 132px) / 2);
	transform: translateY(-50%);
	z-index: 2;
	width: 52px;
	height: 52px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bp-lb__nav:hover,
.bp-lb__nav:focus-visible {
	background: rgba(255, 255, 255, 0.3);
	outline: none;
}

.bp-lb__prev { left: clamp(8px, 2vw, 28px); }
.bp-lb__next { right: clamp(8px, 2vw, 28px); }

/* ===== 閉じる ===== */
.bp-lb__close {
	position: absolute;
	top: 14px;
	right: 16px;
	z-index: 3;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}

.bp-lb__close:hover,
.bp-lb__close:focus-visible {
	background: rgba(255, 255, 255, 0.3);
	outline: none;
}

/* ===== カウンター ===== */
.bp-lb__counter {
	position: absolute;
	top: 22px;
	left: 0;
	right: 0;
	z-index: 2;
	text-align: center;
	color: rgba(255, 255, 255, 0.85);
	font-size: 13px;
	letter-spacing: 0.04em;
	pointer-events: none;
}

/* ===== サムネイル一覧 ===== */
.bp-lb__thumbs {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 132px;
	z-index: 2;
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 14px 16px;
	overflow-x: auto;
	overflow-y: hidden;
	background: rgba(0, 0, 0, 0.85);
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
	-webkit-overflow-scrolling: touch;
}

.bp-lb__thumbs::-webkit-scrollbar { height: 8px; }
.bp-lb__thumbs::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.4);
	border-radius: 4px;
}

.bp-lb__thumb {
	flex: 0 0 auto;
	width: 104px;
	height: 72px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 4px;
	overflow: hidden;
	background: #222;
	cursor: pointer;
	opacity: 0.55;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}

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

.bp-lb__thumb:hover { opacity: 0.85; }

.bp-lb__thumb.is-active {
	opacity: 1;
	border-color: #fff;
}

/* ===== スマホ ===== */
@media (max-width: 600px) {
	.bp-lb__stage {
		bottom: 96px;
		padding: 16px 8px;
	}
	.bp-lb__nav {
		width: 42px;
		height: 42px;
		font-size: 18px;
		top: calc((100% - 96px) / 2);
	}
	.bp-lb__thumbs {
		height: 96px;
		padding: 10px 10px;
	}
	.bp-lb__thumb {
		width: 76px;
		height: 56px;
	}
}

/* アニメーションを抑える設定を尊重 */
@media (prefers-reduced-motion: reduce) {
	.bp-lb__img,
	.bp-lb__nav,
	.bp-lb__close,
	.bp-lb__thumb {
		transition: none;
	}
}
