/* Sharing at the top of the article */
.thb-social-top {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;

  .thb-social-total {
    display: flex;
    align-items: center;
    flex-direction: column;
    line-height: 1;
    padding: 0 15px;
    margin-bottom: 15px;
    .thb-social-total-count {
      display: inline-flex;
      font-size: 24px;
      font-weight: 600;
      margin-bottom: 8px;
    }
    .thb-social-total-text {
      display: inline-flex;
      text-transform: uppercase;
      font-size: 10px;
      opacity: 0.8;
      letter-spacing: 0.05em;
    }
  }
  .thb-social-top-buttons {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
  }
  .social-button-holder {
    .social {
      display: flex;
      justify-content: center;
      align-items: center;
      text-align: center;
      color: #a9a9a9;
      line-height: 1;
    }
  }
  &.style1 {
    padding: 0 0 30px;
    .thb-social-top-buttons {
      max-width: 110px;
      width: 100%;
    }
    .social-button-holder {
      flex: 0 0 50%;
      padding: 5px;
      max-width: 50%;
      .social {
        border: 1px solid $border;
        width: 45px;
        height: 45px;
        position: relative;
        @each $profile, $color in $social {
      	  &.social-#{$profile} {
      	  	&:hover {
              border-color: $color;
      	  		background: $color;
              color: #fff;
      	  	}
            .thb-social-count {
              background: $color;
            }
      	  }
      	}
        .thb-social-count {
          display: flex;
          justify-content: center;
          align-items: center;
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          text-align: center;
          opacity: 0;
          color: #fff;
          @extend .mid-transition;
        }
        &:hover {
          .thb-social-count {
            opacity: 1;
          }
        }
      }
    }
  } // .style1
  &.style2 {
    padding: 10px 0 30px;

    &.sharing-counts-off {
      padding-top: 0;
    }
    .thb-social-top-buttons {
      max-width: 55px;
      align-items: center;
    }
    .thb-social-total {
      .thb-social-total-count {
        font-size: 14px;
        margin-bottom: 4px;
      }
    }
    .social-button-holder {
      flex: 1;
      padding: 5px;
      .social {
        border: 1px solid $border;
        width: 44px;
        height: 44px;
        margin: 0 auto;
        border-radius: 50%;
        position: relative;
        @each $profile, $color in $social {
      	  &.social-#{$profile} {
            color: $color;
      	  	&:hover {
              border-color: $color;
      	  		background: $color;
              color: #fff;
      	  	}
            .thb-social-count {
              background: $color;
            }
      	  }
      	}
        .thb-social-count {
          display: flex;
          justify-content: center;
          align-items: center;
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          text-align: center;
          opacity: 0;
          color: #fff;
          border-radius: 50%;
          @extend .mid-transition;
        }
        &:hover {
          .thb-social-count {
            opacity: 1;
          }
        }
      }
    }
  } // .style2
  &.style3 {
    padding: 10px 0 30px;
    &.sharing-counts-off {
      padding-top: 0;
    }
    .thb-social-top-buttons {
      max-width: 55px;
      align-items: center;
    }
    .thb-social-total {
      .thb-social-total-count {
        font-size: 14px;
        margin-bottom: 4px;
      }
    }
    .social-button-holder {
      flex: 1;
      padding: 10px;
      .social {
        flex-direction: column;
        width: 40px;
        text-align: center;
        margin: 0 auto;
        font-size: 20px;
        &:hover {
          .thb-social-icon {
            color: $black;
          }
        }
        @each $profile, $color in $social {
      	  &.social-#{$profile} {
            color: $black;
      	  	&:hover .thb-social-icon {
              color: $color;
      	  	}
      	  }
      	}
        .thb-social-count {
          opacity: 0.8;
          font-size: 10px;
          margin-top: 5px;
        }
      }
    }
  } // .style3
  &.style4 {
    padding: 10px 0 30px;
    &.sharing-counts-off {
      padding-top: 0;
      .social-button-holder {
        margin-bottom: 10px;

        &:last-child {
          margin-bottom: 0;
        }
      }
    }
    .thb-social-top-buttons {
      max-width: 70px;
      align-items: center;
      flex-direction: column;
    }
    .thb-social-total {
      .thb-social-total-count {
        font-size: 14px;
        margin-bottom: 4px;
      }
    }
    .social-button-holder {
      flex: 1;
      padding: 5px;
      .social {
        text-align: center;
        margin: 0 auto;

        .thb-social-count {
          display: flex;
          justify-content: center;
          align-items: center;
          text-align: center;
          height: 22px;
          width: 35px;
          text-align: center;
          position: relative;
          border: 1px solid #e1e1e1;
          border-radius: 2px;
          font-size: 10px;
          margin-left: 12px;
          color: #878787;
          @extend .mid-transition;
          &:before {
            content: '';
            display: block;
            width: 6px;
            height: 6px;
            position: absolute;
            right: calc(100% - 1px);
            top: 50%;
            background: #fff;
            border: 1px solid transparent;
            border-left-color: #e1e1e1;
            border-bottom-color: #e1e1e1;
            @include transform(rotateZ(45deg) translateY(-50%));
            @extend .mid-transition;
          }
        } // .thb-social-count
        &:hover {
          .thb-social-icon {
            color: $black;
          }
          .thb-social-count {
            color: #fff;
          }
        }
        @each $profile, $color in $social {
      	  &.social-#{$profile} {
            color: $black;
      	  	&:hover .thb-social-icon {
              color: $color;
      	  	}
            &:hover .thb-social-count {
              background: $color;
              border-color: $color;

              &:before {
                background: $color;
                border-left-color: $color;
                border-bottom-color: $color;
              }
            }
      	  }
      	}
      }
    }
  } // .style4
  &.style5 {
    flex-direction: row;
    &.sharing-counts-off {
      margin-left: 15px;
    }
    .thb-social-total {
      margin: 0;
      flex-direction: row;
      .thb-social-total-count {
        font-size: 10px;
        margin: 0;
      }
      .thb-social-total-text {
        margin-left: 6px;
      }
    }
    .social-button-holder {
      margin: 2px;
      .social {
        width: 24px;
        height: 24px;
        border-radius: 2px;
        color: #fff;
        font-size: 12px;
        .thb-social-count {
          display: none;
        }
        @each $profile, $color in $social {
      	  &.social-#{$profile} {
            background: $color;
      	  	&:hover {
              background: darken($color, 10%);
      	  	}
      	  }
      	}
      }
    }
  } // .style5
}

