/* --------------------------------------------|
|                                              |
|  Component Back to top                       |
|                                              |
|-------------------------------------------- */

/* Black square bottom right like the old site; 48px = two lines. Fixed to the
   viewport (it sits at <body> level, outside every container column). The
   safe-area insets keep it clear of phone notches and home bars. */
.totop {
	position: fixed;
	right: calc(var(--spacing) * 6 + env(safe-area-inset-right, 0px));
	bottom: calc(var(--spacing) * 6 + env(safe-area-inset-bottom, 0px));
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	width: calc(var(--line) * 2);
	height: calc(var(--line) * 2);
	background-color: #000;
	color: #fff;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Context class sets only the size (component.icon.css owns the rest). */
.totop__icon {
	--icon-size: var(--line);
}

.totop:hover {
	opacity: 0.85;
}

.totop:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

/* With the script: hidden until scrolled (sabe_totop.js toggles .is-visible). */
.totop[data-totop-ready]:not(.is-visible) {
	opacity: 0;
	visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.totop { transition: none; }
}

@media print {
	.totop { display: none; }
}
