/* Hero Video & GIF Support - Bulma Enhanced
-------------------------------------------------- */

/* === HERO VIDEO CONTAINER === */
.hero-video-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-gray-900);
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}

/* === HERO VIDEO CONTROLS === */
.hero-video-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10;
}

.hero-video-container:hover .hero-video-controls {
  opacity: 1;
  transform: translateY(0);
}

.hero-video-controls button {
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hero-video-controls button:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.hero-video-controls button [data-lucide] {
  width: 18px;
  height: 18px;
}

/* === MOBILE OPTIMIZATIONS === */
@media screen and (max-width: 768px) {
  .hero-video-controls {
    bottom: 12px;
    right: 12px;
    opacity: 1; /* Always visible on mobile */
    transform: translateY(0);
  }
  
  .hero-video-controls button {
    width: 36px;
    height: 36px;
  }
  
  .hero-video-controls button [data-lucide] {
    width: 16px;
    height: 16px;
  }
}

/* === VIDEO ENHANCEMENTS === */
/* Video-specific styling that enhances Bulma's figure/image classes */
video.has-ratio {
  object-fit: cover;
  background: var(--color-gray-900);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Video loading state */
video[data-loading="true"] {
  opacity: 0.7;
  filter: blur(1px);
}

/* === ENHANCED OVERLAY CONTROLS === */
/* Add subtle hover effects to overlay controls */
.is-overlay .buttons {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

figure:hover .is-overlay .buttons,
figure:focus-within .is-overlay .buttons {
  opacity: 1;
  transform: translateY(0);
}

/* Enhanced button styling for video controls */
.is-overlay .button {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.is-overlay .button:hover {
  transform: scale(1.1);
  background-color: rgba(0, 0, 0, 0.9) !important;
}

.is-overlay .button:focus {
  outline: 2px solid var(--bulma-primary);
  outline-offset: 2px;
}

/* === GIF ENHANCEMENTS === */
/* GIF images using Bulma classes */
.gif-static,
.gif-animated {
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.gif-animated {
  position: absolute;
  top: 0;
  left: 0;
}

/* === TAGS/COUNTERS === */
/* Enhanced gallery count tags */
.is-overlay .tag {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* === MOBILE OPTIMIZATIONS === */
@media screen and (max-width: 768px) {
  /* Always show controls on mobile (no hover) */
  .is-overlay .buttons {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Larger touch targets on mobile - using Bulma size modifiers */
  .is-overlay .button.is-small {
    min-width: 48px;
    min-height: 48px;
  }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  video.has-ratio,
  .gif-static,
  .gif-animated {
    transition: none !important;
  }
  
  .is-overlay .buttons {
    transform: none !important;
    transition: opacity 0.2s ease !important;
  }
  
  /* Disable autoplay for users who prefer reduced motion */
  video[autoplay] {
    autoplay: false;
  }
}

/* === PERFORMANCE === */
/* Optimize rendering for video elements */
video.has-ratio,
.gif-animated {
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
}

/* Remove will-change when not animating */
.box:not(.is-transitioning) video.has-ratio,
.box:not(.is-transitioning) .gif-animated {
  will-change: auto;
}

/* === LOADING STATES === */
figure.is-loading video.has-ratio {
  opacity: 0.5;
  filter: blur(2px);
}

figure.is-loading .gif-static {
  opacity: 0.5;
  filter: blur(1px);
}

/* === SWUP TRANSITION COMPATIBILITY === */
/* Ensure videos play well with page transitions */
.hero.is-swapping video {
  pointer-events: none;
}

.hero.is-swapping figure {
  pointer-events: none;
}

/* Reset video state after transitions */
.hero:not(.is-swapping) video {
  pointer-events: auto;
}

.hero:not(.is-swapping) figure {
  pointer-events: auto;
}