sh-pagination {
	/* Buttons */

	&::part(button) {
		box-sizing: border-box;
		min-inline-size: 2.5rem;
		min-block-size: 2.5rem;
		font-weight: 600;
		color: var(--sh-color-neutral-0);
		background-color: var(--sh-color-neutral-100);
		border: 2px solid var(--sh-color-neutral-0);
	}

	&::part(button):hover {
		background-color: var(--sh-color-neutral-80);
	}

	&::part(button):active {
		box-shadow: 1px 1px 0 0 var(--sh-color-neutral-0);
		translate: 1px 1px;
	}

	&::part(button):focus-visible {
		outline: var(--sh-focus-outline);
		outline-offset: var(--sh-focus-outline-offset);
		box-shadow: 1px 1px 0 0 var(--sh-color-neutral-0);
	}

	/* Current page */

	&::part(button-current) {
		color: var(--sh-color-neutral-100);
		background-color: var(--sh-color-neutral-30);
	}

	&::part(button-current):hover {
		background-color: var(--sh-color-neutral-20);
	}

	/* Jump buttons */

	&::part(button-jump-forward),
	&::part(button-jump-backward) {
		min-inline-size: 2rem;
		border-color: transparent;
	}

	&::part(button-jump-forward):active,
	&::part(button-jump-backward):active {
		box-shadow: none;
	}

	/* Disabled controls (button[disabled] and a[aria-disabled]) */

	&::part(button-disabled) {
		pointer-events: none;
		border-color: var(--sh-color-neutral-60);
		opacity: 0.5;
	}

	/* Compact range */

	&::part(range) {
		min-block-size: 2.5rem;
		padding-inline: var(--sh-space-sm);
		font-weight: 600;
	}

	&:state(disabled)::part(range) {
		opacity: 0.5;
	}
}

/* Forced colors: the current page is told apart from the others only by inverting `color` and
 * `background-color`, and forced-colors mode replaces both with the user's palette. Measured against
 * the built theme, the current button and a plain one rendered the identical pair — `rgb(0, 0, 0)` on
 * `rgb(255, 255, 255)` both — leaving "which page am I on" visible to `aria-current` and to nobody
 * else. System colors *are* honoured in that mode, so `Highlight`/`HighlightText` restores the
 * distinction without `forced-color-adjust: none`, which would opt out of the user's palette
 * entirely. Disabled controls need nothing here: they are told apart by `opacity`, which the mode
 * does not replace (measured `0.5` under `forcedColors: "active"`). */

@media (forced-colors: active) {
	sh-pagination::part(button-current) {
		color: HighlightText;
		background-color: Highlight;
	}
}

/* Motion */

@media (prefers-reduced-motion: no-preference) {
	sh-pagination::part(button) {
		transition:
			background-color 100ms ease,
			translate 50ms ease-in-out,
			box-shadow 50ms ease-in-out;
	}
}
