.sm-wcfg {
	--sm-wcfg-thumb-size: 72px;
	--sm-wcfg-gap: 8px;
	--sm-wcfg-fade: 300ms;
	--sm-wcfg-fit: contain;
	--sm-wcfg-ratio: auto;
	display: grid;
	gap: var(--sm-wcfg-gap);
	width: 100%;
	min-width: 0;
}

.sm-wcfg--thumbs-right {
	grid-template-columns: minmax(0, 1fr) var(--sm-wcfg-thumb-size);
	grid-template-areas: "stage thumbs";
}

.sm-wcfg--thumbs-left {
	grid-template-columns: var(--sm-wcfg-thumb-size) minmax(0, 1fr);
	grid-template-areas: "thumbs stage";
}

.sm-wcfg--thumbs-bottom {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "stage" "thumbs";
}

.sm-wcfg__stage {
	grid-area: stage;
	position: relative;
	width: 100%;
	min-width: 0;
	aspect-ratio: var(--sm-wcfg-ratio);
	overflow: hidden;
	background: transparent;
}

.sm-wcfg__slide {
	position: absolute;
	inset: 0;
	z-index: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity var(--sm-wcfg-fade) ease, visibility 0s linear var(--sm-wcfg-fade);
}

.sm-wcfg__slide.is-active {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity var(--sm-wcfg-fade) ease, visibility 0s linear 0s;
}

.sm-wcfg__image-link,
.sm-wcfg__image {
	display: block;
	width: 100%;
	height: 100%;
}

.sm-wcfg__image {
	object-fit: var(--sm-wcfg-fit);
}

.sm-wcfg__thumbs {
	grid-area: thumbs;
	display: flex;
	gap: var(--sm-wcfg-gap);
	margin: 0;
	padding: 0;
	min-width: 0;
}

.sm-wcfg--thumbs-left .sm-wcfg__thumbs,
.sm-wcfg--thumbs-right .sm-wcfg__thumbs {
	flex-direction: column;
	align-self: start;
	max-height: 100%;
	overflow-x: hidden;
	overflow-y: auto;
}

.sm-wcfg--thumbs-bottom .sm-wcfg__thumbs {
	flex-direction: row;
	flex-wrap: wrap;
}

.sm-wcfg__thumb {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 auto;
	width: var(--sm-wcfg-thumb-size);
	height: auto;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
	opacity: 0.45;
	overflow: hidden;
	outline: none;
	filter: grayscale(100%);
	transition: opacity 150ms ease, border-color 150ms ease;
}

.sm-wcfg__thumb:hover,
.sm-wcfg__thumb:focus-visible,
.sm-wcfg__thumb.is-active {
	opacity: 1;
	filter: none;
}

.sm-wcfg__thumb.is-active {
	border-color: currentColor;
}

.sm-wcfg__thumb:focus-visible {
	outline: none
	outline-offset: 2px;
}

.sm-wcfg__thumb-image {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
}

.sm-wcfg-notice {
	padding: 0.75rem 1rem;
	border: 1px solid currentColor;
}

@media (max-width: 600px) {
	.sm-wcfg,
	.sm-wcfg--thumbs-left,
	.sm-wcfg--thumbs-right,
	.sm-wcfg--thumbs-bottom {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas: "stage" "thumbs";
	}

	.sm-wcfg__thumbs,
	.sm-wcfg--thumbs-left .sm-wcfg__thumbs,
	.sm-wcfg--thumbs-right .sm-wcfg__thumbs,
	.sm-wcfg--thumbs-bottom .sm-wcfg__thumbs {
		flex-direction: row;
		flex-wrap: nowrap;
		overflow-x: auto;
		overflow-y: hidden;
		scrollbar-width: thin;
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sm-wcfg__slide,
	.sm-wcfg__thumb {
		transition: none;
	}
}
