/*
 * "Back to top" button (layouts/page.html, js/components/back_to_top.js).
 * Doc: doc/ui/back-to-top.md
 */

.lk-back-to-top {
  position: fixed;
  right: var(--lk-space-5);
  bottom: var(--lk-space-5);
  z-index: 1020;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--lk-color-rule);
  border-radius: 50%;
  background: var(--lk-color-surface);
  color: var(--lk-color-accent);
  font-size: 1.2rem;
  box-shadow: var(--lk-shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--lk-transition-fast), transform var(--lk-transition-fast),
              visibility 0s linear 120ms, background-color var(--lk-transition-fast), color var(--lk-transition-fast);
}

.lk-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.lk-back-to-top:hover {
  background: var(--lk-color-accent);
  border-color: var(--lk-color-accent);
  color: var(--lk-color-on-accent);
}

@media (max-width: 576px) {
  .lk-back-to-top {
    right: var(--lk-space-4);
    bottom: var(--lk-space-4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lk-back-to-top {
    transition: none;
  }
}

/* At the bottom of the page the button sits over the footer: keep its links clear */
.lk-footer-inner {
  padding-right: calc(44px + var(--lk-space-6));
}
