/* youtube-shorts.css */


/* Outer wrapper occupies full width */
.yts-wrapper {
  display: table !important;
  margin: 0 auto !important;
  text-align: center;
}


/* Grid container */
.yts-grid {
  display: inline-flex !important;
  justify-content: center !important; 
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 auto !important;
  /* In fixed-size mode, the grid’s max-width is computed from the number of columns and thumbnail width */
  max-width: calc(var(--videos-per-row) * var(--thumbnail-width) + (var(--videos-per-row) - 1) * 10px);
}

/* Each video container uses the computed thumbnail width */
.yts-wrapper.fixed-size .yts-video {
  width: var(--thumbnail-width);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

/* Image container: force the thumbnail dimensions */
.yts-wrapper.fixed-size .yts-image-container {
  width: var(--thumbnail-width);
  height: var(--thumbnail-height);
  border-radius: var(--thumbnail-radius, 8px);
  overflow: hidden;
}
.yts-wrapper.fixed-size .yts-image-container img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--thumbnail-radius, 8px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover effect */
.yts-video:hover .yts-image-container img {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Video info block: title and views centered below the image */
.yts-video-info {
  padding: 5px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}
.yts-video-title {
  font-size: 14px;
  margin: 5px 0 0;
  color: var(--title-text-color, inherit);
}
.yts-video-views {
  font-size: 12px;
  margin: 2px 0 0;
  color: var(--views-text-color, inherit);
}

/* Lightbox styling */
.yts-lightbox {
  display: none;  /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}
.yts-lightbox-content {
  position: relative;
  padding: 20px;
  background: #000;
  text-align: center;
  max-width: 100%;
}
.yts-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 30px;
  cursor: pointer;
  z-index: 10000;
}

/* Player container (for the lightbox) */
.yts-player-container {
  height: var(--player-percentage);
  aspect-ratio: 9 / 16;
  max-width: 100%;
  margin: 0 auto;
}
.yts-player-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Lightbox navigation */
.yts-video-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.yts-nav-container {
  width: 100%;
  text-align: center;
  margin: 10px 0;
}
.yts-nav-btn {
  background: var(--btn-color, rgba(255,255,255,0.8));
  color: var(--icon-color, #000000);
  border: none;
  padding: 8px 16px;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}
.yts-nav-btn:hover {
  background: var(--btn-hover-color, #CCCCCC);
  color: var(--icon-hover-color, #000000);
}
.yts-nav-btn:focus,
.yts-nav-btn:active {
  outline: none;
}
