/* Candlecopia Category Showcase */

.ccs-showcase {
	margin-block: 1.5em;
}

.ccs-showcase__heading {
	margin: 0 0 0.75em;
	font-size: 1.4em;
	line-height: 1.2;
}

.ccs-showcase__row {
	display: flex;
	gap: 1rem;
	align-items: stretch;
	justify-content: center; /* center the cards as a group */
}

/* Default: wrap to additional rows on narrow screens. */
.ccs-showcase__row--wrap {
	flex-wrap: wrap;
}

/* Alternative: single horizontal strip that scrolls. */
.ccs-showcase__row--scroll {
	flex-wrap: nowrap;
	/* keep the strip left-anchored so its start isn't cut off when it overflows */
	justify-content: flex-start;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 0.5rem; /* room for the scrollbar */
}

.ccs-showcase__row--scroll .ccs-card {
	scroll-snap-align: start;
	flex: 0 0 auto;
}

/* Card */
.ccs-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	flex: 0 1 160px; /* don't grow, so the group can sit centered */
	min-width: 120px;
	max-width: 200px;
	padding: 0.75rem;
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 12px;
	text-align: center;
	text-decoration: none;
	color: inherit;
	background: #fff;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.ccs-card:hover,
.ccs-card:focus {
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.12 );
	transform: translateY( -2px );
	text-decoration: none;
}

/* Each card is one keyboard-focusable link; give keyboard users a clearly
   visible focus ring (themes often reset the default outline away). */
.ccs-card:focus-visible {
	outline: 2px solid #000;
	outline-offset: 3px;
}

.ccs-card__name {
	order: 0; /* name above the image */
	font-weight: 600;
	line-height: 1.2;
	/* The whole card is an <a>, but the name should read as a label, not a link:
	   force black text and no underline in every state. */
	color: #000;
	text-decoration: none;
}

.ccs-card:hover .ccs-card__name,
.ccs-card:focus .ccs-card__name {
	color: #000;
	text-decoration: none;
}

.ccs-card__media {
	order: 1; /* image below the name */
	display: block;
	width: 100%;
}

.ccs-card__img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
	object-fit: cover;
	aspect-ratio: 1 / 1; /* even cards despite varied product image ratios */
}

/* Narrow screens: in wrap mode let cards grow to two-up. */
@media ( max-width: 600px ) {
	.ccs-showcase__row--wrap .ccs-card {
		flex-basis: calc( 50% - 0.5rem );
		max-width: none;
	}
}
