/*
 * share-selection: Medium like popover menu to share on Twitter or by email any text selected on the page
 *
 * -- Requires jQuery --
 * -- AMD compatible  --
 *
 * Author: Xavier Damman (@xdamman)
 * GIT: https://github.com/xdamman/share-selection
 * MIT License
 */

@keyframes selectionSharerPopover-animation {
  0%{
  transform:matrix(0.97,0,0,1,0,12);
  filter:alpha(opacity=0);
  opacity:0
  }
  20%{
  transform:matrix(0.99,0,0,1,0,2);
  filter:alpha(opacity=70);
  opacity:.7
  }
  40%{
  transform:matrix(1,0,0,1,0,-1);
  filter:alpha(opacity=100);
  opacity:1
  }
  70%{
  transform:matrix(1,0,0,1,0,0);
  filter:alpha(opacity=100);
  opacity:1
  }
  100%{
  transform:matrix(1,0,0,1,0,0);
  filter:alpha(opacity=100);
  opacity:1
  }
}

#selectionSharerPopover {
  display: none;
  position: absolute;
  top: 30px;
  left: -100px;
  z-index: 1010;
}

#selectionSharerPopover.anim {
  transition: top .075s ease-out;
  animation: selectionSharerPopover-animation 180ms forwards linear;
  -webkit-animation: selectionSharerPopover-animation 180ms forwards linear;
}

#selectionSharerPopover-inner {
  position:relative;
  overflow: hidden;
  background-color:black;
}

#selectionSharerPopover .selectionSharerPopover-clip {
  position: absolute;
  bottom: -15px;
  display: block;
  left: 50%;
  clip: rect(17px 34px 34px 0);
  margin-left: -17px;
  width: 34px;
  height: 34px;
  line-height: 34px;
}

#selectionSharerPopover .selectionSharerPopover-arrow {
  display: block;
  width: 30px;
  height: 30px;
  -webkit-transform: rotate(45deg) scale(0.5);
  transform: rotate(45deg) scale(0.5);
  background-color:black;
  border: 2px solid black;  
  box-sizing:content-box;
}


.selectionSharer ul {
  padding: 0;
  display: inline;
}

.selectionSharer ul li {
  float: left;
  list-style: none;
  background: none;
  margin: 3px;
  margin-left:2px;
  margin-right:2px;
}
.selectionSharer ul li:first-of-type {margin-left:5px}
.selectionSharer ul li:last-of-type {margin-right:5px}

.selectionSharer a.action {
  display:block;
  text-indent: -200px;
  margin: 5px 7px;
  width:30px;
  height:30px;
  border: none;
}

.selectionSharer a:hover {
  color: #ccc;
}

.selectionSharer a.tweet {
  background: url(../img/icon-twitter-white.svg) no-repeat;
  background-size: 30px;
  background-position: 0px 0px;
}

.selectionSharer a.facebook {
  background: url(../img/icon-facebook-white.svg) no-repeat;
  background-size: 30px;
  background-position: 0px 0px;
  display:none;
}

.selectionSharer a.email {
  background: url("data:image/svg+xml;charset=utf8,%3csvg xmlns='http://www.w3.org/2000/svg' width='94' height='64'%3e%3cg transform='translate(-10, -10)' fill='transparent'%3e%3crect x='0' y='0' width='114' height='114'%3e%3c/rect%3e%3cpath d='M12,12 L102,12 L102,72 L12,72 L12,12 Z M16,12 L53,49 C55.6666667,51 58.3333333,51 61,49 L98,12 L16,12 Z M15,72 L45,42 L15,72 Z M69,42 L99,72 L69,42 Z' stroke='white' stroke-width='5'%3e%3c/path%3e%3c/g%3e%3c/svg%3e") no-repeat;
  background-size: 20px;
  background-position: 0px 4px;
}


#selectionSharerPopunder.fixed {
  transition: bottom 0.5s ease-in-out;
  width: 100%;
  position: fixed;
  left: 0;
  bottom:-50px;
}

.selectionSharer {
  transition: -webkit-transform 0.6s ease-in-out;
}

.selectionSharer.moveDown {
  -webkit-transform: translate3d(0,60px,0);
}

#selectionSharerPopunder {
  position: absolute;
  left: 0;
  width: 100%;
  height: 0px;
  background-color:black;
  transition: height 0.5s ease-in-out;
  overflow: hidden;
}

#selectionSharerPopunder.show {
  height: 35px;
}

.selectionSharerPlaceholder {
  height: 1em;
  margin-bottom: -2em;
  transition: height 0.5s ease-in-out;
}

.selectionSharerPlaceholder.show {
  height: 35px !important;
}

#selectionSharerPopunder-inner ul {
  overflow: hidden;
  float:right;
  margin: 0px;
}

#selectionSharerPopunder-inner ul li {
  padding: 5px;
  overflow: hidden;
}

#selectionSharerPopunder-inner label {
  color: white;
  font-weight: 300;
  line-height: 50px;
  margin: 0px 20px 0px 10px;
}

#selectionSharerPopunder-inner a {
  width: 30px;
  height: 30px;
  background-size: 30px;
}

#selectionSharerPopunder-inner a.tweet {
  background-position: 0px 2px;
}
