/**
 * Fixed “back to top” control — bottom-right, sitewide.
 */

.homestead-back-to-top {
	position: fixed;
	right: max(1rem, env(safe-area-inset-right, 0px));
	bottom: max(1rem, env(safe-area-inset-bottom, 0px));
	z-index: 40;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background-color: var(--homestead-cta-bg, #6f7566);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 2px 10px rgb(0 0 0 / 18%);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(0.5rem);
	transition:
		opacity 0.2s ease,
		visibility 0.2s ease,
		transform 0.2s ease,
		background-color 0.15s ease;
}

.homestead-back-to-top.is-visible {
	opacity: 0.65;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.homestead-back-to-top:hover,
.homestead-back-to-top:focus-visible {
	opacity: 1;
	background-color: var(--homestead-cta-bg-hover, #5a6454);
}

.homestead-back-to-top:focus-visible {
	outline: 2px solid var(--homestead-cta-bg-hover, #5a6454);
	outline-offset: 3px;
}

.homestead-back-to-top__icon {
	display: block;
	width: 1.25rem;
	height: 1.25rem;
	flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
	.homestead-back-to-top {
		transition: none;
		transform: none;
	}
}
