/**
 * Fachada dos vídeos de terceiros (YouTube e reels do Facebook) com a porta
 * de consentimento — markup em inc/embed-consent-video.php, JS em
 * assets/js/embed-consent.js.
 *
 * O aviso e o botão reutilizam `.sp-embed-porta__aviso/__texto/__botao` do
 * tailwind-src.css (os mesmos dos tweets). Aqui só vive o palco: miniatura,
 * botão de play e duração, no rácio do vídeo (16:9 ou 9:16), e depois o
 * iframe no mesmo sítio, sem salto de layout.
 */

.sp-embed-video {
  margin: 0;
  min-width: 0;
}

.sp-embed-video__palco {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--sp-radius);
  background: var(--sp-navy);
  cursor: pointer;
}

.sp-embed-video--9x16 .sp-embed-video__palco {
  aspect-ratio: 9 / 16;
}

.sp-embed-video[data-sp-embed-pronto] .sp-embed-video__palco {
  cursor: auto;
}

.sp-embed-video__palco > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.sp-embed-video__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sp-embed-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: -1.75rem 0 0 -1.75rem;
  border-radius: var(--sp-radius-pill);
  background: var(--sp-porto);
  color: var(--sp-surface);
  box-shadow: var(--sp-shadow-panel);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.sp-embed-video__play svg {
  margin-left: 3px;
}

.sp-embed-video__palco:hover .sp-embed-video__play {
  background: var(--sp-porto-hover);
  transform: scale(1.06);
}

.sp-embed-video__duracao {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--sp-radius-pill);
  background: color-mix(in srgb, var(--sp-navy) 80%, transparent);
  color: var(--sp-surface);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.sp-embed-video__externo {
  color: var(--sp-porto);
  font-weight: 600;
  white-space: nowrap;
}

.sp-embed-video__externo:hover {
  color: var(--sp-porto-hover);
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .sp-embed-video__play {
    transition: none;
  }

  .sp-embed-video__palco:hover .sp-embed-video__play {
    transform: none;
  }
}
