/*
 * VAIDIKX — trending topics.
 *
 * A quiet label and a row of pills. Nothing here paints a background, a shadow or a
 * gradient of its own: the pills are hairline outlines over the page ground, so the
 * material behind them is the same material behind everything else.
 *
 * The restraint is the design. Six coloured chips would read as a filter bar in an
 * application; six outlined ones read as the contents page of a magazine.
 */

.mh-topics {
	padding-block: clamp( 1.5rem, 3vw, 2.5rem );
}

.mh-topics__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var( --mh-space-sm ) var( --mh-space-md );
}

.mh-topics__label {
	flex: 0 0 auto;
	font-family: var( --mh-font-ui );
	font-size: var( --mh-size-meta );
	font-weight: 600;
	letter-spacing: var( --mh-track-meta );
	text-transform: uppercase;
	color: var( --mh-color-faint );
}

/*
 * A hairline rule between the label and the pills, drawn only where there is room for
 * it. It is the one piece of structure in the component, and it is what makes the label
 * read as a heading for the row rather than as the first item in it.
 */
@media ( min-width: 720px ) {
	.mh-topics__label {
		display: flex;
		align-items: center;
		gap: var( --mh-space-md );
	}

	.mh-topics__label::after {
		content: '';
		width: clamp( 24px, 4vw, 64px );
		height: 1px;
		background: var( --mh-color-rule );
	}
}

.mh-topics__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.mh-topics__pill {
	display: inline-block;
	padding: 0.5em 1.05em;
	border: 1px solid var( --mh-color-border );
	border-radius: var( --mh-radius-pill );

	font-family: var( --mh-font-ui );
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	white-space: nowrap;

	/*
	 * Beige, not the accent. The accent is spent on the one thing the page actually
	 * wants a reader to do; a row of six blue pills would spend it on navigation and
	 * leave nothing to distinguish the call to action further down.
	 */
	color: var( --mh-color-beige );

	transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

/*
 * Hover fills rather than glows: a one-step lift in the surface underneath and the rule
 * brightening to match. The same gesture every other interactive surface in the system
 * makes, so the page behaves consistently rather than decoratively.
 */
.mh-topics__pill:hover {
	background: var( --mh-surface-raised );
	border-color: var( --mh-color-rule );
	color: var( --mh-color-heading );
}

.mh-topics__pill:focus-visible {
	outline: 2px solid var( --mh-color-accent-text );
	outline-offset: 2px;
}

/* --- Narrow screens --------------------------------------------------------- */

/*
 * The label moves above the row rather than beside it, and the pills wrap. Two lines of
 * component at 390px is the right trade against a horizontally scrolling rail, which
 * hides half its own contents and is the easiest way there is to leak page overflow.
 */
@media ( max-width: 719px ) {
	.mh-topics__inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
	}

	.mh-topics__pill {
		padding: 0.45em 0.9em;
		font-size: 0.6875rem;
	}
}
