/* Examples grid for the font generator.
 *
 * The card height is fixed rather than content-driven. Each card swaps to its
 * real font file once it scrolls into view, and display faces vary wildly in
 * cap height and side bearings — letting the box follow the text would make the
 * whole grid jump as fonts land. Fixed height plus a clipped render area means
 * the upgrade is invisible, which is the point of lazy-loading them at all.
 */

.wfft-samples-count {
	font-weight: 400;
	opacity: 0.6;
}

.wfft-samples-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0.9rem 0 1.1rem;
}

.wfft-samples-tab {
	appearance: none;
	border: 1px solid var(--wfft-border, #d8dee6);
	background: var(--wfft-surface, #fff);
	color: inherit;
	border-radius: 999px;
	padding: 0.4rem 0.95rem;
	font: inherit;
	font-size: 0.9rem;
	line-height: 1.3;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.wfft-samples-tab:hover {
	border-color: var(--wfft-accent, #2f6feb);
}

.wfft-samples-tab.is-active {
	background: var(--wfft-accent, #2f6feb);
	border-color: var(--wfft-accent, #2f6feb);
	color: #fff;
}

.wfft-samples-tab:focus-visible {
	outline: 2px solid var(--wfft-accent, #2f6feb);
	outline-offset: 2px;
}

.wfft-samples-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.85rem;
	grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}

.wfft-samples-grid[hidden] {
	display: none;
}

.wfft-sample {
	margin: 0;
}

.wfft-sample-card {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
	min-height: 132px;
	padding: 0.85rem 0.9rem 0.7rem;
	border: 1px solid var(--wfft-border, #d8dee6);
	border-radius: 12px;
	background: var(--wfft-surface, #fff);
	color: inherit;
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.wfft-sample-card:hover,
.wfft-sample-card:focus-visible {
	border-color: var(--wfft-accent, #2f6feb);
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.09);
	transform: translateY(-1px);
	text-decoration: none;
}

.wfft-sample-card:focus-visible {
	outline: 2px solid var(--wfft-accent, #2f6feb);
	outline-offset: 2px;
}

/* The phrase. Clipped and centred so a wide display face cannot burst the card
 * or wrap to three lines once the real font arrives. */
.wfft-sample-render {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	overflow: hidden;
	min-height: 62px;
	font-size: clamp( 1.15rem, 1.6vw + 0.7rem, 1.7rem );
	line-height: 1.15;
	text-align: center;
	word-break: break-word;
	/* Until the real face loads the phrase shows in the fallback, so the card is
	 * readable and clickable from first paint rather than blank. */
	font-family: var(--wfft-fallback, system-ui, -apple-system, "Segoe UI", sans-serif);
}

.wfft-sample-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-top: 0.6rem;
	font-size: 0.78rem;
}

.wfft-sample-source {
	font-weight: 600;
	opacity: 0.85;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Match honesty, carried onto the most persuasive surface on the page. */
.wfft-sample-chip:not(:empty) {
	flex: 0 0 auto;
	padding: 0.1rem 0.45rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	background: #eef2f7;
	color: #44506a;
}

.wfft-sample-chip[data-match="exact"] {
	background: #e6f4ea;
	color: #1e6b34;
}

.wfft-sample-chip[data-match="replica"] {
	background: #fdf0e3;
	color: #8a5300;
}

.wfft-sample-chip[data-match="similar"] {
	background: #eaf0fb;
	color: #2f4f9e;
}

.wfft-samples-more {
	margin: 1.1rem 0 0;
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {
	.wfft-sample-card {
		transition: none;
	}

	.wfft-sample-card:hover,
	.wfft-sample-card:focus-visible {
		transform: none;
	}
}

/* --- String example chips (Unicode / bold text generator) ----------------
 *
 * Buttons, not cards: these carry no font and no destination, only words, so
 * they should read as a compact vocabulary list rather than competing with the
 * styled output below them.
 */

.wfft-chip-group + .wfft-chip-group {
	margin-top: 0.9rem;
}

.wfft-chip-label {
	margin: 0 0 0.4rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	opacity: 0.6;
}

.wfft-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.wfft-chips li {
	margin: 0;
}

.wfft-chip {
	appearance: none;
	border: 1px solid var(--wfft-border, #d8dee6);
	background: var(--wfft-surface, #fff);
	color: inherit;
	border-radius: 999px;
	padding: 0.35rem 0.8rem;
	font: inherit;
	font-size: 0.88rem;
	line-height: 1.3;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.wfft-chip:hover {
	border-color: var(--wfft-accent, #2f6feb);
	background: #f6f9ff;
}

.wfft-chip:focus-visible {
	outline: 2px solid var(--wfft-accent, #2f6feb);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.wfft-chip {
		transition: none;
	}
}
