/* -------------------------------- 

File#: _1_back-to-top
Title: Back to top
Descr: Component that triggers scroll-y to the top of the page
Usage: codyhouse.co/license

-------------------------------- */

/* -------------------------------- 

Icons 

-------------------------------- */

.cd-icon {
  --size: 1em;
  font-size: var(--size);
  height: 1em;
  width: 1em;
  display: inline-block;
  color: inherit;
  fill: currentColor;
  line-height: 1;
  flex-shrink: 0;
  max-width: initial;
}

.cd-icon use { /* SVG symbols - enable icon color corrections */
  color: inherit;
  fill: currentColor;
}

/* -------------------------------- 

Component 

-------------------------------- */

.back-to-top {
  --size: 50px;
  width: var(--size);
  height: var(--size);
  display: flex;
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  z-index: 10000;
  border-radius: 50%;
  background-color: hsla(230, 13%, 9%, 0.9);
  visibility: hidden;
  opacity: 0;
  transition: 0.2s;
}

.back-to-top:hover {
  background-color: hsl(230, 13%, 9%);
}

.back-to-top .cd-icon {
  --size: 20px;
  display: block;
  margin: auto;
  color: hsl(0, 0%, 100%);
}

.back-to-top--is-visible {
  visibility: visible;
  opacity: 1;
}