/* Ленивая загрузка YouTube: постер + кнопка, iframe только после клика */

/* --- Блок трейлера (#trailer): скругление, свечение, «растворение» в фон --- */
#trailer .video {
  --trailer-radius: clamp(20px, 5.5vw, 36px);
  border-radius: var(--trailer-radius);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-block: none;
  box-shadow:
    0 0 0 1px rgba(139, 92, 255, 0.14),
    0 16px 56px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(0, 229, 255, 0.07),
    0 0 160px rgba(139, 92, 255, 0.05);
  background: radial-gradient(120% 80% at 50% 20%, rgba(20, 32, 48, 0.5) 0%, rgba(3, 5, 10, 0.92) 55%, rgba(3, 5, 10, 0.98) 100%);
  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, 10, 16, 0.55) 100%
  );
}

body.theme-light #trailer .video {
  border-color: rgba(0, 122, 138, 0.28);
  box-shadow:
    0 0 0 1px rgba(90, 60, 255, 0.1),
    0 16px 48px rgba(15, 25, 45, 0.12),
    0 0 80px rgba(0, 122, 138, 0.06);
  background: radial-gradient(120% 80% at 50% 15%, rgba(255, 255, 255, 0.55) 0%, rgba(238, 242, 255, 0.92) 50%, rgba(230, 235, 248, 0.98) 100%);
}

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(--cyan, #00e5ff);
  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(0, 229, 255, 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(255, 153, 0, 0.4);
  border-color: #ff9900;
  box-shadow: 0 6px 32px rgba(255, 153, 0, 0.25);
}

.yt-facade__btn:hover .yt-facade__poster {
  filter: saturate(1.1) brightness(1.03);
}
