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

Adapted from an article on CodyHouse (https://codyhouse.co/gem/vertical-fixed-navigation/)

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


.cd-img-replace {
  /* replace text with a background-image */
  display: inline-block;
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
}


/* No Touch devices */
.cd-nav-trigger {
  display: none;
}

.no-touch #cd-vertical-nav {
  position: fixed;
  right: 40px;
  top: 48%;
  bottom: auto;
  transform: translateY(-48%);
  z-index: 1;
}
.no-touch #cd-vertical-nav ul {
    list-style: none;
}
.no-touch #cd-vertical-nav li {
  text-align: right;
  margin-bottom: 0rem;
}
.no-touch #cd-vertical-nav a {
}
.no-touch #cd-vertical-nav a:after {
  content: "";
  display: table;
  clear: both;
}
.no-touch #cd-vertical-nav a span {
  float: right;
  display: inline-block;
  transform: scale(0.6);
}
.no-touch #cd-vertical-nav a:hover span.cd-dot {
  transform: scale(1);
}
.no-touch #cd-vertical-nav a:hover .cd-label {
  opacity: 1;
}
.no-touch #cd-vertical-nav a.is-selected .cd-dot {
  background-color: #33C3F0;
}
.no-touch #cd-vertical-nav a.is-selected .cd-label {
  color: #33C3F0;
}

.no-touch #cd-vertical-nav .cd-dot {
  height: 20px;
  width: 20px;
  margin-top: 7px;
  background-color: #ccc;
  transition: transform 0.2s, background-color 0.5s;
}

.make-it-opaque {
    opacity: 0;
}

.no-touch #cd-vertical-nav .cd-label {
  margin-right: 10px;
  color: #aaa;
  transform-origin: 100% 50%;
  font-size: 24px;
  transition: opacity 0.2s;
  background-color: white;
}

/* Touch devices */
.touch .cd-nav-trigger {
  display: block;
  z-index: 5;
  position: fixed;
  bottom: 30px;
  right: 6%;
  height: 44px;
  width: 44px;
  border-radius: 0.25em;
  background: rgba(125, 125, 125, 0.9);
}
.touch .cd-nav-trigger span {
  position: absolute;
  height: 4px;
  width: 4px;
  background-color: white/* #3e3947 */;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  bottom: auto;
  right: auto;
  transform: translateX(-50%) translateY(-50%);
}
.touch .cd-nav-trigger span::before, .touch .cd-nav-trigger span::after {
  content: '';
  height: 100%;
  width: 100%;
  position: absolute;
  left: 0;
  background-color: white;
  border-radius: inherit;
}
.touch .cd-nav-trigger span::before {
  top: -9px;
}
.touch .cd-nav-trigger span::after {
  bottom: -9px;
}

.touch #cd-vertical-nav {
  position: fixed;
  z-index: 3;
  right: 5%;
  bottom: 30px;
  width: 90%;
  max-width: 400px;
  max-height: 90%;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  transform-origin: right bottom;
  transform: scale(0);
  transition-property: transform;
  transition-duration: 0.2s;
  border-radius: 0.25em;
  background-color: #898989;
}
.touch #cd-vertical-nav ul {
list-style: none;
}
.touch #cd-vertical-nav a {
  display: block;
  padding: 1em;
  border-bottom: 1px solid rgba(62, 57, 71, 0.1);
  color: white;
  text-decoration: none;
}
.touch #cd-vertical-nav a span:first-child {
  display: none;
}
.touch #cd-vertical-nav a.is-selected span:last-child {
  color: #33C3F0;
}
.touch #cd-vertical-nav.open {
  transform: scale(1);
}
.touch #cd-vertical-nav.open + .cd-nav-trigger {
  background-color: transparent;
}
.touch #cd-vertical-nav.open + .cd-nav-trigger span {
  background-color: rgba(62, 57, 71, 0);
}
.touch #cd-vertical-nav.open + .cd-nav-trigger span::before, .touch #cd-vertical-nav.open + .cd-nav-trigger span::after {
  background-color: white;
  height: 3px;
  width: 20px;
  border-radius: 0;
  left: -8px;
}
.touch #cd-vertical-nav.open + .cd-nav-trigger span::before {
  transform: rotate(45deg);
  top: 1px;
}
.touch #cd-vertical-nav.open + .cd-nav-trigger span::after {
  transform: rotate(135deg);
  bottom: 0;
}
.touch #cd-vertical-nav li:last-child a {
  border-bottom: none;
}

/* we hide this on desktop, but should always be visible on touch & mobile */
.touch #cd-vertical-nav a .cd-label {
    opacity: 1;
}

@media only screen and (min-width: 768px) {
  .touch .cd-nav-trigger, .touch #cd-vertical-nav {
    bottom: 40px;
  }
}