/* Faded Carousel Gallery */

.fcg {
	--fcg-height: 400px;
	--fcg-width: 600px;
	--fcg-fit: cover;
	--fcg-fade: 0.3;
	--fcg-fade-time: 400ms;
	--fcg-radius: 0px;
	--fcg-mask: 12%;
	--fcg-thumb: 70px;
	--fcg-thumb-gap: 8px;
	--fcg-thumb-top: 12px;
	--fcg-thumb-radius: 0px;
	--fcg-thumb-opacity: 0.55;
	--fcg-active: #000;
	--fcg-active-width: 2px;
	--fcg-arrow-color: #fff;
	--fcg-arrow-bg: rgba(0, 0, 0, 0.55);
	--fcg-arrow-size: 44px;
	--fcg-arrow-inset: 16px;

	position: relative;
	width: 100%;
	box-sizing: border-box;
}

.fcg *,
.fcg *::before,
.fcg *::after {
	box-sizing: border-box;
}

.fcg-empty {
	padding: 40px 20px;
	text-align: center;
	border: 2px dashed #c3c4c7;
	color: #646970;
	font-size: 14px;
}

/* ---------- Main slider ---------- */

.fcg-stage {
	position: relative;
}

.fcg .fcg-main {
	position: relative;
	width: 100%;
	overflow: hidden;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fcg--mask .fcg-main {
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fcg-mask), #000 calc(100% - var(--fcg-mask)), transparent 100%);
	mask-image: linear-gradient(to right, transparent 0, #000 var(--fcg-mask), #000 calc(100% - var(--fcg-mask)), transparent 100%);
}

.fcg .fcg-main .swiper-wrapper {
	position: relative;
	display: flex;
	width: 100%;
	height: 100%;
	box-sizing: content-box;
	transition-property: transform;
}

.fcg .fcg-main .fcg-slide {
	position: relative;
	flex-shrink: 0;
	width: auto;
	height: var(--fcg-height);
	overflow: hidden;
	border-radius: var(--fcg-radius);
	opacity: var(--fcg-fade);
	transition: opacity var(--fcg-fade-time) ease;
	cursor: pointer;
}

.fcg .fcg-main .fcg-slide.swiper-slide-active {
	opacity: 1;
	cursor: grab;
}

.fcg .fcg-main .fcg-slide img {
	display: block;
	width: auto;
	max-width: none;
	height: var(--fcg-height);
	margin: 0;
	border-radius: 0;
	box-shadow: none;
	user-select: none;
	-webkit-user-drag: none;
}

/* Uniform (cropped) mode */
.fcg--fixed .fcg-main .fcg-slide {
	width: var(--fcg-width);
	max-width: 92vw;
}

.fcg--fixed .fcg-main .fcg-slide img {
	width: 100%;
	max-width: 100%;
	object-fit: var(--fcg-fit);
}

/* ---------- Arrows ---------- */

.fcg .fcg-arrow {
	all: unset;
	box-sizing: border-box;
	position: absolute;
	top: 50%;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--fcg-arrow-size);
	height: var(--fcg-arrow-size);
	margin-top: calc(var(--fcg-arrow-size) / -2);
	border-radius: 50%;
	background: var(--fcg-arrow-bg);
	color: var(--fcg-arrow-color);
	cursor: pointer;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.fcg .fcg-arrow:hover {
	transform: scale(1.08);
}

.fcg .fcg-arrow:focus-visible {
	outline: 2px solid var(--fcg-active);
	outline-offset: 2px;
}

.fcg .fcg-arrow svg {
	width: 55%;
	height: 55%;
	fill: currentColor;
}

.fcg .fcg-prev {
	left: var(--fcg-arrow-inset);
}

.fcg .fcg-next {
	right: var(--fcg-arrow-inset);
}

/* ---------- Thumbnails ---------- */

.fcg .fcg-thumbs {
	margin-top: var(--fcg-thumb-top);
}

.fcg .fcg-thumbs-track {
	position: relative;
	display: flex;
	gap: var(--fcg-thumb-gap);
	padding: 4px;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.fcg .fcg-thumbs-track::-webkit-scrollbar {
	display: none;
}

/* centre the strip when it fits; scrolls normally when it doesn't */
.fcg .fcg-thumbs-track > .fcg-thumb:first-child {
	margin-left: auto;
}

.fcg .fcg-thumbs-track > .fcg-thumb:last-child {
	margin-right: auto;
}

.fcg .fcg-thumb {
	all: unset;
	box-sizing: border-box;
	flex: 0 0 var(--fcg-thumb);
	width: var(--fcg-thumb);
	height: var(--fcg-thumb);
	overflow: hidden;
	border: var(--fcg-active-width) solid transparent;
	border-radius: var(--fcg-thumb-radius);
	opacity: var(--fcg-thumb-opacity);
	cursor: pointer;
	transition: opacity 0.25s ease, border-color 0.25s ease;
}

.fcg .fcg-thumb:hover {
	opacity: 0.85;
}

.fcg .fcg-thumb:focus-visible {
	outline: 2px solid var(--fcg-active);
	outline-offset: 2px;
}

.fcg .fcg-thumb.is-active {
	opacity: 1;
	border-color: var(--fcg-active);
}

.fcg .fcg-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
}

@media (prefers-reduced-motion: reduce) {
	.fcg .fcg-main .fcg-slide,
	.fcg .fcg-thumb,
	.fcg .fcg-arrow {
		transition: none;
	}
}
