@import './../../../../sources/styles/include.scss';

$component: 'news';
$template: 'template-2';
$item: 'widget-item';
$nav: 'widget-nav';

@mixin webkit-box ($lines, $line-height) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: $lines;
  overflow: hidden;
  max-height: #{$lines * $line-height}px;
}

.widget.c-#{$component}.c-#{$component}-#{$template} {
  .widget-content {
    position: relative;
  }
  .widget-items {
    position: relative;
    padding: 0 20px;
    z-index: 1;
  }
  .#{$item} {
    a {
      color: #353639;
      text-decoration: none;
    }

    .#{$item}-picture {
      a {
        display: block;
      }
    }
  }
  .#{$item}-picture {
    padding-left: 3px;

    & > * {
      width: 120px;
      height: 100px;
      background-size: cover;
      background-repeat: no-repeat;
      background-position: center;
      @include border-radius(3px);
    }
  }
  .#{$item}-text {
    position: relative;
    height: 100%;
    padding-left: 20px;
    padding-right: 20px;

    &[data-date='true'] {
      padding-bottom: 40px;
    }
  }
  .#{$item}-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 21px;
    color: #1b1b1b;
    @include transition(0.4s, color);
    @include webkit-box(3, 21);
  }
  .#{$item}-description {
    margin-top: 12px;
    font-size: 14px;
    line-height: 21px;
    color: #808080;
  }
  .#{$item}-date {
    position: absolute;
    left: 20px;
    right: 0;
    bottom: 15px;
    font-size: 12px;
    line-height: 15px;
    color: #898989;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .#{$nav} {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    z-index: 2;
  }
  .#{$nav} > button {
    position: absolute;
    top: 0;
    width: 40px;
    height: 40px;
    padding: 5px;
    background: #fff;
    border: 1px solid #E8E8E8;
    line-height: 10px;
    cursor: pointer;
    outline: none;
    @include border-radius(2px);
    @include transform-translate(null, -50%);
    @include user-select(none);
    @include transition(0.4s, #{border, background, color, opacity});

    @media all and (max-width: 425px) {
      width: 30px;
      height: 30px;
    }

    &.#{$nav}-prev, &.#{$nav}-next {
      outline: none;
    }
    &.#{$nav}-prev {
      left: 0;
    }
    &.#{$nav}-next {
      right: 0;
    }
    svg {
      path {
        stroke: #808080;
        @include transition(0.4s, all);
      }
    }

    &:hover {
      svg {
        path {
          stroke: #FFF;
        }
      }
    }

    &.disabled {
      background-color: #FFF!important;
      border-color: #F2F2F2!important;
      opacity: 0.7;
      cursor: not-allowed;

      @include user-select(none);

      svg {
        path {
          stroke: #F2F2F2!important;
        }
      }
    }
  }
  .widget-footer-button {
    color: #2d2d2d !important;

    &:hover,
    &:focus,
    &:active {
      color: #fff !important;
    }
  }

  .widget-header {
    overflow: hidden;
  }
  .widget-all-container {
    display: none;
  }
  .widget-all-button {
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: #808080;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;

    i {
      display: none;
      font-size: 18px;
    }
  }

  @media all and (max-width: 550px) {
    .widget-all-container {
      display: block;
    }
    .widget-title.align-center.widget-title-margin {
      margin-left: 25px;
    }
    .widget-all-container.mobile {
      text-align: right;
      width: 25px;
      max-height: 36px;
    }
    .widget-all-container i {
      display: inline-block;
    }
    .widget-footer.mobile,
    .widget-footer-button.mobile{
      display: none;
    }
    .widget-all-container {
      width: 25px;
    }
  }

  @media all and (max-width: 768px) {
    .#{$item}-text {
      padding-top: 20px;
      padding-left: 0;

      &[data-date='true'] {
        padding-bottom: 0;
      }
    }
    .#{$item}-description {
      font-size: 12px;
    }
    .#{$item}-date {
      position: static;
      margin-top: 15px;
    }
  }
  @media all and (max-width: 600px) {
    .#{$item}-text {
      padding-right: 0;
      text-align: center;
    }
    .#{$item}-picture {
      a {
        margin: 0 auto;
      }
    }
  }
}