/** A quiet return to the page beginning, shared by all RCAK websites. */
.back-to-top {
  position: fixed;
  z-index: 50;
  inset-block-end: calc(20px + env(safe-area-inset-bottom, 0px));
  inset-inline-end: calc(20px + env(safe-area-inset-right, 0px));
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  color: var(--color-text-primary-medium);
  background-color: var(--color-surface);
  box-shadow: 0 2px 8px rgb(0 0 0 / 12%);
  cursor: pointer;
  appearance: none;
  touch-action: manipulation;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.back-to-top[hidden] {
  display: none;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  border-color: currentColor;
  background-color: var(--color-surface-soft);
  box-shadow: 0 3px 10px rgb(0 0 0 / 18%);
}

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

.back-to-top svg {
  pointer-events: none;
}

body.is-overlay-active .back-to-top {
  visibility: hidden;
  pointer-events: none;
}

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

@media (forced-colors: active) {
  .back-to-top {
    border-color: ButtonText;
    color: ButtonText;
    background-color: Canvas;
    box-shadow: none;
  }
}

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