/* Lazy YouTube facade: poster plus button, iframe only after click. */

#trailer .video {
  --trailer-radius: clamp(20px, 5.5vw, 36px);
  border-radius: var(--trailer-radius);
  border: 1px solid rgba(101, 217, 206, 0.28);
  border-block: none;
  box-shadow:
    0 0 0 1px rgba(244, 189, 95, 0.12),
    0 16px 56px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(101, 217, 206, 0.07);
  background: rgba(6, 16, 15, 0.9);
  isolation: isolate;
}

#trailer .video::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  background: radial-gradient(
    ellipse 72% 78% at 50% 48%,
    transparent 32%,
    rgba(7, 10, 16, 0.22) 70%,
    rgba(7, 16, 15, 0.55) 100%
  );
}

body.theme-light #trailer .video {
  border-color: rgba(16, 35, 31, 0.18);
  box-shadow:
    0 0 0 1px rgba(244, 189, 95, 0.14),
    0 16px 48px rgba(15, 40, 34, 0.12);
  background: rgba(255, 252, 239, 0.9);
}

body.theme-light #trailer .video::after {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  background: radial-gradient(
    ellipse 72% 78% at 50% 48%,
    transparent 30%,
    rgba(245, 248, 255, 0.35) 68%,
    rgba(230, 235, 248, 0.65) 100%
  );
}

#trailer .video .video__frame {
  border-radius: inherit;
}

.video.yt-facade {
  cursor: default;
}

.yt-facade__btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: transparent;
  display: block;
  border-radius: inherit;
  z-index: 1;
  overflow: hidden;
}

.yt-facade__btn:focus-visible {
  outline: 2px solid var(--ocean, #65d9ce);
  outline-offset: 3px;
}

.yt-facade__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  transform: scale(1.02);
  filter: saturate(1.05) contrast(1.02);
}

.yt-facade__icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 3px solid rgba(255, 255, 255, 0.88);
  box-shadow:
    0 4px 28px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(101, 217, 206, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  color: #fff;
  padding-left: 0.25rem;
  pointer-events: none;
  z-index: 2;
}

.yt-facade__btn:hover .yt-facade__icon {
  background: rgba(244, 189, 95, 0.42);
  border-color: var(--sun, #f4bd5f);
  box-shadow: 0 6px 32px rgba(244, 189, 95, 0.25);
}

.yt-facade__btn:hover .yt-facade__poster {
  filter: saturate(1.1) brightness(1.03);
}
