@use "../tokens" as *;

// Tooltip Position tiles (appendix B §5.3).
.ssw-tippos {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
	gap: 10px;
}

.ssw-tippos__item {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	border: 0;
	background: transparent;
	padding: 0;
	cursor: pointer;
	outline: none;
	min-width: 0;

	@include focus-visible;
}

.ssw-tippos__tile {
	position: relative;
	display: block;
	height: 96px;
	border-radius: $radius-menu;
	background: #fff;
	box-shadow: inset 0 0 0 1px $line-ring;
	transition: box-shadow 140ms ease, background 140ms ease;

	.ssw-tippos__item:hover & {
		box-shadow: inset 0 0 0 1px $faint;
	}

	.is-on > & {
		background: $tint;
		box-shadow: inset 0 0 0 1.5px $blue;
	}
}

.ssw-tippos__swatch {
	position: absolute;
	left: calc(50% - 14px);
	top: calc(50% - 14px);
	width: 28px;
	height: 28px;
	border-radius: 5px;
	background: #c3c4c7;
	transition: background 140ms ease;

	.is-on & {
		background: #72aee6;
	}
}

.ssw-tippos__bubble {
	position: absolute;
	width: 20px;
	height: 12px;
	border-radius: 3px;
	background: #fff;
	border: 1.5px solid $faint;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color 140ms ease;

	.is-on & {
		border-color: $blue;
	}
}

.ssw-tippos__line {
	width: 8px;
	height: 1.5px;
	border-radius: 1px;
	background: $faint;

	.is-on & {
		background: $blue;
	}
}

.ssw-tippos__arrow {
	position: absolute;
	width: 5px;
	height: 5px;
	background: #fff;
	border-style: solid;
	border-color: $faint;
	transform: translate(-50%, -50%) rotate(45deg);

	.is-on & {
		border-color: $blue;
	}
}

.ssw-tippos__label {
	font-size: 14px;
	font-weight: 400;
	color: $text;
	line-height: 1;
	text-align: center;

	.is-on & {
		color: $blue;
	}
}

/* Shape cards ------------------------------------------------------------------------------------ */

.ssw-shapes {
	display: flex;
	gap: 10px;
}

.ssw-shape {
	flex: 0 0 auto;
	border: 1px solid $line-card;
	border-radius: 6px;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color 150ms, box-shadow 150ms;

	@include focus-visible;

	&:hover {
		border-color: $blue;
	}

	&.is-on {
		border-color: $blue;
		background: $tint;
		box-shadow: 0 0 0 1px $blue;
	}
}

.ssw-shape__glyph {
	width: 26px;
	height: 26px;
	background: $faint-2;

	.is-on > & {
		background: $blue;
	}
}
