/**
 * @file
 * Provides media integration with pure CSS fluid video wrapper.
 */

.media {
  overflow: hidden;
  position: relative;
}

.media__iframe,
.slick__litebox,
.slick__slide picture {
  border: 0 none;
  display: block;
  max-width: 100%;
}

.media--ratio--on {
  height: 0;
}

/* 1:1 ratio */
.media--ratio--11 {
  padding-bottom: 100%;
}

/* 4:3 ratio */
.media--ratio--43 {
  padding-bottom: 75%;
}

/* 16:9 ratio */
.media--ratio--169 {
  padding-bottom: 56.25%;
}

.media--ratio--on > iframe {
  /* background: rgba(0, 0, 0, 0.8); */
  max-width: 100%;
}

/* Ensures not affecting iframe only without media swicther */
.media--player.media--ratio--on > iframe {
  opacity: 0;
  visibility: hidden;
}

.media--ratio--on > iframe,
.media--ratio--on > img,
.media--ratio--on > picture,
.media--ratio--on > .slick__litebox {
  border: 0 none;
  display: block;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 0;
}

.media--ratio--on > picture img,
.media--ratio--on > .slick__litebox img {
  height: auto;
  padding-bottom: 0;
}

.media--ratio--on iframe,
.media-icon {
  -webkit-transition: visibility 0s linear 0.5s, opacity 0.5s linear;
  transition: visibility 0s linear 0.5s, opacity 0.5s linear;
}

.media-icon {
  cursor: pointer;
  display: block;
  opacity: 0;
  position: absolute;
  visibility: hidden;
  z-index: 9;
}

.media-icon--play,
.media-icon--close,
.media-icon--spinner {
  height: 80px;
  left: 50%;
  margin: -40px 0 0 -40px;
  top: 50%;
  width: 80px;
}

.media-icon--close::before,
.media-icon--close::after,
.media-icon--play::before {
  content: '';
  display: block;
  position: absolute;
  pointer-events: none;
}

.media-icon--close::before,
.media-icon--close::after {
  background: white;
  border-radius: 4px;
  height: 8px;
  left: 50%;
  margin: -4px 0 0 -40px;
  top: 50%;
  width: 80px;
  -ms-transform: rotate(45deg);
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
}

.media-icon--close::after {
  -ms-transform: rotate(-45deg);
  -webkit-transform: rotate(-45deg);
  transform: rotate(-45deg);
}

.media-icon--close:hover::before,
.media-icon--close:hover::after {
  background-color: #ff6d2c;
}

.is-playing .media-icon--close {
  visibility: hidden;
}

.media-icon--play {
  border: 8px solid white;
  border-radius: 50%;
}

.media-icon--play::before {
  border: 16px solid transparent;
  border-left: 24px solid white;
  left: 50%;
  line-height: 60px;
  margin: -16px 0 0 -6px;
  top: 50%;
}

.media-icon--play:hover {
  border-color: #ff6d2c;
}

.media-icon--play:hover::before {
  border-left-color: #ff6d2c;
}

.is-playing:hover .media-icon {
  -webkit-transition-delay: 0s;
  transition-delay: 0s;
}

.media--switch .slick__image,
.media-icon--play,
.is-playing .media__iframe,
.is-playing.media--ratio--on > iframe,
.is-playing:hover .media-icon--close {
  opacity: 1;
  visibility: visible;
}

.is-playing .media__iframe {
  z-index: 3;
}

.is-playing > img,
.is-playing .slick__image,
.is-playing.media--switch + .slide__pattern,
.is-playing.media--switch .slick__image,
.is-playing .media-icon--play,
.is-playing:hover .media-icon--play {
  opacity: 0;
  position: absolute;
  visibility: hidden;
  z-index: -1;
}

.is-playing .slide__pattern {
  display: none;
}

/**
 * Fallback non-JS.
 */
.no-js .media--switch .slick__image,
.no-js .media--switch .media-icon {
  opacity: 0;
  visibility: hidden;
}

.no-js .media--switch .media__iframe {
  opacity: 1;
  visibility: visible;
}
