@import './../../../../sources/styles/include.scss';

$component: 'shares';
$template: 'template-6';

$item: 'widget-item';
$loader: 'widget-loader';

@mixin webkit-box($lines, $lineHeight) {
  max-height: #{$lines * $lineHeight}px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: $lines;
  overflow: hidden;
}

@keyframes c-#{$component}-#{$template} {
  from {
    @include transform-translate(-100%, -100%);
  } to {
      @include transform-translate(100%, 100%);
    }
}

.widget.c-#{$component}.c-#{$component}-#{$template} {
  .widget-header {
    &[data-link-all='true'] {
      .widget-title {
        &.align-center {
          margin-left: 150px;
        }
      }
      .widget-description {
        &.align-center {
          margin-left: 150px;
        }
      }
    }
  }
  .widget-list {
    display: block;
    width: 140px;
    padding-left: 10px;
    font-size: 0;
    text-align: right;
    text-decoration: none;
  }
  .widget-list-desktop {
    display: block;
    font-size: 10px;
    line-height: 1;
    color: #808080;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    word-break: break-word;
    @include transition(.35s, color);
  }
  .widget-list-mobile {
    display: none;
    padding: 6px 7px;

    svg {
      path {
        stroke: #B0B0B0;
        @include transition(.35s, stroke);
      }
    }
  }

  .#{$loader} {
    position: relative;
    background-color: #F2F2F2;
    overflow: hidden;

    &::before {
      content: '';
      position: absolute;
      top: -50%;
      left: -50%;
      right: -50%;
      bottom: -50%;
      background: linear-gradient(135deg, rgba(0, 0, 0, 0) 35%, rgba(255, 255, 255, 0.85) 50%, rgba(0, 0, 0, 0) 65%);
      z-index: 1;
      animation-name: c-#{$component}-#{$template};
      animation-duration: 1.5s;
      animation-iteration-count: infinite;
    }
  }
  .#{$loader}-timer {}
  .#{$loader}-timer-name {
    max-width: 150px;
    height: 18px;
    @extend %border-radius-2px;
  }
  .#{$loader}-timer-blocks {
    margin-top: 8px;
    overflow: hidden;
  }
  .#{$loader}-timer-block {
    width: 52px;
    height: 30px;
    @extend %border-radius-2px;
  }

  .#{$item} {
    height: 100%;
    padding: 40px 32px;
    border: 1px solid #F2F2F2;
    overflow: hidden;
    @include border-radius(4px);
  }
  .#{$item}-header {
    font-size: 12px;
    line-height: 1.335;
    color: #808080;
    margin-bottom: 16px;
  }
  .#{$item}-name {
    font-size: 18px;
    line-height: 1.335;
    @include webkit-box(3, 24);

    & > a {
      color: #404040;
      text-decoration: none;
      @include transition(.35s, color);
    }
  }
  .#{$item}-description {
    font-size: 14px;
    line-height: 1.72;
    color: #808080;
    margin-top: 8px;
  }
  .#{$item}-timer {
    margin-top: 24px;
  }
  .#{$item}-picture {
    display: block;
    width: 200px;
    height: 200px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    @include border-radius(50%);

    &[data-lazyload-use='true'] {
      background-color: #F2F2F2;
    }
  }

  %border-radius-2px {
    @include border-radius(2px);
  }

  @include breakpoint-768() {
    .#{$item} {
      padding: 24px;
    }
    .#{$item}-name {
      font-size: 16px;
      line-height: 1.313;
      max-height: 63px;
    }
    .#{$item}-description {
      max-height: 120px;
      -webkit-line-clamp: 5;
    }
    .#{$item}-timer {
      margin-top: 16px;
    }
    .#{$item}-picture {
      width: 150px;
      height: 150px;
    }
  }
  @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-list {
      width: 30px;
      padding-left: 0;
      margin-left: 10px;
    }
    .widget-list-desktop {
      display: none;
    }
    .widget-list-mobile {
      display: block;
    }

    .#{$item}-content-information {
      order: 2;
    }
    .#{$item}-content-picture {
      order: 1;
    }
  }
}