/* Solarpro videos — YouTube-style gallery */

.sp-youtube-gallery,
.sp-youtube-gallery * {
  box-sizing: border-box;
}

.sp-youtube-gallery {
  --sp-red: var(--solarpro-red, #df101b);
  --sp-bg: #000;
  --sp-bg-hover: #181818;
  --sp-bg-active: #202020;
  --sp-muted: #aaa;

  width: 100% !important;
  margin: 0 !important;
  padding: 32px 20px !important;
  background: #000 !important;
  color: #fff !important;
  font-family: inherit !important;
}

.sp-youtube-layout {
  width: 100% !important;
  max-width: 1500px !important;
  margin-inline: auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px) !important;
  grid-template-areas: "watch playlist" !important;
  gap: 24px !important;
  align-items: start !important;
}

.sp-watch-area {
  grid-area: watch !important;
  min-width: 0 !important;
}

.sp-playlist {
  grid-area: playlist !important;
  min-width: 0 !important;
  position: sticky !important;
  top: 20px !important;
}

body.translatepress-en_US .sp-youtube-layout,
html.translatepress-en_US .sp-youtube-layout {
  grid-template-columns: minmax(330px, 420px) minmax(0, 1fr) !important;
  grid-template-areas: "playlist watch" !important;
}

.sp-player {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  overflow: hidden !important;
  background: #000 !important;
  border-radius: 14px !important;
}

.sp-player video {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: contain !important;
  background: #000 !important;
}

.sp-watch-info {
  padding-top: 16px !important;
  direction: rtl !important;
}

.sp-watch-info h2 {
  margin: 0 !important;
  color: #fff !important;
  font-size: clamp(20px, 2vw, 26px) !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
  text-align: right !important;
}

body.translatepress-en_US .sp-watch-info,
html.translatepress-en_US .sp-watch-info {
  direction: ltr !important;
}

body.translatepress-en_US .sp-watch-info h2,
html.translatepress-en_US .sp-watch-info h2 {
  text-align: left !important;
}

.sp-video-meta {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 8px !important;
  color: var(--sp-muted) !important;
  font-size: 13px !important;
}

.sp-video-description {
  display: none !important;
  margin-top: 16px !important;
  padding: 16px 18px !important;
  background: #161616 !important;
  border-radius: 12px !important;
  color: #e7e7e7 !important;
  font-size: 14px !important;
  line-height: 1.8 !important;
  text-align: right !important;
  direction: rtl !important;
}

.sp-video-description.has-content {
  display: block !important;
}

body.translatepress-en_US .sp-video-description,
html.translatepress-en_US .sp-video-description {
  direction: ltr !important;
  text-align: left !important;
}

.sp-playlist-heading {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 18px !important;
  margin-bottom: 16px !important;
  direction: rtl !important;
}

.sp-playlist-heading-main {
  min-width: 0 !important;
}

.sp-section-subtitle {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  margin-bottom: 6px !important;
  direction: rtl !important;
}

.sp-subtitle-text {
  color: #9a9a9a !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.sp-subtitle-marks {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
}

.sp-subtitle-marks i {
  display: block !important;
  width: 5px !important;
  height: 11px !important;
  background: var(--sp-red) !important;
  transform: skew(-18deg) !important;
}

.sp-playlist-heading h3 {
  margin: 0 !important;
  color: #fff !important;
  font-size: 27px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

.sp-video-count {
  color: #aaa !important;
  font-size: 12px !important;
  white-space: nowrap !important;
  padding-bottom: 4px !important;
}

body.translatepress-en_US .sp-playlist-heading,
html.translatepress-en_US .sp-playlist-heading,
body.translatepress-en_US .sp-section-subtitle,
html.translatepress-en_US .sp-section-subtitle {
  direction: ltr !important;
}

.sp-playlist-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  max-height: calc(100vh - 140px) !important;
  overflow-y: auto !important;
  padding-inline-end: 5px !important;
}

.sp-playlist-list::-webkit-scrollbar {
  width: 5px;
}

.sp-playlist-list::-webkit-scrollbar-track {
  background: transparent;
}

.sp-playlist-list::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 50px;
}

.sp-playlist-list::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.sp-video-item {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 168px minmax(0, 1fr) !important;
  gap: 10px !important;
  padding: 5px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: #fff !important;
  font-family: inherit !important;
  cursor: pointer !important;
  direction: rtl !important;
  text-align: right !important;
  transition: background 0.2s ease, transform 0.2s ease !important;
}

.sp-video-item:hover {
  background: var(--sp-bg-hover) !important;
}

.sp-video-item.active {
  background: var(--sp-bg-active) !important;
}

.sp-video-thumbnail {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  overflow: hidden !important;
  border-radius: 8px !important;
  background: #111 !important;
}

.sp-video-thumbnail video {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  pointer-events: none !important;
  background: #111 !important;
}

.sp-video-thumbnail::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.22), transparent 55%) !important;
  pointer-events: none !important;
}

