/*
 * refresh/css/text-curve.css (ReInk)
 *
 * The Curve slider in the Text tab and the curve controls under it (refresh/js/text-curve.js). The
 * slider is the panel's own (facelift.css and premium.css paint every slider in it), laid out as the
 * Character spacing row above it, with the shape the text takes at each end and a tick at 0.
 */

/* The Curved Text tab: its controls live in the Text tab now. It stays in the page, hidden,
   because SMPdesigner.js finds a tab by its position. */
#tabs > ul > li.reinkHiddenTab {
	display: none !important;
}

.reinkHidden {
	display: none !important;
}

/* The slider row, laid out as the Character spacing row above it: its name, then the slider and Reset */
.reinkCurveRow {
	margin: 10px 0 6px;
}
/* inline, as Character spacing's words are: the row's "i" tip sits just after them (help-tips.js) */
.reinkCurveName {
	display: inline-block;
	font-weight: inherit;
	margin: 0;
}
.reinkCurveLine {
	display: flex;
	align-items: center;
	gap: 6px;
}
/* The slider, with a tick under its middle: 0, straight. The thumb's travel is the slider's width less the thumb,
   evenly at both ends, so its middle is the slider's. */
.reinkCurveScale {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
}
.reinkCurveScale > input[type="range"] {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
}
.reinkCurveScale::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 1px;
	width: 2px;
	height: 5px;
	margin-left: -1px;
	border-radius: 1px;
	background: rgb(145 148 155);
	pointer-events: none;
}
/* The ends: an arc the shape the text takes that way */
.reinkCurveEnd {
	display: inline-flex;
	flex: 0 0 auto;
	color: var(--sm-ink-4, rgb(100 107 120));
}
.reinkCurveRow:has(input:disabled) .reinkCurveEnd {
	opacity: 0.45;
}
.reinkCurveLine > .mui-btn {
	flex: 0 0 auto;
	margin: 0;
}
/* Reset: the same outlined secondary as Character spacing's Reset (premium.css styles that one by its id) */
#reinkCurveReset.mui-btn--primary,
#reinkCurveReset.mui-btn--primary:focus {
	background-color: var(--sp-surface, rgb(255 255 255));
	color: var(--sp-ink-2, rgb(24 26 31));
	border-image: var(--sp-bi-line-gap) 8 / 8px / 0 stretch;
}
#reinkCurveReset.mui-btn--primary:hover {
	background-color: var(--sp-fill-hover, rgb(241 242 245));
	color: var(--sp-ink, rgb(4 0 0));
	border-image: var(--sp-bi-line-gap-hover) 8 / 8px / 0 stretch;
}
#reinkCurveReset.mui-btn--primary:active {
	background-color: var(--sp-fill-press, rgb(229 231 235));
}
#reinkCurveReset.mui-btn--primary:focus-visible {
	outline: none;
	border-image: var(--sp-bi-line-gap-focus) 8 / 8px / 0 stretch;
}
#reinkCurveReset.mui-btn--primary:disabled {
	background-color: var(--sp-surface, rgb(255 255 255));
	color: var(--sp-ink-4, rgb(100 107 120));
}
#reinkCurveReset .mui-ripple {
	background-color: rgb(16 24 40 / 0.2);
}
#reinkCurveReset .mui-btn__ripple-container {
	clip-path: inset(2px round 6px);
}
.reinkCurveHint {
	display: block;
	font-size: 12px;
	color: rgb(0 0 0 / 0.6);
}
.reinkCurveHint:empty {
	display: none;
}

/* Everything the old Curved Text tab had, under the slider: Sterling's own network only, behind the gate
   (curve-panel.css gives the opened tools the bar down their side) */
.reinkCurvePanel {
	margin: 0 0 12px;
	padding: 0;
}
.reinkCurvePanel > div {
	margin-bottom: 8px;
}
.reinkCurveWords {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.reinkCurveWords label {
	font-weight: 600;
}
.reinkCurveWords input {
	width: 100%;
	box-sizing: border-box;
}

/* The words, above the letter spacing and the Curve slider, for straight text and curves alike: the straight box
   matches the panel's text fields (facelift.css paints them; a <textarea> is not among them) */
.reinkTextWords {
	margin: 10px 0 8px;
	flex-shrink: 0; /* the Text tab's column would squeeze it, and the box with it, to one line */
}
/* One line high, as the curve's own box is, so nothing below moves when the text curves or straightens; it grows with
   the lines of a text box that has several (text-curve.js) */
.reinkTextWords .reinkTextBox,
.reinkTextWords #curvedTextBox {
	box-sizing: border-box;
	min-height: 30px;
	line-height: 20px;
}
.reinkTextWords #curvedTextBox {
	height: 30px;
}
.reinkTextWords .reinkTextBox {
	display: block;
	flex-shrink: 0;
	width: 100%;
	height: 30px;
	padding: 4px 4px 4px 4px;
	overflow: hidden;
	resize: none;
	font: inherit;
	border: 1px solid var(--sm-border, rgb(203 207 214));
	border-image: var(--sm-bi-field) 6 / 6px / 0 stretch;
	background-color: var(--sm-surface, rgb(255 255 255));
	color: var(--sm-ink-2, rgb(24 26 31));
}
.reinkTextWords .reinkTextBox:hover:not(:disabled) {
	border-color: var(--sm-border-strong, rgb(160 166 176));
	border-image: var(--sm-bi-field-hover) 6 / 6px / 0 stretch;
}
.reinkTextWords .reinkTextBox:focus {
	border: 1px solid var(--sm-red, rgb(218 26 50));
	border-image: var(--sm-bi-field-focus) 6 / 6px / 0 stretch;
	outline: none;
}
.reinkTextWords .reinkTextBox:disabled {
	background-color: var(--sm-fill-2, rgb(246 247 249));
	color: var(--sm-ink-4, rgb(100 107 120));
	cursor: default;
}
.reinkTextWords .reinkTextBox::placeholder {
	color: var(--sm-ink-4, rgb(100 107 120));
}

/* "Editing curved text": a small tag above a curve being edited on the canvas, straight while its words are typed
   (refresh/js/curve-canvas.js places it in the canvas's box, so it moves and zooms with the design). In the
   selection's red, like a label on the box it marks; it takes no clicks. */
.reinkCurveEditingTag {
	position: absolute;
	z-index: 5;
	padding: 2px 7px;
	border-radius: 4px;
	background-color: var(--sm-red, rgb(234 0 41));
	color: rgb(255 255 255);
	font: 600 11px/16px Arial, Helvetica, sans-serif;
	white-space: nowrap;
	box-shadow: 0 1px 2px rgb(4 0 0 / 0.25);
	pointer-events: none;
	user-select: none;
}
.reinkCurveEditingTag[hidden] {
	display: none;
}

@media (forced-colors: active) {
	.reinkCurveEditingTag {
		border: 1px solid CanvasText;
	}
	.reinkTextWords .reinkTextBox:focus {
		outline: 2px solid CanvasText;
		outline-offset: -2px;
	}
}

@media (forced-colors: active) {
	.reinkCurveScale::after {
		background: CanvasText;
	}
	.reinkCurveEnd {
		color: CanvasText;
	}
}
