/* Legacy #return-to-top; visibility follows its original scroll threshold. */

.back-to-top {
  position: fixed;
  z-index: 99999;
  bottom: 40px;
  left: 40px;
  display: flex;
  width: var(--back-to-top-size, 60px);
  height: var(--back-to-top-size, 60px);
  min-width: var(--wcag-target-preferred) !important;
  min-height: var(--wcag-target-preferred) !important;
  align-items: flex-start;
  justify-content: center;
  margin: 0;
  border: 0;
  border-radius: var(--back-to-top-radius, 0);
  padding: 0;
  background: var(--theme-back-to-top-background, var(--primary));
  color: var(--theme-back-to-top-copy, #fff);
  font: inherit;
  text-align: center;
  cursor: pointer;
  opacity: 1;
  transform: var(--back-to-top-transform, none);
  transition: all 0.3s ease;
}

.back-to-top::before {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-top: 20px;
  background: currentColor;
  mask: url("/assets/309adece4c025afe0eb0/components/back_to_top/assets/arrow.png") center / contain no-repeat;
  content: "";
  transform: rotate(180deg);
}

.back-to-top:hover {
  background: var(--theme-back-to-top-hover-background, var(--theme-back-to-top-background, var(--primary)));
  color: var(--theme-back-to-top-hover-copy, var(--theme-back-to-top-copy, #fff));
  opacity: var(--back-to-top-hover-opacity, .8);
}

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

/* The legacy iframe palette replaces default.css before the shared styles. */

:where(.output-mode--iframe) .back-to-top {
  background: var(--back-to-top-iframe-background, var(--theme-back-to-top-background, var(--primary)));
}

:where(.output-mode--iframe) .back-to-top:hover {
  background: var(--back-to-top-iframe-hover-background, var(--theme-back-to-top-hover-background, var(--theme-back-to-top-background, var(--primary))));
}

@media (max-width: 1400px) {
  .back-to-top {
    bottom: 90px;
  }
}

@media (max-width: 1020px) {
  .back-to-top {
    bottom: 70px;
    left: 20px;
    width: 40px;
    height: 40px;
  }

  .back-to-top::before {
    width: 12px;
    height: 12px;
    margin-top: 16px;
  }
}

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