/* Demo Card Video Styles */
.demo-card-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  background-color: #000;
  cursor: pointer;
  /* Performance: hint for compositing */
  will-change: transform;
  opacity: 0;
  pointer-events: none;
}

.demo-card__thumb-img--has-video:hover .demo-card-video {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.3s;
}

.demo-card-video.video-playing {
  opacity: 1;
  pointer-events: auto;
}

/* Error state - show poster if video fails */
.demo-card-video.video-error {
  opacity: 0;
  pointer-events: none;
}

/* Ensure video sits properly within link wrapper */
.demo-card__thumb-img {
  position: relative;
  display: block;
  overflow: hidden;
  /* Ensure container has dimensions for absolute children */
  min-height: 200px;
}

/* Fallback image positioning when video is present */
.demo-card__thumb-img img {
  position: relative;
  z-index: 1;
}

/* Performance: contain layout to prevent reflows */
.demo-card {
  contain: layout;
}
