@import '../../styles/tokens.css';

.event-youtube .youtube-stream {
  display: flex;
  max-width: 100%;
  margin: 0 auto;
  flex-wrap: wrap;
  transition: all 0.3s ease-in-out;
}

.event-youtube .youtube-video-container {
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: auto;
  height: 0;
  padding-bottom: 56.25%;
  position: relative;
  transition: width 0.3s ease-in-out, max-width 0.3s ease-in-out;
}

.event-youtube .youtube-video-container .iframe-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

lite-youtube {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  cursor: pointer;
  background-color: var(--s2a-color-background-knockout, #000);
  background-size: cover;
  background-position: center;
}

lite-youtube > .lty-playbtn {
  display: block;
  width: 68px;
  height: 48px;
  position: absolute;
  cursor: pointer;
  transform: translate3d(-50%, -50%, 0);
  top: 50%;
  left: 50%;
  z-index: 1;
  background-color: transparent;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="red"/><path d="M45 24 27 14v20" fill="white"/></svg>');
  filter: grayscale(100%);
  transition: filter 0.1s cubic-bezier(0, 0, 0.2, 1);
  border: none;
}

lite-youtube:hover > .lty-playbtn,
lite-youtube .lty-playbtn:focus {
  filter: none;
}

/* Screen reader only text */
.lyt-visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.event-youtube .youtube-chat-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--s2a-color-content-subtle, #666);
  text-align: center;
  font-size: 14px;
  background: var(--s2a-color-background-subtle, #f5f5f5);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--s2a-color-border-subtle, #ddd);
}

.event-youtube .youtube-chat-container {
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 500px;
  transition: all 0.3s ease-in-out;
}

.event-youtube .youtube-chat-container .iframe-container {
  height: 100%;
  padding-bottom: 0;
  position: relative;
  width: 100%;
}

.event-youtube .youtube-chat-container iframe,
.event-youtube .youtube-video-container iframe {
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
  position: absolute;
  border: none;
}

@media screen and (min-width: 1200px) {
  .event-youtube .youtube-stream:not(.has-chat) .youtube-video-container {
    width: 100%;
    max-width: 100%;
    height: 0;
    padding-bottom: 56.25%;
  }

  .event-youtube .youtube-stream.has-chat .youtube-video-container {
    width: 100%;
    max-width: 100%;
    height: 0;
    padding-bottom: 42.1875%;
  }

  .event-youtube .youtube-stream.has-chat:not(.single-column) .youtube-video-container {
    width: 75%;
    max-width: 75%;
    height: 0;
    padding-bottom: 42.1875%;
  }

  .event-youtube .youtube-stream.has-chat:not(.single-column) .youtube-chat-container {
    flex: 1 1 1%;
    min-height: 0;
    height: auto;
    padding-bottom: 42.1875%;
    position: relative;
  }

  .event-youtube .youtube-stream.has-chat:not(.single-column) .youtube-chat-container .iframe-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

@media (min-width: 1024px) {
  .event-youtube .youtube-stream:not(.has-chat) .youtube-video-container {
    border-radius: var(--s2a-border-radius-24, 24px);
    overflow: hidden;
    max-width: var(--s2a-layout-rich-media-content-measure-wide, 1192px);
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    height: auto;
    padding-bottom: 0;
  }
}
