/* Enhanced hover image styles with improved transitions */
.wp-block-post-featured-image .hover-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0;
    z-index: 3;
    object-fit: cover !important;
    transition: opacity 0.5s ease-out !important; /* Increased duration and changed easing function */
    pointer-events: none;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: opacity; /* Optimize for opacity changes */
}

/* Show hover image on hover */
.wp-block-post.team:hover .wp-block-post-featured-image .hover-image,
.team-grid .wp-block-post:hover .wp-block-post-featured-image .hover-image {
    opacity: 1;
    transition: opacity 0.3s ease-in !important; /* Different timing for mouse-in vs mouse-out */
}

/* Make sure hover image is properly positioned relative to link container */
.wp-block-post.team .wp-block-post-featured-image a,
.team-grid .wp-block-post .wp-block-post-featured-image a {
    position: relative !important;
    display: block !important;
    height: 100% !important;
    width: 100% !important;
}

/* Ensure the original image doesn't interfere with hover image */
.wp-block-post-featured-image.has-hover-image img:not(.hover-image) {
    transition: none !important;
}

/* Disable zoom for posts with hover images */
.wp-block-post.team:hover .wp-block-post-featured-image.has-hover-image img:not(.hover-image),
.team-grid .wp-block-post:hover .wp-block-post-featured-image.has-hover-image img:not(.hover-image) {
    transform: none !important;
}

/* Position the featured image container correctly */
.wp-block-post.team .wp-block-post-featured-image,
.team-grid .wp-block-post .wp-block-post-featured-image {
    position: relative !important;
    height: 100% !important;
    overflow: hidden !important;
}