/* Video Featured Image Block Styles */
.wp-block-acf-video-featured-image {
  position: relative;
  display: inline-block;
  width: 100%;
  border-radius: var(--wp--preset--radius);
}
.is-flex-query .wp-block-acf-video-featured-image { 
  max-height: 250px; 
  height: 250px; 
  overflow: hidden;
}

/* Support for aspect ratio */
.wp-block-acf-video-featured-image[style*="aspect-ratio"] {
  display: block;
}

.wp-block-acf-video-featured-image[style*="aspect-ratio"] .video-featured-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.is-flex-query.is-horizontal-query .wp-block-acf-video-featured-image { 
  min-height: 100% !important; 
  height: 100% !important; 
}

/* Style Variations */
/* Rounded and Circle styles removed - use additional CSS classes if needed */

/* Stacked Turquoise style */
.wp-block-acf-video-featured-image.is-style-stacked-turquoise {
  transform: rotate(var(--wp--preset--rotation)); /* Rotate the background image */ 
  transition: all 100ms ease-out;
  box-shadow: var(--wp--preset--shadow--button);
}

.wp-block-acf-video-featured-image.is-style-stacked-turquoise .video-featured-image {
  border-radius: var(--wp--preset--radius);
}

.wp-block-acf-video-featured-image.is-style-stacked-turquoise::after {
  background-color: var(--wp--preset--color--turquoise-dark);
  content: ""; /* Required for pseudo-elements */
  transition: all 100ms ease-out;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(calc(-1*var(--wp--preset--rotation))); /* Rotate the background image */ 
  border-radius: var(--wp--preset--radius);
  z-index: -1 !important;
  box-shadow: var(--wp--preset--shadow--button);
  pointer-events: none; /* Ensure it doesn't block interactions */
}

.wp-block-acf-video-featured-image.is-style-stacked-turquoise:hover {
  transform: rotate(0deg); /* Rotate the background image */ 
}

/* When video is playing, apply hover state to stacked turquoise style */
.wp-block-acf-video-featured-image.is-style-stacked-turquoise.video-playing {
  transform: rotate(0deg);
}

.wp-block-acf-video-featured-image.is-style-stacked-turquoise.video-playing::after {
  transform: rotate(var(--wp--preset--rotation));
}

.wp-block-acf-video-featured-image.is-style-stacked-turquoise:hover::after {
  transform: rotate(var(--wp--preset--rotation)); /* Rotate the background image */ 
}

.video-featured-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover; /* Default object-fit */
}

/* Object-fit values are now handled via inline styles from PHP (following WordPress core pattern) */

/* Support for aspect ratio */
.video-featured-image[style*="aspect-ratio"] {
  width: 100%;
  height: auto;
}

/* Support for custom dimensions */
.wp-block-acf-video-featured-image[style*="width"] {
  display: block;
}

.wp-block-acf-video-featured-image[style*="height"] .video-featured-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Block alignment support */
.wp-block-acf-video-featured-image.aligncenter {
  text-align: center;
}

.wp-block-acf-video-featured-image.alignleft {
  float: left;
  margin-right: 2em;
  margin-bottom: 1em;
}

.wp-block-acf-video-featured-image.alignright {
  float: right;
  margin-left: 2em;
  margin-bottom: 1em;
}

.wp-block-acf-video-featured-image.alignwide,
.wp-block-acf-video-featured-image.alignfull {
  width: 100%;
  max-width: 100%;
}

/* Custom dimensions support */
.wp-block-acf-video-featured-image .video-featured-image[style*="width"],
.wp-block-acf-video-featured-image .video-featured-image[style*="height"] {
  max-width: 100%;
}

/* Color support */
.wp-block-acf-video-featured-image.has-background {
  padding: 1em;
}

/* Duotone filter support */
.wp-block-acf-video-featured-image .video-featured-image.wp-duotone {
  filter: var(--wp--preset--duotone--filter);
}

/* Shadow support */
.wp-block-acf-video-featured-image.wp-block-image.has-custom-shadow {
  box-shadow: var(--wp--preset--shadow--custom);
}

/* Border support is handled automatically by WordPress core */

/* Hover effects for interactive elements */
.wp-block-acf-video-featured-image:hover .video-featured-image {
  transition: transform 0.2s ease-in-out, filter 0.2s ease-in-out;
}

/* Support for CSS custom properties from WordPress - handled automatically by core */

/* Ensure play button works with different background colors */
/* .wp-block-acf-video-featured-image.has-background .video-play-overlay {
  background: rgba(0, 0, 0, 0.1);
}

.wp-block-acf-video-featured-image.has-dark-background .video-play-overlay {
  background: rgba(255, 255, 255, 0.1);
} */

/* Play overlay for video blocks */
/* .wp-block-acf-video-featured-image.has-video .video-play-overlay {
  background: rgba(0, 0, 0, 0.1);
} */

/* Responsive adjustments for style variations */
@media (max-width: 768px) {
  .wp-block-acf-video-featured-image.is-style-rounded .video-featured-image {
    border-radius: 12px;
  }
}

/* Play overlay styles - positioned in bottom right, always visible */
.video-play-overlay {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  opacity: 1;
  pointer-events: auto;
  z-index: 10 !important; /* Higher z-index to appear above stacked styles */
}

.video-play-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease;
  border-radius: 50%;
}

.video-play-button svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0px 0px 25px rgba(0, 0, 0, 0.1));
}

/* Make entire image clickable when there's a video */
.wp-block-acf-video-featured-image.has-video {
  cursor: pointer;
}

/* Inline video styles */
.inline-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 1;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
}

/* When video is playing, show as flex for centering */
.wp-block-acf-video-featured-image.video-playing .inline-video-container {
  display: flex !important;
}

.inline-video-container iframe,
.inline-video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: 100%;
  max-height: 100%;
  position: static !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
}

/* Hide play overlay when inline video is active */
.wp-block-acf-video-featured-image.video-playing .video-play-overlay {
  display: none;
}

/* Hide image when inline video is playing */
.wp-block-acf-video-featured-image.video-playing .video-featured-image {
  opacity: 0;
}

/* Click trigger styles - play button always visible (default) */
.wp-block-acf-video-featured-image .video-play-overlay {
  opacity: 1;
}

/* Hover trigger styles - play button shows/hides on hover */
.wp-block-acf-video-featured-image.video-trigger-hover .video-play-overlay {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.wp-block-acf-video-featured-image.video-trigger-hover:hover .video-play-overlay {
  opacity: 0;
}

/* Make hover blocks more obvious they're interactive */
.wp-block-acf-video-featured-image.video-trigger-hover {
  transition: transform 0.2s ease-in-out;
}

/* Smooth transition for video playing state */
.wp-block-acf-video-featured-image.video-trigger-hover .video-featured-image {
  transition: opacity 0.3s ease;
}

/* For hover mode, make the video transition smoother */
.wp-block-acf-video-featured-image.video-trigger-hover .inline-video-container {
  transition: opacity 0.3s ease;
}







/* Modal styles */
.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.video-modal.active {
  display: flex;
  max-width: 100%;
  margin-block-start: 0;
}

.video-modal-content {
  position: relative;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.video-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  border: none;
  color: white;
  font-size: 24px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
}

.video-modal-player {
  width: 100%;
  aspect-ratio: 16/9;
}

.video-modal-player iframe,
.video-modal-player video {
  width: 100%;
  height: 100%;
}