/**
 * ct_video (Oxygen core) — responsive embed frame for WP-Kore.
 * Rescued from the legacy kore-video component (deleted in 1da1e544c):
 * sovereign frame shell (surface bg, hairline border, radius-card), the
 * relative container / absolute iframe pattern, and the glass play button
 * with brand hover + ripple (poster overlay hydrated by video-player.js).
 * Lightbox mode from the legacy component does not apply to ct_video.
 * Oxygen's own .oxygen-vsb-responsive-video-wrapper styles do not load on
 * the frontend; without them the iframe collapses to its 300x150 default.
 *
 * @package WP_Kore
 */

.ct-video {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  background: var(--surface);
  border: var(--border-width) solid var(--surface-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: none;
}

.ct-video .oxygen-vsb-responsive-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface);
}

.ct-video .oxygen-vsb-responsive-video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ─── POSTER OVERLAY (legacy video-frame rescue) ─── */
.ct-video__poster {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  border: 0;
  background-color: var(--surface);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  cursor: pointer;
}

.ct-video__play {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--space-2xl);
  height: var(--space-2xl);
  border-radius: 50%;
  background: var(--overlay-dark-soft);
  border: var(--border-width) solid var(--white);
  box-shadow: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.25s ease,
    border-color 0.25s ease;
}

.ct-video__poster:hover .ct-video__play,
.ct-video__poster:focus-visible .ct-video__play {
  transform: scale(1.08);
  background: var(--brand);
  border-color: var(--brand);
}

.ct-video__play-icon {
  width: 1.1rem;
  height: 1.1rem;
  margin-inline-start: var(--space-3xs);
  background: var(--white);
  clip-path: polygon(20% 10%, 100% 50%, 20% 90%);
}

.ct-video__play-ripple {
  position: absolute;
  inset: calc(-1 * var(--space-2xs));
  border-radius: 50%;
  border: var(--border-width) solid var(--brand);
  animation: ct-video-play-ripple 2.4s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
  pointer-events: none;
}

@keyframes ct-video-play-ripple {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.35);
    opacity: 0;
  }

  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ct-video__play,
  .ct-video__play-ripple {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}
