/* Site-wide YouTube player */

.yt-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  background: #111;
  isolation: isolate;
}

.yt-player__facade {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  background: transparent;
  color: #fff;
}

.yt-player__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #1a1a1a;
}

.yt-player__facade::after {
  content: none;
}

.yt-player__play {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f4c400;
  color: #111;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.35),
    0 0 0 0 rgba(244, 196, 0, 0.45);
  transition: transform 0.2s ease, filter 0.2s ease;
  animation: yt-play-pulse 1.4s ease-in-out infinite;
}

.yt-player__facade:hover .yt-player__play,
.yt-player__facade:focus-visible .yt-player__play {
  transform: scale(1.06);
  filter: brightness(1.05);
}

.yt-player__facade:focus-visible {
  outline: 2px solid #f4c400;
  outline-offset: 2px;
}

.yt-player.is-playing .yt-player__facade {
  display: none;
}

.yt-player__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.modal__youtube,
.modal [data-youtube-player] {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius, 12px);
  overflow: hidden;
  background: #000;
}

.modal__youtube iframe,
.modal [data-youtube-player] iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@keyframes yt-play-pulse {
  0%,
  100% {
    box-shadow:
      0 10px 28px rgba(0, 0, 0, 0.35),
      0 0 0 0 rgba(244, 196, 0, 0.45);
  }

  50% {
    box-shadow:
      0 10px 28px rgba(0, 0, 0, 0.35),
      0 0 0 14px rgba(244, 196, 0, 0.18),
      0 0 28px 6px rgba(244, 196, 0, 0.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .yt-player__play {
    transition: none;
    animation: none;
    box-shadow:
      0 10px 28px rgba(0, 0, 0, 0.35),
      0 0 0 6px rgba(244, 196, 0, 0.28);
  }
}
