/* "Nazad na vrh" button (inc/back-to-top.php). */
.msjoker-back-to-top {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 900;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	background: #18202e;
	color: #fff;
	box-shadow: 0 6px 20px rgba(24, 32, 46, 0.3);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(0.9);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s, background-color 0.2s ease;
}

.msjoker-back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s, background-color 0.2s ease;
}

.msjoker-back-to-top:hover,
.msjoker-back-to-top:focus-visible {
	background: #f37a1f;
	color: #fff;
}

.msjoker-back-to-top:focus-visible {
	outline: 2px solid #f37a1f;
	outline-offset: 3px;
}

.msjoker-back-to-top:active {
	transform: scale(0.94);
}

.msjoker-back-to-top-arrow {
	position: relative;
	transition: transform 0.2s ease;
}

.msjoker-back-to-top:hover .msjoker-back-to-top-arrow {
	transform: translateY(-2px);
}

/* Square frame along the button's edge that fills (clockwise from the top
   left corner) as the page is scrolled. */
.msjoker-back-to-top-ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.msjoker-back-to-top-track,
.msjoker-back-to-top-progress {
	fill: none;
	stroke-width: 3;
}

.msjoker-back-to-top-track {
	stroke: rgba(255, 255, 255, 0.15);
}

.msjoker-back-to-top-progress {
	stroke: #f37a1f;
	stroke-linecap: butt;
	stroke-dasharray: 100;
	stroke-dashoffset: var(--msjoker-scroll-offset, 100);
	transition: stroke-dashoffset 0.1s linear;
}

.msjoker-back-to-top:hover .msjoker-back-to-top-progress,
.msjoker-back-to-top:focus-visible .msjoker-back-to-top-progress {
	stroke: #fff;
}

/* Out of the way while a full-screen layer is open. */
html.stihl-lightbox-open .msjoker-back-to-top,
body.mobile-menu-open .msjoker-back-to-top {
	opacity: 0;
	visibility: hidden;
}

@media (max-width: 768px) {
	.msjoker-back-to-top {
		right: max(16px, env(safe-area-inset-right));
		bottom: max(16px, env(safe-area-inset-bottom));
		width: 40px;
		height: 40px;
	}
}

@media print {
	.msjoker-back-to-top {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.msjoker-back-to-top,
	.msjoker-back-to-top.is-visible,
	.msjoker-back-to-top-arrow,
	.msjoker-back-to-top-progress {
		transition: none;
	}
}
