/* ==============
  Timeline
===================*/

.cd-container {
  width: 90%;
  max-width: 1170px;
  margin: 0 auto;
}
.cd-container::after {
  content: '';
  display: table;
  clear: both;
}
#cd-timeline {
  margin-bottom: 2em;
  margin-top: 2em;
  padding: 2em 0;
  position: relative;
  &::before {
    border-left: 3px solid $light;
    content: '';
    height: 100%;
    left: 18px;
    position: absolute;
    top: 0;
    width: 3px;
  }
}
@media only screen and (min-width: 1170px) {
  #cd-timeline {
    margin-bottom: 3em;
    margin-top: 3em;
    &::before {
      left: 50%;
      margin-left: -2px;
    }
  }
}

.cd-timeline-block {
  margin: 2em 0;
  position: relative;
  &:after {
    clear: both;
    content: "";
    display: table;
  }
}
.cd-timeline-block:first-child {
  margin-top: 0;
}
.cd-timeline-block:last-child {
  margin-bottom: 0;
}
@media only screen and (min-width: 1170px) {
  .cd-timeline-block {
    margin: 4em 0;
  }
  .cd-timeline-block:first-child {
    margin-top: 0;
  }
  .cd-timeline-block:last-child {
    margin-bottom: 0;
  }
}
.cd-timeline-img {
  position: absolute;
  top: 20px;
  left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-align: center;
  line-height: 30px;
  font-size: 20px;
  color: $white;
  background-color: $primary;
  border: 5px solid $white;

  i {
    margin-left: 1px;
  }
}
@media only screen and (min-width: 1170px) {
  .cd-timeline-img {
    width: 40px;
    height: 40px;
    line-height: 30px;
    left: 50%;
    margin-left: -20px;
    -webkit-transform: translateZ(0);
    -webkit-backface-visibility: hidden;
  }
  .cssanimations .cd-timeline-img.is-hidden {
    visibility: hidden;
  }
  .cssanimations .cd-timeline-img.bounce-in {
    visibility: visible;
    -webkit-animation: cd-bounce-1 0.6s;
    -moz-animation: cd-bounce-1 0.6s;
    animation: cd-bounce-1 0.6s;
  }
}

.cd-timeline-content {
  border-radius: 5px;
  border: 1px solid $light;
  margin-left: 60px;
  padding: 1em;
  position: relative;

  &:after {
    clear: both;
    content: "";
    display: table;
  }
  h2 {
    margin-top: 0;
  }
  .cd-read-more {
    background: $primary;
    border-radius: 0.25em;
    color: white;
    float: right;
    font-size: 14px;
    padding: .8em 1em;
  }
  .cd-date {
    display: inline-block;
    font-size: 14px;
  }
  h3 {
    font-size: 18px;
    margin: 0 0 15px 0;
  }
}

.no-touch .cd-timeline-content .cd-read-more:hover {
  background-color: #bac4cb;
}
.cd-timeline-content .cd-date {
  float: left;
  padding: .8em 0;
  opacity: .7;
}
.cd-timeline-content::before {
  content: '';
  position: absolute;
  top: 16px;
  right: 100%;
  height: 0;
  width: 0;
  border: 12px solid transparent;
  border-right: 12px solid $light-alt;
}
@media only screen and (min-width: 1170px) {
  .cd-timeline-content {
    margin-left: 0;
    padding: 1.6em;
    width: 45%;
  }
  .cd-timeline-content::before {
    top: 24px;
    left: 100%;
    border-color: transparent;
    border-left-color: $light;
  }
  .cd-timeline-content .cd-read-more {
    float: left;
  }
  .cd-timeline-content .cd-date {
    position: absolute;
    width: 100%;
    left: 122%;
    top: 20px;
  }
  .cd-timeline-block:nth-child(even) .cd-timeline-content {
    float: right;
  }
  .cd-timeline-block:nth-child(even) .cd-timeline-content::before {
    top: 24px;
    left: auto;
    right: 100%;
    border-color: transparent;
    border-right-color: $light;
  }
  .cd-timeline-block:nth-child(even) .cd-timeline-content .cd-read-more {
    float: right;
  }
  .cd-timeline-block:nth-child(even) .cd-timeline-content .cd-date {
    left: auto;
    right: 122%;
    text-align: right;
  }
  .cssanimations .cd-timeline-content.is-hidden {
    visibility: hidden;
  }
  .cssanimations .cd-timeline-content.bounce-in {
    visibility: visible;
    -webkit-animation: cd-bounce-2 0.6s;
    -moz-animation: cd-bounce-2 0.6s;
    animation: cd-bounce-2 0.6s;
  }
}

@media only screen and (min-width: 1170px) {
  .cssanimations .cd-timeline-block:nth-child(even) .cd-timeline-content.bounce-in {
    -webkit-animation: cd-bounce-2-inverse 0.6s;
    -moz-animation: cd-bounce-2-inverse 0.6s;
    animation: cd-bounce-2-inverse 0.6s;
  }
}


/* ==============
  Timeline-2
===================*/


