/* Widget 51: a YouTube video in an article (inc/video.php, assets/js/video.js). A 16:9 thumbnail
   with a play button and the length; pressing it swaps in the player at the same size, so nothing
   below moves. */

.hc-prose .hc-video {
  margin: 28px 0;
}

.hc-prose .hc-video__link,
.hc-prose .hc-video__frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--hc-r-card, 16px);
  overflow: hidden;
  background: #000;
  text-decoration: none;
}

.hc-prose .hc-video__thumb {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover; /* YouTube's 4:3 thumbnail carries black bars; crop them */
}

.hc-prose .hc-video__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 48px;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.72);
  transition: background 0.15s ease;
}

.hc-prose .hc-video__play::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 14px;
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff;
}

.hc-prose .hc-video__link:hover .hc-video__play,
.hc-prose .hc-video__link:focus-visible .hc-video__play {
  background: var(--hc-brand);
}

.hc-prose .hc-video__link:focus-visible {
  outline: 2px solid var(--hc-focus);
  outline-offset: 2px;
}

.hc-prose .hc-video__time {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.hc-prose .hc-video__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hc-prose .hc-video figcaption {
  font-size: 13px;
  line-height: 1.5;
  color: var(--hc-muted);
  margin-top: 8px;
}

.hc-prose .hc-video figcaption strong {
  color: var(--hc-text);
}

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