@import './../../../../sources/styles/include.scss';

$component: 'shares';
$template: 'template-3';

$item: 'widget-item';

@mixin webkit-box($lines, $lineheight) {
  max-height: #{$lines * $lineheight}px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: $lines;
  overflow: hidden;
}

.widget.c-#{$component}.c-#{$component}-#{$template} {
  .widget-all-button {
    display: block;
    width: 140px;
    padding-left: 10px;
    text-align: right;
    text-decoration: none;

    span {
      display: block;
      font-size: 12px;
      font-weight: 500;
      line-height: 1;
      color: #808080;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      word-break: break-word;
      @include transition(.35s, color);
    }
    i {
      display: none;
      font-size: 18px;
      line-height: 30px;
    }
  }
  .widget-header {
    &[data-link-all='true'] {
      .widget-title {
        &.align-center {
          margin-left: 150px;
        }
      }
      .widget-description {
        &.align-center {
          margin-left: 150px;
        }
      }
    }
  }

  .#{$item} {
    position: relative;
    overflow: hidden;
    display: block;
    padding-bottom: 80%;
    border-radius: 5px;
    background: #fff;

    &:hover {
      .#{$item}-description {
        height: 70px;
        opacity: 1;
      }
      .#{$item}-fade {
        opacity: 0.5;
      }
    }
  }
  .#{$item}-picture {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    
    &[data-lazyload-use='true'] {
      background-color: #F2F2F2;
    }
  }
  .#{$item}-fade {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000;
    opacity: 0;
    @include transition(.35s, opacity);
  }
  .#{$item}-content {
    position: absolute;
    left: 32px;
    bottom: 32px;
    right: 32px;
  }
  .#{$item}-name {
    font-size: 16px;
    line-height: 28px;
    color: #fff;
    padding: 0 12px;
    overflow: hidden;
    @include border-radius(2px);
    @include webkit-box(2, 28);
  }
  .#{$item}-description {
    font-size: 14px;
    line-height: 18px;
    color: #fff;
    height: 0;
    opacity: 0;
    overflow: hidden;
    @include transition(.35s, (height, opacity));
    
    span {
      margin-top: 16px;
      @include webkit-box(3, 18);
    }
  }

  @include breakpoint-768() {
    .#{$item}-description {
      display: none;
    }
  }
  @include breakpoint-custom(500) {
    .widget-header {
      &[data-link-all='true'] {
        .widget-title {
          &.align-center {
            margin-left: 40px;
          }
        }
        .widget-description {
          &.align-center {
            margin-left: 40px;
          }
        }
      }
    }
    .widget-all-button {
      text-align: center;
      width: 30px;
      padding-left: 0;
      margin-left: 10px;

      span {
        display: none;
      }
      i {
        display: inline-block;
      }
    }
  }
}