/* Newest-section hover preview (SoundCloud-like) — mifa.dinbo.de */

.js-hover-preview {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.js-hover-preview .cover-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  cursor: default;
}

.js-hover-preview .cover-wrap > img {
  transition: filter 0.25s ease, transform 0.35s ease;
  display: block;
  width: 100%;
}

/* Hover OR playing — overlay must appear as soon as mouse enters the card */
.js-hover-preview.is-previewing .cover-wrap > img,
.js-hover-preview:hover .cover-wrap > img {
  filter: brightness(0.42) saturate(0.8);
  transform: scale(1.03);
}

.js-hover-preview .play-icon {
  display: none !important;
}

.hover-preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  background: linear-gradient(
    to top,
    rgba(8, 8, 12, 0.88) 0%,
    rgba(8, 8, 12, 0.4) 48%,
    rgba(8, 8, 12, 0.08) 100%
  );
  border-radius: 14px;
  z-index: 3;
  direction: ltr;
  unicode-bidi: isolate;
}

.js-hover-preview.is-previewing .hover-preview-overlay,
.js-hover-preview:hover .hover-preview-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Kill sticky :hover on owl/transform clones after real leave */
.js-hover-preview.is-hover-left:hover .cover-wrap > img,
.js-hover-preview.is-hover-left .cover-wrap > img {
  filter: none;
  transform: none;
}
.js-hover-preview.is-hover-left:hover .hover-preview-overlay,
.js-hover-preview.is-hover-left .hover-preview-overlay {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Top of cover (above waveform) → open track */
.hover-preview-overlay .sc-open-hit {
  flex: 1 1 auto;
  min-height: 42%;
  display: block;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
}

.hover-preview-overlay .sc-player {
  flex: 0 0 auto;
  padding: 8px 12px 14px;
  cursor: default;
}

.hover-preview-overlay .sc-wave {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 2px;
  height: 56px;
  width: 100%;
  margin-bottom: 8px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  direction: ltr;
}

.hover-preview-overlay .sc-wave span {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.28);
  transition: background 0.12s ease, height 0.05s linear;
  transform-origin: bottom center;
}

.js-hover-preview.is-previewing .hover-preview-overlay .sc-wave span {
  background: rgba(255, 153, 20, 0.32);
}

.hover-preview-overlay .sc-wave span.is-played {
  background: linear-gradient(180deg, #ffc266, #ff9914);
}

.hover-preview-overlay .sc-progress {
  position: relative;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
  direction: ltr;
}

.hover-preview-overlay .sc-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff9f1a, #f5c518);
  border-radius: 999px;
}

.hover-preview-overlay .sc-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

.hover-preview-overlay .sc-meta .sc-time,
.hover-preview-overlay .sc-meta .sc-total {
  flex: 0 0 auto;
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* Center play/pause icon (replaces old Preview / «کلیک برای پخش» text) */
.hover-preview-overlay .sc-meta .sc-play-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: 0;
  cursor: pointer;
  color: #1a1208;
  background: linear-gradient(145deg, #ffb347 0%, #ff9914 55%, #f07a00 100%);
  border-radius: 50%;
  padding: 0;
  box-shadow: 0 4px 14px rgba(255, 153, 20, 0.45);
  pointer-events: auto;
  position: relative;
  z-index: 6;
  line-height: 0;
}

.hover-preview-overlay .sc-meta .sc-play-btn svg {
  display: block;
  flex-shrink: 0;
}

.hover-preview-overlay .sc-meta .sc-play-btn .is-hidden {
  display: none !important;
}

.hover-preview-overlay .sc-meta .sc-play-btn:hover {
  background: linear-gradient(145deg, #ffc266 0%, #ff9914 50%, #ff8a00 100%);
}

.hover-preview-overlay .sc-meta .sc-play-btn.is-playing {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 2px rgba(255, 153, 20, 0.65);
}

/* Title/artist below cover = still opens track */
.js-hover-preview > a.card-body-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.js-hover-preview > a.card-body-link:hover {
  text-decoration: none;
}

.owl-carousel.new-objects .item {
  padding-bottom: 2px;
}

/* Mobile: bigger play CTA + always-usable overlay without hover */
@media (hover: none), (max-width: 767.98px) {
  .js-hover-preview.is-previewing .hover-preview-overlay,
  .js-hover-preview.is-touch-open .hover-preview-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .hover-preview-overlay .sc-meta .sc-play-btn {
    width: 44px;
    height: 44px;
  }

  .hover-preview-overlay .sc-meta .sc-play-btn svg {
    width: 22px;
    height: 22px;
  }

  .hover-preview-overlay .sc-wave {
    height: 48px;
  }
}
