/**
 * WehfiGO — Permanent Gallery Option A (inline filmstrip).
 */

.wehfigo-perm-gallery {
	padding-block: var(--space-7, 2.5rem);
}

.wehfigo-perm-gallery__stage {
	display: grid;
	gap: 12px;
}

.wehfigo-perm-gallery__main {
	position: relative;
	margin: 0;
	border-radius: var(--radius-lg, 14px);
	overflow: hidden;
	background: #121212;
	border: 1px solid rgba(255, 255, 255, 0.12);
	aspect-ratio: 16 / 10;
	max-height: min(72vh, 640px);
}

.wehfigo-perm-gallery__main-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	display: block;
	background: #0a0a0a;
	transition: opacity 0.22s ease;
}

.wehfigo-perm-gallery__main-img.is-swapping {
	opacity: 0.35;
}

.wehfigo-perm-gallery__caption {
	position: absolute;
	left: 12px;
	right: 88px;
	bottom: 12px;
	margin: 0;
	padding: 8px 10px;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.62);
	border: 1px solid rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 0.9rem;
	line-height: 1.35;
}

.wehfigo-perm-gallery__caption:empty {
	display: none;
}

.wehfigo-perm-gallery__count {
	position: absolute;
	right: 12px;
	bottom: 12px;
	padding: 6px 10px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.7);
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.wehfigo-perm-gallery__thumbs {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 4px 2px 8px;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.wehfigo-perm-gallery__thumb {
	flex: 0 0 auto;
	width: 76px;
	height: 76px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
	background: #1a1a1a;
	opacity: 0.72;
	transition: border-color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.wehfigo-perm-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wehfigo-perm-gallery__thumb:hover,
.wehfigo-perm-gallery__thumb:focus-visible {
	opacity: 1;
	outline: none;
}

.wehfigo-perm-gallery__thumb.is-active {
	border-color: var(--color-brand-red, #d6001c);
	opacity: 1;
	transform: translateY(-1px);
}

html:not([data-theme="dark"]) body:not(#dark-mode) .wehfigo-perm-gallery__main {
	background: #f3f3f3;
	border-color: rgba(0, 0, 0, 0.08);
}

html:not([data-theme="dark"]) body:not(#dark-mode) .wehfigo-perm-gallery__main-img {
	background: #ececec;
}

html:not([data-theme="dark"]) body:not(#dark-mode) .wehfigo-perm-gallery__thumb {
	background: #e8e8e8;
}

@media (max-width: 640px) {
	.wehfigo-perm-gallery__main {
		aspect-ratio: 4 / 3;
		max-height: 52vh;
	}

	.wehfigo-perm-gallery__thumb {
		width: 64px;
		height: 64px;
	}

	.wehfigo-perm-gallery__caption {
		right: 12px;
		bottom: 44px;
		font-size: 0.82rem;
	}
}