.main-timeline{
  overflow: hidden;
  position: relative;
  width: 60%;
  margin: 0 auto;
}
.main-timeline:before{
  content: "";
  width: 3px;
  height: 100%;
  background: rgba($green,0.8);
  position: absolute;
  top: 0;
  left: 50%;
}
.main-timeline .timeline{
  padding-right: 30px;
  position: relative;
}
.main-timeline .timeline:before,
.main-timeline .timeline:after{
  content: "";
  display: block;
  width: 100%;
  clear: both;
}
.main-timeline .timeline:first-child:before,
.main-timeline .timeline:last-child:before{
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid $light;
  background: $green;
  margin: 0 auto;
  position: absolute;
  top: 0;
  left: 0;
  right: -3px;
}
.main-timeline .timeline:last-child:before{
  top: auto;
  bottom: 0;
}
.main-timeline .timeline-icon{
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: $green;
  border: 2px solid rgba($green,0.3);
  box-sizing: content-box;
  margin: auto;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: -4px;
}
.main-timeline .timeline-icon:before{
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: $light;
  margin: auto;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}
.main-timeline .year{
  display: inline-block;
  padding: 8px 20px;
  margin: 0;
  font-size: 14px;
  background: rgba($primary,0.30);
  text-align: center;
  position: absolute;
  top: 50%;
  right: 35%;
  transform: translateY(-50%);
}
.main-timeline .year:before{
  content: "";
  border-right: 18px solid rgba($primary,0.30);
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  position: absolute;
  top: 0;
  left: -18px;
}
.main-timeline .timeline-content{
  width: 46.5%;
  padding: 20px;
  margin: 0 20px 0 0;
  background-color:  rgba($primary,0.30);
  position: relative;
}
.main-timeline .timeline-content:after{
  content: "";
  border-left: 20px solid rgba($primary,0.30);
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
  position: absolute;
  top: 50%;
  right: -20px;
  transform: translateY(-50%);
}
.main-timeline .title{
  float: left;
  font-size: 16px;
  font-weight: bold;
  margin: 0 20px 20px 0;
}
.main-timeline .post{
  display: inline-block;
  font-size: 14px;
  color: $muted;
}
.main-timeline .description{
  font-size: 14px;
  color: $muted;
  line-height: 24px;
  margin: 0;
  clear: both;
}
.main-timeline .timeline:nth-child(2n){ padding: 0 0 0 30px; }
.main-timeline .timeline:nth-child(2n) .year{
  right: auto;
  left: 35%;
}
.main-timeline .timeline:nth-child(2n) .year:before{
  border: 18px solid transparent;
  border-right: none;
  border-left: 18px solid rgba($primary,0.30);
  left: auto;
  right: -18px;
}
.main-timeline .timeline:nth-child(2n) .timeline-content{
  float: right;
  margin: 0 0 0 20px;
}
.main-timeline .timeline:nth-child(2n) .timeline-content:after{
  border-left: none;
  border-right: 20px solid rgba($primary,0.30);
  right: auto;
  left: -20px;
}

.timeline-body img{
  width: 90px;
}
@media only screen and (max-width: 1200px){
  .main-timeline .year{ right: 29%; }
  .main-timeline .timeline:nth-child(2n) .year{ left: 31%; }
  .main-timeline{
    width: 100%;
    margin: 0;
  }
}
@media only screen and (max-width: 990px){
  .main-timeline{
    width: 100%;
    margin: 0;
  }
  .main-timeline .year{ right: 28%; }
  .main-timeline .timeline:nth-child(2n) .year{ left: 28%; }
}
@media only screen and (max-width: 767px){
  .main-timeline{
    width: 100%;
    margin: 0;
  }
  .main-timeline:before{ left: 10px; }
  .main-timeline .timeline{
      padding: 0 0 0 30px;
      margin-bottom: 20px;
  }
  .main-timeline .timeline:last-child{ margin-bottom: 0; }
  .main-timeline .timeline:first-child:before,
  .main-timeline .timeline:last-child:before{ display: none; }
  .main-timeline .timeline-icon{
      margin: 0;
      position: absolute;
      top: 7px;
      left: 0;
  }
  .main-timeline .year,
  .main-timeline .timeline:nth-child(2n) .year{
      display: block;
      font-weight: bold;
      margin: 0 0 32px 30px;
      z-index: 1;
      position: relative;
      top: auto;
      left: auto;
      right: auto;
      transform: none;
  }
  .main-timeline .timeline:nth-child(2n) .year:before{
      border-left: none;
      border-right: 18px solid rgba(104, 104, 104, 0.3);
      right: auto;
      left: -18px;
  }
  .main-timeline .timeline-content{ padding: 20px; }
  .main-timeline .timeline-content,
  .main-timeline .timeline:nth-child(2n) .timeline-content{
      width: auto;
      float: none;
      margin: 0 0 0 30px;
  }
  .main-timeline .timeline-content:after,
  .main-timeline .timeline:nth-child(2n) .timeline-content:after{
      border: none;
      border-bottom: 20px solid rgba(104, 104, 104, 0.3);
      border-left: 20px solid transparent;
      border-right: 20px solid transparent;
      top: -20px;
      left: 50%;
      right: auto;
      transform: translateX(-50%);
  }
}
@media only screen and (max-width: 480px){

  .main-timeline{
    width: 100%;
    margin: 0;
     .title{
      float: none;
      margin: 0;
  }
}
  .main-timeline .year,
  .main-timeline .timeline:nth-child(2n) .year{ margin-left: 20px; }
  .main-timeline .timeline-content,
  .main-timeline .timeline:nth-child(2n) .timeline-content{ margin-left: 10px; }
  .main-timeline .post{ margin: 5px 0; }
}


