/**
 * CCI Feature Bar
 *
 * A row of short, gold gradient uppercase labels (course highlights such as
 * "Self-paced", "Online format", …) separated by thin blue divider lines that
 * fade at their ends. Responsive:
 *  - Desktop / Tablet (>=768px): a single row, a vertical divider between each
 *    label. Labels share the width equally and wrap their text as needed.
 *  - Mobile (<=767px): a 3-up grid — vertical dividers between the labels in a
 *    row and a full-width horizontal divider between rows.
 *
 * Dividers are drawn with CSS gradients on item pseudo-elements positioned in
 * the gaps, so the widget works for any number of labels. Defaults match the
 * Figma design.
 */
.cci-feature-bar {
	--cci-fbar-gap: 16px;
	--cci-fbar-row-gap: 12px;
	--cci-fbar-pad-y: 8px;
	--cci-fbar-divider-color: #1a6dff;
	--cci-fbar-divider-thickness: 1px;
	--cci-fbar-divider-height: 26px;
	--cci-fbar-grad-start: #f4e683;
	--cci-fbar-grad-mid: #bf923d;
	--cci-fbar-grad-end: #f4e683;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: center;
	gap: var(--cci-fbar-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	box-sizing: border-box;
}

.cci-feature-bar *,
.cci-feature-bar *::before,
.cci-feature-bar *::after {
	box-sizing: border-box;
}

.cci-feature-bar__item {
	flex: 1 1 0;
	min-width: 0;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--cci-fbar-pad-y) 0;
	text-align: center;
}

.cci-feature-bar__text {
	margin: 0;
	max-width: 100px;
	font-family: "Inter", sans-serif;
	font-weight: 700;
	font-size: 16px;
	line-height: 20px;
	letter-spacing: 1px;
	text-transform: uppercase;
	word-break: break-word;
	/* Gold shimmer gradient text. */
	background-image: linear-gradient(
		90deg,
		var(--cci-fbar-grad-start) 25%,
		var(--cci-fbar-grad-mid) 50%,
		var(--cci-fbar-grad-end) 100%
	);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: var(--cci-fbar-grad-mid); /* Fallback if background-clip:text is unsupported. */
}

/* Vertical divider — a thin blue line that fades to transparent at both ends,
   centred in the gap before each label. Which items show it is scoped per
   breakpoint below. */
.cci-feature-bar--dividers .cci-feature-bar__item::before {
	content: "";
	position: absolute;
	left: calc(var(--cci-fbar-gap) / -2);
	top: 50%;
	transform: translate(-50%, -50%);
	width: var(--cci-fbar-divider-thickness);
	height: var(--cci-fbar-divider-height);
	background-image: linear-gradient(
		180deg,
		transparent 0%,
		var(--cci-fbar-divider-color) 50%,
		transparent 100%
	);
}

/* Desktop / Tablet: one row — a vertical divider before every label except the
   first. */
@media (min-width: 768px) {
	.cci-feature-bar--dividers .cci-feature-bar__item:first-child::before {
		display: none;
	}
}

/* Mobile: 3-up grid. Vertical dividers between the labels in each row and a
   full-width horizontal divider between rows. */
@media (max-width: 767px) {
	.cci-feature-bar {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		column-gap: var(--cci-fbar-gap);
		row-gap: var(--cci-fbar-row-gap);
	}

	.cci-feature-bar__text {
		font-size: 14px;
	}

	/* No vertical line before the first label of each row. */
	.cci-feature-bar--dividers .cci-feature-bar__item:nth-child(3n + 1)::before {
		display: none;
	}

	/* Horizontal divider above each row from the second down. Drawn on the first
	   label of the row and stretched across the full row width (three columns +
	   two gaps) so it reads as one line for the whole row. */
	.cci-feature-bar--dividers .cci-feature-bar__item:nth-child(3n + 1):nth-child(n + 4)::after {
		content: "";
		position: absolute;
		top: calc(var(--cci-fbar-row-gap) / -2);
		left: 0;
		width: calc(300% + (2 * var(--cci-fbar-gap)));
		height: var(--cci-fbar-divider-thickness);
		transform: translateY(-50%);
		background-image: linear-gradient(
			90deg,
			transparent 0%,
			var(--cci-fbar-divider-color) 50%,
			transparent 100%
		);
	}
}