/* Sharing at the bottom of the article */
.thb-social-footer {
  display: flex;
  align-items: center;
  margin-top: 30px;
  .thb-social-total {
    display: none;
    align-items: center;
    line-height: 1;
    padding: 0 15px;
    margin-right: 15px;

    .rtl & {
      margin-right: 0;
      margin-left: 15px;
    }
    @include min-break($break-small) {
      display: flex;
    }
    .thb-social-total-count {
      display: inline-flex;
      font-size: 14px;
      font-weight: 600;
    }
    .thb-social-total-text {
      display: inline-flex;
      margin-left: 10px;
      text-transform: uppercase;
      font-size: 10px;

      .rtl & {
        margin-right: 10px;
        margin-left: 0;
      }
    }
  }
  .thb-social-footer-buttons {
    flex: 1;
    display: flex;
    flex-wrap: wrap;

    .social-button-holder {
      padding: 5px;
      display: flex;
    }
    .social {
      display: inline-flex;
      align-items: center;
      height: 45px;
      padding: 0 20px;
      width: 100%;
      .thb-social-icon {
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        font-size: 10px;
        text-transform: uppercase;
        font-weight: 600;

        i {
          text-align: left;
          font-size: 16px;
        }
        .thb-social-text {
          margin-left: 10px;
          .rtl & {
            margin-right: 10px;
            margin-left: 0;
          }
        }
      }
      .thb-social-count {
        margin-left: 30px;
        font-size: 10px;
        opacity: 0.7;

        .rtl & {
          margin-right: 0;
          margin-left: 30px;
        }
      }
    } // .social
  } // .thb-social-footer-buttons
  &.style1 {
    background: #f6f6f6;
    padding: 10px;

    @include min-break($break-small) {
      padding: 20px;
    }
    .thb-social-footer-buttons {

      .social-button-holder {
        &:nth-child(1),
        &:nth-child(2) {
          flex-grow: 1;
        }
        &:nth-child(n+3) {
          .thb-social-text,
          .thb-social-count {
            display: none;
          }
        }
      }
      .social {
        background: #fff;
        justify-content: space-between;
        &:hover {
          color: #fff;

          .thb-social-count {

          }
        }
        @each $profile, $color in $social {
      	  &.social-#{$profile} {
      	  	&:hover {
      	  		background: $color;
      	  	}
      	  }
      	}
      } // .social
    }
  } // .style1
  &.style2 {
    .thb-social-footer-buttons {
      .social-button-holder {
        flex: 0 0  25%;
      }
      .social {
        background: #9b9b9b;
        text-align: center;
        justify-content: center;
        color: #fff;

        .thb-social-count {
          margin-left: 10px;
        }
        &:hover {
          background: darken(#9b9b9b, 10%);
        }
        @each $profile, $color in $social {
      	  &.social-#{$profile} {
            background: $color;
      	  	&:hover {
      	  		background: darken($color, 10%);
      	  	}
      	  }
      	}
      } // .social
    }
  } // .style2
}

/* Sharing inside Fixed Header */
.thb-social-fixed {
  display: flex;
  align-items: center;
  .social-button-holder {
    display: inline-flex;
    align-items: center;
    margin-left: 15px;
    font-size: 10px;
    color: $black;
    text-transform: uppercase;
    .social {
      display: inline-flex;
      align-items: center;

      .thb-social-count {
        margin-left: 10px;

        .rtl & {
          margin-left: 0;
          margin-right: 10px;
        }
      }
      @each $profile, $color in $social {
        &.social-#{$profile} {
          &:hover {
            color: $color;
          }
        }
      }
    }
    &.social-comment-holder {
      margin-right: 10px;

      @include min-break(1025px) {
        margin-right: 20px;
      }
      .rtl & {
        span {
          margin-left: 0;
          margin-right: 12px;
        }
      }
      span {
        margin-left: 12px;
      }
      svg {
        height: 12px;
      }
    }
    i {
      font-size: 13px;
    }
  }
}