/* Category Carousel — front-end styles (v1.2.0, compact layout) */

.cc-carousel {
	--cc-gap: 8px;
	--cc-aspect: 3/4;
	--cc-cols: 4;
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
}

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

/* Static wrapper that anchors the arrows and the edge fade. */
.cc-viewport-wrap {
	position: relative;
	width: 100%;
	isolation: isolate;
}

.cc-viewport {
	position: relative;
	width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	-ms-overflow-style: none;
	cursor: grab;
	touch-action: pan-x pan-y pinch-zoom;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
}

.cc-viewport::-webkit-scrollbar {
	display: none;
	height: 0;
}

/* While dragging with a mouse, turn snapping off so the drag is smooth. */
.cc-viewport.cc-dragging {
	cursor: grabbing;
	scroll-behavior: auto !important;
	scroll-snap-type: none;
}

.cc-track {
	display: flex;
	gap: var(--cc-gap);
}

/* --cc-cols can be fractional (e.g. 2.3) so the next card "peeks" in from
   the edge. That peek is the visual cue that there is more to swipe. */
.cc-slide {
	position: relative;
	flex: 0 0 auto;
	width: calc((100% - (var(--cc-cols) - 1) * var(--cc-gap)) / var(--cc-cols));
	aspect-ratio: var(--cc-aspect);
	display: block;
	text-decoration: none;
	overflow: hidden;
	border-radius: 6px;
	background: #e4e4e4;
	scroll-snap-align: start;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.cc-slide-image {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center top;
	background-repeat: no-repeat;
	background-color: #d8d8d8;
	pointer-events: none;
	transition: transform 0.35s ease;
}

@media (hover: hover) {
	.cc-slide:hover .cc-slide-image {
		transform: scale(1.04);
	}
}

/* Compact caption: small text on a soft gradient, instead of a big grey bar. */
.cc-slide-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	padding: 28px 10px 10px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.68) 0%, rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0) 100%);
	color: #fff;
	text-align: left;
	pointer-events: none;
}

.cc-name,
.cc-count {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	color: #fff;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.cc-name {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.25;
}

.cc-count {
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.08em;
	opacity: 0.85;
	line-height: 1.2;
}

/* Right-edge fade: only shown while there is more content to the right. */
.cc-viewport-wrap::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 36px;
	background: linear-gradient(to left, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease;
	z-index: 2;
	border-radius: 0 6px 6px 0;
}

.cc-carousel.cc-has-more .cc-viewport-wrap::after {
	opacity: 1;
}

/* Arrows: small, and hidden on touch screens where people just swipe. */
.cc-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: rgba(20, 20, 20, 0.6);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.cc-arrow:hover {
	background: rgba(20, 20, 20, 0.85);
}

.cc-arrow:active {
	transform: translateY(-50%) scale(0.94);
}

.cc-arrow[disabled] {
	opacity: 0;
	pointer-events: none;
}

.cc-arrow-prev {
	left: 8px;
}

.cc-arrow-next {
	right: 8px;
}

.cc-arrow svg {
	display: block;
}

@media (hover: none), (max-width: 640px) {
	.cc-arrow {
		display: none;
	}
}

/* Progress bar: shows where you are and how much is left. */
.cc-progress {
	display: none;
	position: relative;
	width: 120px;
	max-width: 50%;
	height: 3px;
	margin: 12px auto 0;
	border-radius: 3px;
	background: #dcdcdc;
	overflow: hidden;
}

.cc-progress-thumb {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 30%;
	border-radius: 3px;
	background: #1a1a1a;
}

.cc-carousel.cc-has-overflow .cc-progress {
	display: block;
}

/* Optional dots (shortcode indicator="dots") */
.cc-dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 12px;
}

.cc-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	border: none;
	background: #c4c4c4;
	padding: 0;
	cursor: pointer;
	transition: background-color 0.2s ease, width 0.2s ease;
}

.cc-dot.is-active {
	width: 16px;
	border-radius: 3px;
	background: #1a1a1a;
}

@media (max-width: 640px) {
	.cc-slide {
		border-radius: 4px;
	}
	.cc-slide-caption {
		padding: 22px 8px 8px;
	}
	.cc-name {
		font-size: 11px;
	}
	.cc-count {
		font-size: 9.5px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cc-viewport {
		scroll-behavior: auto;
	}
	.cc-slide-image {
		transition: none;
	}
}
