/* Video Wrapper */
.yt-video-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%; /* Allow full width on mobile screens */
  aspect-ratio: 9 / 16;
  overflow: hidden;
  cursor: pointer;
  background-color: #000;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  margin-bottom: 20px;
}

/* Keep the video constrained to 350px wide on desktop screens */
@media (min-width: 768px) {
  .yt-video-wrapper {
    max-width: 350px;
  }
}

.yt-player {
  position: absolute;
  top: -150px; /* Increased from 70px to swallow the taller mobile UI */
  left: 0;
  width: 100%;
  height: calc(100% + 300px); /* 150px top + 150px bottom */
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none; /* Ensures no rogue clicks hit the hidden title bar */
}

.yt-video-wrapper.video-active .yt-player {
  opacity: 1;
}

/* Controls */
.yt-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.yt-video-wrapper:hover .yt-controls,
.yt-video-wrapper.show-controls .yt-controls {
  opacity: 1;
  pointer-events: auto;
}

.yt-controls button {
  background: rgba(0,0,0,0.6);
  border: 2px solid white;
  border-radius: 50%;
  color: white;
  font-size: 18px;
  width: 42px;
  height: 42px;
  cursor: pointer;
}

/* normal youtube embed */
.ytp-show-cards-title {
    display: none!important;
}

/* Testimonial Slider */

/* 1. Target the scrolling list */
body .gspb_scrollcarousel ul.wp-block-post-template {
    /* Allow cards to bleed to the edges */
    padding-left: calc((100vw - 1280px) / 2) !important;
    padding-right: calc((100vw - 1280px) / 2) !important;
    
    /* Crucial: This tells the browser where the "snap" point is relative to the container */
    scroll-padding-left: calc((100vw - 1280px) / 2) !important;
    
    display: flex !important; /* Flex is often more reliable for horizontal bleed than Grid */
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    column-gap: 20px !important; /* Space between cards */
}

/* 2. Fix for screens smaller than 1280px (Tablets/Mobile) */
@media (max-width: 1280px) {
    body .gspb_scrollcarousel ul.wp-block-post-template {
        padding-left: 20px !important;
        padding-right: 20px !important;
        scroll-padding-left: 20px !important;
    }
}

/* 3. Ensure cards don't shrink and maintain their snapping */
body .gspb_scrollcarousel ul.wp-block-post-template > li {
    flex: 0 0 auto !important; /* Prevents cards from squishing */
    scroll-snap-align: start !important;
    width: 300px !important; /* Or whatever your desired card width is */
}

/* 4. Mobile Peeking Effect */
@media (max-width: 767px) {
    body #gspb_container-id-gsbp-4e83138 ul.wp-block-post-template > li {
        width: 80vw !important;
    }
}