/* Carousel container styles */
.playlist-wrapper {
  max-width: 1240px;
  margin: auto;
  position: relative;
}

.serie-a-carousel {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: auto;
  overflow: hidden;
}

/* Updated slides container for smooth sliding animation */
.serie-a-slides {
  display: flex;             /* Flex container for horizontal layout */
  margin: 0;                 /* Removed negative margin */
  transition: transform 0.3s ease-in-out !important;  /* Smooth slide transition */
}

/* Each slide takes full width and uses grid layout for its content */
.slide {
  flex: 0 0 100%;            /* Each slide occupies 100% of the carousel width */
  display: grid;
  gap: 20px;
  padding: 10px;
}

/* Responsive grid layout for video cards within each slide */
/* Desktop: 2 rows x 3 columns (6 videos) */
@media (min-width: 768px) {
  .slide {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
  }
}
/* Tablet: 2 items per slide */
@media (max-width: 767px) and (min-width: 580px) {
  .slide {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Mobile: 1 item per slide */
@media (max-width: 579px) {
  .slide {
    grid-template-columns: 1fr;
  }
}

/* Video Card Styles */
.video-card {
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0px 0px 10px -2px black;
}

/* The video-thumb container always maintains a 16:9 aspect ratio */
.video-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

/* Ensure the image and iframe fill the container */
.video-thumb img,
.video-thumb iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Title styling */
.video-card h3 {
  margin: auto !important;
  padding: 10px;
  height: 100%;
  min-height: 80px;
  text-align: center;
  background: var(--primary, #0073aa);
  color: var(--text-colour, #fff);
  font-size: 16px;
}

/* Carousel Navigation */
.serie-a-prev, .serie-a-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 30px;
  width: 30px;
  padding: 0;
  border-radius: 50%;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 38%;
  cursor: pointer;
  z-index: 1;
}
.serie-a-prev {
  left: -35px;
  background-image: url(https://tln.ca/wp-content/fontawesome/svgs/solid/chevron-left.svg);
}
.serie-a-next {
  right: -35px;
  background-image: url(https://tln.ca/wp-content/fontawesome/svgs/solid/chevron-right.svg);
}
.serie-a-prev:hover, .serie-a-next:hover {
  filter: invert(1);
  background-color: #cfc6c1;
}

@media only screen and (max-width: 580px) {
  .serie-a-prev {
    left: -30px;
  }
  .serie-a-next {
    right: -30px;
  }
  .serie-a-prev:hover, .serie-a-next:hover {
    filter: unset !important;
    background-color: unset !important;
  }
  .video-card {
    box-shadow: none;
  }
}

/* Lightbox Styles */
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
}
#lightbox.active {
  display: flex;
}
.lightbox-content {
  position: relative;
  background: #000;
  padding: 20px;
  max-width: 90%;
  max-height: 90%;
  width: 1000px;
}
/* The video container in the lightbox uses the 16:9 ratio */
#lightbox-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
}
#lightbox-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
#lightbox-close {
  position: absolute;
  top: 20px;
  right: 10px;
  border: none;
  background: none;
  color: white;
  padding: 5px 10px;
  cursor: pointer;
  z-index: 101;
}