.sp-thumbnail-duration {
  position: absolute !important;
  right: 5px !important;
  bottom: 5px !important;
  z-index: 3 !important;
  padding: 2px 5px !important;
  background: rgba(0, 0, 0, 0.84) !important;
  border-radius: 4px !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  direction: ltr !important;
}

.sp-thumb-play {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  z-index: 3 !important;
  width: 38px !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform: translate(-50%, -50%) scale(0.88) !important;
  opacity: 0 !important;
  background: rgba(0, 0, 0, 0.72) !important;
  border-radius: 50% !important;
  transition: opacity 0.2s ease, transform 0.2s ease !important;
}

.sp-video-item:hover .sp-thumb-play,
.sp-video-item.active .sp-thumb-play {
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1) !important;
}

.sp-thumb-play::before {
  content: "" !important;
  width: 0 !important;
  height: 0 !important;
  margin-left: 3px !important;
  border-top: 6px solid transparent !important;
  border-bottom: 6px solid transparent !important;
  border-left: 10px solid #fff !important;
}

.sp-video-item-info {
  min-width: 0 !important;
  padding-top: 2px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  direction: rtl !important;
}

.sp-video-item-title {
  width: 100% !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-align: right !important;
}

.sp-video-item-category {
  width: 100% !important;
  margin-top: 5px !important;
  color: #aaa !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  text-align: right !important;
}

body.translatepress-en_US .sp-video-item,
html.translatepress-en_US .sp-video-item {
  direction: ltr !important;
  text-align: left !important;
}

body.translatepress-en_US .sp-video-item-info,
html.translatepress-en_US .sp-video-item-info {
  direction: ltr !important;
}

body.translatepress-en_US .sp-video-item-title,
html.translatepress-en_US .sp-video-item-title,
body.translatepress-en_US .sp-video-item-category,
html.translatepress-en_US .sp-video-item-category {
  text-align: left !important;
}

.sp-video-item.active .sp-video-thumbnail {
  box-shadow: inset 0 0 0 2px var(--sp-red) !important;
}

.sp-videos-json {
  display: none !important;
}

.solarpro-videos-copy-en {
  display: none !important;
}

body.translatepress-en_US .solarpro-videos-copy-ar {
  display: none !important;
}

body.translatepress-en_US .solarpro-videos-copy-en {
  display: inline !important;
}

@media (max-width: 1100px) {
  .sp-youtube-layout {
    grid-template-columns: minmax(0, 1fr) 340px !important;
  }

  body.translatepress-en_US .sp-youtube-layout,
  html.translatepress-en_US .sp-youtube-layout {
    grid-template-columns: 340px minmax(0, 1fr) !important;
  }

  .sp-video-item {
    grid-template-columns: 140px minmax(0, 1fr) !important;
  }
}

@media (max-width: 850px) {
  .sp-youtube-gallery {
    padding: 0 0 30px !important;
  }

  .sp-youtube-layout,
  body.translatepress-en_US .sp-youtube-layout,
  html.translatepress-en_US .sp-youtube-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
  }

  .sp-playlist {
    display: contents !important;
    position: static !important;
  }

  .sp-playlist-heading {
    order: 1 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 22px 16px 16px !important;
    background: #000 !important;
    align-items: flex-end !important;
  }

  .sp-watch-area {
    order: 2 !important;
    width: 100% !important;
  }

  .sp-playlist-list {
    order: 3 !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 20px 12px 30px !important;
    background: #000 !important;
  }

  .sp-player {
    border-radius: 0 !important;
  }

  .sp-watch-info {
    padding: 14px 15px 0 !important;
  }

  .sp-video-item {
    grid-template-columns: minmax(145px, 42%) minmax(0, 1fr) !important;
    padding: 4px !important;
  }
}

@media (max-width: 600px) {
  .sp-playlist-heading {
    padding: 18px 14px 13px !important;
  }

  .sp-playlist-heading h3 {
    font-size: 22px !important;
    line-height: 1.2 !important;
  }

  .sp-section-subtitle {
    margin-bottom: 6px !important;
    gap: 8px !important;
  }

  .sp-subtitle-text {
    font-size: 11px !important;
  }

  .sp-subtitle-marks i {
    width: 4px !important;
    height: 10px !important;
  }

  .sp-video-count {
    font-size: 12px !important;
    padding-bottom: 2px !important;
  }

  .sp-watch-info h2 {
    font-size: 17px !important;
    line-height: 1.45 !important;
  }

  .sp-video-description {
    margin-top: 13px !important;
    padding: 13px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
  }

  .sp-video-item {
    grid-template-columns: 145px minmax(0, 1fr) !important;
    gap: 9px !important;
    padding: 4px !important;
  }

  .sp-video-item-title {
    font-size: 13px !important;
  }

  .sp-video-item-category {
    font-size: 11px !important;
  }
}

@media (max-width: 420px) {
  .sp-video-item {
    grid-template-columns: 130px minmax(0, 1fr) !important;
  }

  .sp-video-item-title {
    font-size: 12.5px !important;
  }
}
