/* The round back-to-top button, bottom right of the window. */

.wow-back-to-top {
	position: fixed;
	inset-block-end: clamp(16px, 3vw, 40px);
	inset-inline-end: clamp(16px, 3vw, 40px);

	/* Above the page, below the admin bar (99999) and the cookie-style bars. */
	z-index: 100;
	display: grid;
	place-items: center;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wow-back-to-top-bg, var(--wp--custom--wow-accent, #326688));
	box-shadow: 0 2px 10px rgb(0 0 0 / 25%);
	color: #fff;
	cursor: pointer;

	/*
	 * Hidden until the script says otherwise. visibility, not just opacity:
	 * an invisible button that still catches the Tab key is worse than no
	 * button at all.
	 */
	visibility: hidden;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.wow-back-to-top.is-visible {
	visibility: visible;
	opacity: 1;
	transform: none;

	/* Appearing must not wait out the delay that hiding needs. */
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}

.wow-back-to-top:hover,
.wow-back-to-top:focus-visible {
	background: var(--wow-back-to-top-bg-hover, #3a4d5c);
}

.wow-back-to-top:focus-visible {
	outline: 2px solid currentcolor;
	outline-offset: 3px;
}

/*
 * The element the button hands focus to. The focus ring belongs to somebody
 * who navigated there; here it would just appear around the whole page after
 * a tap.
 */
.wow-back-to-top-target:focus {
	outline: none;
}

.wow-back-to-top__icon {
	display: block;
	pointer-events: none;
}

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

	.wow-back-to-top {
		transition: none;
		transform: none;
	}
}
