@use "tokens" as *;

// Everything the 2.0 admin renders lives under .ssw-admin. WordPress admin styles (forms.css,
// common.css) style bare buttons, inputs and selects; neutralise them inside the scope.
.ssw-admin {
	font-family: $font;
	font-size: 14px;
	line-height: 1.5;
	color: $ink-2;
	-webkit-font-smoothing: antialiased;

	*,
	*::before,
	*::after {
		box-sizing: border-box;
	}

	// Resets use :where() (zero specificity) so every component class wins over them, while still
	// beating WordPress admin's bare-element styles that load earlier.
	:where(button, input, select, textarea) {
		font-family: inherit;
		font-size: inherit;
		line-height: inherit;
		margin: 0;
	}

	:where(button) {
		background: none;
		border: 0;
		padding: 0;
		color: inherit;
		cursor: pointer;
		min-height: 0;
	}

	:where(input[type="text"], input[type="number"], input[type="search"], textarea) {
		box-shadow: none;
		border-radius: $radius-control;
		min-height: 0;
	}

	:where(input[type="text"], input[type="number"], input[type="search"], textarea):focus {
		box-shadow: none;
		outline: none;
	}

	:where(a) {
		color: $blue;
		text-decoration: none;
	}

	:where(a):hover {
		color: $blue-2;
	}

	svg {
		display: block;
		flex-shrink: 0;
	}

	.ssw-visually-hidden {
		position: absolute !important;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

@media (prefers-reduced-motion: reduce) {

	.ssw-admin *,
	.ssw-admin *::before,
	.ssw-admin *::after {
		transition: none !important;
		animation: none !important;
	}
}
