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

Adapted from an article on CodyHouse (https://codyhouse.co/?p=258)

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

*, *:after, *:before {
  box-sizing: border-box;
}

.cd-container {
  /* this class is used to give a max-width to the element it is applied to, and center it horizontally when it reaches that max-width */
  width: 90%;
  max-width: 1170px;
  margin-top: 30px;
}
.cd-container:after {
  content: "";
  display: table;
  clear: both;
}

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

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

Main components 

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

.cd-product {
  text-align: center;
}

.cd-product-wrapper {
  position: relative;
  margin: 0 auto 3em;
  width: 100%;
  max-width: 450px;
  
}

.cd-product-description {
  font-weight: bold;
  font-family: 'Roboto Mono';
  color: #aaaaaa;
  text-align: left;
  font-size: 30px;    
  line-height: 1.3;
  white-space: nowrap;
}

.cd-product-wrapper  li {
	list-style: none outside none;
}

.cd-single-point {
  position: absolute;
  border-radius: 50%;
}
.cd-single-point > a {
  position: relative;
  z-index: 2;
  display: block;
  width: 30px;
  height: 30px;
  border-radius: inherit;
  background: #d95353;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: background-color 0.2s;
}
.cd-single-point > a::after, .cd-single-point > a:before {
  /* rotating plus icon */
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  bottom: auto;
  right: auto;
  transform: translateX(-50%) translateY(-50%);
  background-color: #ffffff;
  transition-property: transform;
  transition-duration: 0.2s;
}
.cd-single-point > a::after {
  height: 2px;
  width: 12px;
}
.cd-single-point > a::before {
  height: 12px;
  width: 2px;
}
.cd-single-point::after {
  /* this is used to create the pulse animation */
  content: '';
  position: absolute;
  z-index: 1;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: inherit;
  background-color: transparent;
  animation: cd-pulse 2s infinite;
}

.cd-single-point.is-open > a {
  background-color: #999999;
}
.cd-single-point.is-open > a::after, .cd-single-point.is-open > a::before {
  transform: translateX(-50%) translateY(-50%) rotate(135deg);
}
.cd-single-point.is-open::after {
  /* remove pulse effect */
  display: none;
}
.cd-single-point.is-open .cd-more-info {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s 0s, visibility 0s 0s, transform 0.3s 0s, top 0.3s 0s, bottom 0.3s 0s, left 0.3s 0s, right 0.3s 0s;
}
.cd-single-point.visited > a {
  background-color: #aaa;
  box-shadow: none;
  opacity: 0.8;
}
.cd-single-point.visited::after {
  /* pulse effect no more active on visited elements */
  display: none;
}
@media only screen and (min-width: 737px) {
  .cd-single-point.is-open .cd-more-info.cd-left {
    right: 140%;
  }
  .cd-single-point.is-open .cd-more-info.cd-right {
    left: 140%;
  }
  .cd-single-point.is-open .cd-more-info.cd-top {
    bottom: 140%;
  }
  .cd-single-point.is-open .cd-more-info.cd-bottom {
    top: 140%;
  }
}

@-webkit-keyframes cd-pulse {
  0% {
    -webkit-transform: scale(1);
    box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0.8);
  }
  50% {
    box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0.8);
  }
  100% {
    -webkit-transform: scale(1.6);
    box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0);
  }
}
@-moz-keyframes cd-pulse {
  0% {
    -moz-transform: scale(1);
    box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0.8);
  }
  50% {
    box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0.8);
  }
  100% {
    -moz-transform: scale(1.6);
    box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0);
  }
}
@keyframes cd-pulse {
  0% {
    transform: scale(1);
    box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0.8);
  }
  50% {
    box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0.8);
  }
  100% {
    transform: scale(1.6);
    box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0);
  }
}

.cd-single-point .cd-more-info {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: left;
  line-height: 1.5;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 3em 1em 1em;
  visibility: hidden;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s 0s, visibility 0s 0.3s, transform 0.3s 0s, top 0.3s 0s, bottom 0.3s 0s, left 0.3s 0s, right 0.3s 0s;
}
.cd-single-point .cd-more-info::before {
  /* triangle next to the interest point description - hidden on mobile */
  content: '';
  position: absolute;
  height: 0;
  width: 0;
  display: none;
  border: 8px solid transparent;
}
.cd-single-point .cd-more-info h2 {
  font-size: 22px;
  font-size: 1.375rem;
  margin-bottom: .6em;
}
@media only screen and (min-width: 737px) {
  .cd-single-point .cd-more-info {
    position: absolute;
    width: 220px;
    height: inherit/* 240px */;
    /* padding: 1em; */
    overflow-y: visible;
    line-height: 1.4;
    border-radius: 0.25em;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  }
  .cd-single-point .cd-more-info::before {
    display: block;
  }
  .cd-single-point .cd-more-info.cd-left, .cd-single-point .cd-more-info.cd-right {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
  .cd-single-point .cd-more-info.cd-left::before, .cd-single-point .cd-more-info.cd-right::before {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
  .cd-single-point .cd-more-info.cd-left {
    right: 160%;
    left: auto;
  }
  .cd-single-point .cd-more-info.cd-left::before {
    border-left-color: rgba(255, 255, 255, 0.95);
    left: 100%;
  }
  .cd-single-point .cd-more-info.cd-right {
    left: 160%;
  }
  .cd-single-point .cd-more-info.cd-right::before {
    border-right-color: rgba(255, 255, 255, 0.95);
    right: 100%;
  }
  .cd-single-point .cd-more-info.cd-top, .cd-single-point .cd-more-info.cd-bottom {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  .cd-single-point .cd-more-info.cd-top::before, .cd-single-point .cd-more-info.cd-bottom::before {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  .cd-single-point .cd-more-info.cd-top {
    bottom: 160%;
    top: auto;
  }
  .cd-single-point .cd-more-info.cd-top::before {
    border-top-color: rgba(255, 255, 255, 0.95);
    top: 100%;
  }
  .cd-single-point .cd-more-info.cd-bottom {
    top: 160%;
  }
  .cd-single-point .cd-more-info.cd-bottom::before {
    border-bottom-color: rgba(255, 255, 255, 0.95);
    bottom: 100%;
  }
  .cd-single-point .cd-more-info h2 {
    margin-bottom: 0;
  }

}

/* close the interest point description - only on mobile */
.cd-close-info {
  position: fixed;
  top: 0;
  right: 0;
  height: 44px;
  width: 44px;
}
.cd-close-info::after, .cd-close-info:before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  bottom: auto;
  right: auto;
  transform: translateX(-50%) translateY(-50%) rotate(45deg);
  background-color: #999999;
  transition-property: transform;
  transition-duration: 0.2s;
}
.cd-close-info::after {
  height: 2px;
  width: 16px;
}
.cd-close-info::before {
  height: 16px;
  width: 2px;
}
@media only screen and (min-width: 737px) {
  .cd-close-info {
    display: none;
  }
}
