/*!
 * CSS Portal — Text gradient generator extras
 * Loaded after code-tool.css and generator-tool.css. Everything is scoped to .gt.
 */

/* ---------- Colour-stop editor (settings panel) ---------- */

.gt .tg-bar {
	position: relative;
	height: 22px;
	margin: 2px 0 14px;
	border-radius: 6px;
	box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .15);
}
.gt .tg-bar i {
	position: absolute;
	top: 100%;
	width: 10px;
	height: 10px;
	margin: 2px 0 0 -5px;
	border: 2px solid var(--ct-bg);
	border-radius: 50%;
	box-shadow: 0 0 0 1px var(--ct-border-strong);
}
.gt .tg-stops { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gt .tg-stop {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 8px;
	background: var(--ct-bg);
	border: 1px solid var(--ct-border);
	border-radius: 8px;
}
.gt .tg-stop__row { display: flex; align-items: center; gap: 6px; }
.gt .tg-stop .gt-color { flex: 1; min-width: 0; }
.gt .tg-stop .gt-num { flex: none; width: 74px; }
.gt .tg-del {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 30px;
	height: 30px;
	margin: 0;
	padding: 0;
	font-size: 15px;
	color: var(--ct-muted);
	background: transparent;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}
.gt .tg-del:hover { color: var(--ct-err); background: var(--ct-surface-2); }
.gt .tg-del:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ct-accent); }
.gt .tg-del:disabled { opacity: .3; pointer-events: none; }
.gt .tg-stops__foot { margin-top: 10px; }

/* ---------- Presets card ---------- */

.gt .tg-presets {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
	gap: 10px;
	padding: 14px;
}
.gt .tg-preset {
	display: flex;
	flex-direction: column;
	gap: 0;
	min-width: 0;
	margin: 0;
	padding: 0;
	font: inherit;
	color: var(--ct-text);
	background: var(--ct-bg);
	border: 1px solid var(--ct-border);
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	transition: border-color .15s, transform .15s;
}
.gt .tg-preset__stage {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 84px;
	padding: 0;
	overflow: hidden;
}
.gt .tg-preset__text { display: block; padding: 0; font: 900 38px/1.1 system-ui, sans-serif; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.gt .tg-preset__name {
	display: block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 7px 8px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	text-align: center;
	border-top: 1px solid var(--ct-border);
}
.gt .tg-preset:hover { border-color: var(--ct-border-strong); transform: translateY(-1px); }
.gt .tg-preset:focus-visible { outline: none; border-color: var(--ct-accent); box-shadow: 0 0 0 3px var(--ct-accent-soft); }
.gt .tg-preset.is-active { border-color: var(--ct-accent); box-shadow: 0 0 0 1px var(--ct-accent); }

@media (prefers-reduced-motion: reduce) {
	.gt .tg-preset { transition: none; }
}

/* text-gradient output is short; a smaller code panel keeps the presets in view */
.gt [data-gt="code"].ce { height: clamp(200px, 26vh, 300px); }
