@import "flive-vars";

.media-wrapper {
  display: inline-block;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.media-wrapper--bordered {
  border: 1px solid $flive-medium-grey;
}
.media-container {
  text-align: center;
  position: relative;
}
.media {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
  overflow: hidden;
}
.description {
  text-align: left;
  padding: 5px 10px;
  background: $flive-light-grey;
  width: 100%;
  font-size: 0.8rem;
}

.media-img-wrapper {
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
}
.media-img-wrapper--cover {
  background-size: cover;
}
.media-img {
  display: none;
}

@supports (object-fit: contain) {
  .media-img-wrapper {
    background: none !important;
  }
  .media-img {
    display: block;
    position: absolute;
    object-fit: contain;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
  }
  .media-img--cover {
    object-fit: cover;
  }
}

// flex container
.media-wrapper--flex-container {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  .media-container {
    flex-grow: 1;
  }
}

.media-img-wrapper--height-auto {
  background: none !important;
  position: static;
  .media-img--height-auto {
    display: block !important;
    width: 100%;
    height: auto;
    position: static;
  }
}
