/*
 * Simple Photo Carousel — front end.
 * Every rule is scoped under .spc-carousel so it can't affect the rest of the site.
 * A few properties use !important because some themes force button and text
 * styles site-wide.
 *
 * To change the dot color, add to Appearance -> Customize -> Additional CSS:
 *   .spc-carousel { --spc-dot: #8b6914; }   (dots and the thumbnail highlight)
 */
.spc-carousel {
	--spc-dot: #9a9a9a;
	--spc-radius: 6px;
	position: relative;
	width: 100%;
	margin: 0 0 1.5em;
}

.spc-carousel .spc-viewport {
	position: relative;
	overflow: hidden;
	aspect-ratio: var(--spc-ratio, 16 / 9);
	background: #111;
	border-radius: var(--spc-radius);
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
}

.spc-carousel .spc-track {
	display: flex;
	height: 100%;
	margin: 0;
	padding: 0;
	transition: transform 0.55s cubic-bezier(0.25, 0.8, 0.25, 1);
	will-change: transform;
}

.spc-carousel .spc-slide {
	position: relative;
	flex: 0 0 100%;
	height: 100%;
	margin: 0;
	overflow: hidden;
}

.spc-carousel .spc-link {
	display: block;
	width: 100%;
	height: 100%;
	border: 0 !important;
	box-shadow: none !important;
}

.spc-carousel .spc-slide img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	object-fit: cover;
	-webkit-user-drag: none;
}
.spc-carousel.spc-fit-contain .spc-slide img { object-fit: contain; }

.spc-carousel .spc-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
	padding: 3em 1.25em 1em;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.78));
	color: #fff !important;
	font-size: 1rem;
	line-height: 1.4;
	text-align: left;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
	pointer-events: none;
}

/* Buttons: reset whatever the theme applies to <button>. */
.spc-carousel .spc-btn {
	-webkit-appearance: none;
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
	font: inherit;
	line-height: 1 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	cursor: pointer;
	text-transform: none !important;
}
.spc-carousel .spc-btn:focus-visible {
	outline: 3px solid #fff !important;
	outline-offset: 2px;
}

.spc-carousel .spc-arrow,
.spc-carousel .spc-toggle {
	position: absolute;
	z-index: 2;
	border-radius: 50% !important;
	background: rgba(0, 0, 0, 0.45) !important;
	color: #fff !important;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}
.spc-carousel .spc-arrow:hover,
.spc-carousel .spc-toggle:hover { background: rgba(0, 0, 0, 0.72) !important; }

.spc-carousel .spc-arrow {
	top: 50%;
	width: 46px;
	height: 46px;
	transform: translateY(-50%);
}
.spc-carousel .spc-prev { left: 12px; }
.spc-carousel .spc-next { right: 12px; }

.spc-carousel .spc-toggle {
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
}
.spc-carousel .spc-toggle .spc-icon { width: 18px; height: 18px; }
.spc-carousel .spc-icon-play { display: none; }
.spc-carousel.is-paused .spc-icon-play { display: block; }
.spc-carousel.is-paused .spc-icon-pause { display: none; }

.spc-carousel .spc-dots {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 2px;
	margin-top: 10px;
}
.spc-carousel .spc-dot {
	width: 26px;
	height: 26px;
	background: transparent !important;
	border-radius: 50% !important;
}
.spc-carousel .spc-dot::before {
	content: "";
	display: block;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	border: 2px solid var(--spc-dot);
	box-sizing: border-box;
	transition: background-color 0.2s ease, transform 0.2s ease;
}
.spc-carousel .spc-dot:hover::before { transform: scale(1.2); }
.spc-carousel .spc-dot.is-active::before { background: var(--spc-dot); }
.spc-carousel .spc-dot:focus-visible { outline-color: var(--spc-dot) !important; }

@media (max-width: 600px) {
	.spc-carousel .spc-arrow { width: 38px; height: 38px; }
	.spc-carousel .spc-prev { left: 6px; }
	.spc-carousel .spc-next { right: 6px; }
	.spc-carousel .spc-caption { font-size: 0.9rem; padding: 2.5em 0.9em 0.75em; }
}

@media (prefers-reduced-motion: reduce) {
	.spc-carousel .spc-track { transition: none; }
}

/* Thumbnail strip below the photos */
.spc-carousel .spc-thumbs {
	position: relative;
	display: flex;
	gap: 8px;
	margin-top: 8px;
	padding: 5px;
	overflow-x: auto;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}
/* Center the strip when it fits; scroll from the left edge when it doesn't. */
.spc-carousel .spc-thumb:first-child { margin-left: auto !important; }
.spc-carousel .spc-thumb:last-child { margin-right: auto !important; }
.spc-carousel .spc-thumb {
	flex: 0 0 auto;
	width: 96px;
	aspect-ratio: var(--spc-ratio, 16 / 9);
	overflow: hidden;
	border-radius: 4px !important;
	background: #222 !important;
	opacity: 0.55;
	transition: opacity 0.2s ease, box-shadow 0.2s ease;
}
.spc-carousel .spc-thumb:hover { opacity: 0.85; }
.spc-carousel .spc-thumb.is-active {
	opacity: 1;
	box-shadow: 0 0 0 3px var(--spc-thumb-ring, var(--spc-dot)) !important;
}
.spc-carousel .spc-thumb img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	object-fit: cover;
	pointer-events: none;
}
@media (max-width: 600px) {
	.spc-carousel .spc-thumb { width: 64px; }
	.spc-carousel .spc-thumbs { gap: 6px; }
}
