@import "../common/variables";

.@{css-prefix} {
  &-image-container {
    position: relative;
    overflow: hidden;

    img {
      &.fade {
        &[data-src] {
          opacity: 0;
        }

        opacity: 1;
        transition: opacity .5s ease-in-out;
      }

      &.blur {
        &[data-src] {
          filter: blur(1rem);
          opacity: 0.2;
        }

        filter: blur(0);
        opacity: 1;
        transition: .4s filter ease-in,
        opacity .4s ease-in-out;
      }
    }

    .@{css-prefix}-image-blur {
      position: absolute;
      background-size: 100%;
      background-position: center;
      width: 110%;
      height: 100%;
      top: 50%;
      left: 50%;
      margin-left: -55%;
      margin-right: -55%;
      z-index: 10;
      background-repeat: no-repeat;
      filter: blur(40px);

      &:before {
        content: '';
        display: block;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 100;
      }

      &.dark:before {
        background-color: rgba(0, 0, 0, .3);
      }

      &.light:before {
        background-color: rgba(255, 255, 255, .3);
      }
    }
  }

  &-image {
    display: block;

    &.fade {
      &[data-src] {
        opacity: 0;
      }

      opacity: 1;
      transition: opacity .5s ease-in-out;
    }

    &.blur {
      &[data-src] {
        filter: blur(1rem);
        opacity: 0.2;
      }

      filter: blur(0);
      opacity: 1;
      transition: .4s filter ease-in,
      opacity .4s ease-in-out;
    }
  }

  &-image-preview {
    background-color: #f7f6f5;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;

    .blur-preview {
      filter: blur(.75rem);
    }
  }


  &-swiper &-swiper-group &-swiper-item img {
    width: 100%;
    max-width: 100%;
  }
}
