/* Feed "Explore" CTA, the magic version: violet > pink > orange gradient and a
   sparkle. One element (utils/chart_creator.py
   _build_video_chart_link, inline=True) in two shapes: a pill in the scroll
   post card's action row, a round button with the label under it in the
   /reels rail. Loads after zz_statspoint.css / zz_reels_viewer.css so it wins
   equal-specificity ties. Motion runs only with .is-inview
   (assets/explore_cta_motion.js); reduced motion keeps the static gradient. */

:root {
  /* Horizontal and ending on its first colour: the 300%-wide tile then repeats with no
     seam while it flows. An angled gradient has different colours on the tile's two
     edges, which showed as a hard vertical line. */
  --sp-explore-magic: linear-gradient(90deg, #7a4dff, #ff3d7f, var(--sp-accent, #ff7a2b), #7a4dff);
}

@keyframes sp-explore-flow {
  to { background-position: -300% 0; }
}

/* ---- scroll mode: the pill in the post card's action row ------------------ */
:is(#main-feed-shell.main-feed-page-shell, #detail-feed-shell.detail-page-shell) .sp-feed-post__explore,
:is(#main-feed-shell.main-feed-page-shell, #detail-feed-shell.detail-page-shell) .sp-feed-post__explore:hover,
:is(#main-feed-shell.main-feed-page-shell, #detail-feed-shell.detail-page-shell) .sp-feed-post__explore:active,
#main-feed-shell.main-feed-page-shell .sp-feed-post__explore,
#main-feed-shell.main-feed-page-shell .sp-feed-post__explore:hover {
  min-height: 32px;
  padding: 0 13px 0 11px;
  gap: 6px;
  border-color: transparent;
  background: var(--sp-explore-magic);
  background-size: 300% 100%;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 3px 12px rgba(255, 61, 127, 0.3);
}

:is(#main-feed-shell.main-feed-page-shell, #detail-feed-shell.detail-page-shell) .sp-feed-post__explore:hover {
  filter: brightness(1.1);
}

:is(#main-feed-shell.main-feed-page-shell, #detail-feed-shell.detail-page-shell) .sp-feed-post__explore:active {
  filter: brightness(0.94);
  transform: scale(0.97);
}

:is(#main-feed-shell.main-feed-page-shell, #detail-feed-shell.detail-page-shell) .sp-feed-post__explore .sp-feed-post__explore-icon {
  width: 16px;
  height: 16px;
}

:is(#main-feed-shell.main-feed-page-shell, #detail-feed-shell.detail-page-shell) .sp-feed-post__explore.is-inview {
  animation: sp-explore-flow 6s linear infinite;
}

/* ---- /reels: the rail item, a round button with the label under it -------- */
.sp-reels-viewer .sp-reel__rail .sp-feed-post__explore {
  gap: 6px;
}

.sp-reels-viewer .sp-reel__rail .sp-card-chart-link .sp-feed-post__explore-icon {
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 50%;
  color: #fff;
  background: var(--sp-explore-magic) 0 0 / 300% 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 3px 12px rgba(255, 61, 127, 0.45);
}

.sp-reels-viewer .sp-reel__rail .sp-feed-post__explore.is-inview .sp-feed-post__explore-icon {
  animation: sp-explore-flow 6s linear infinite;
}


/* ---- opening state: keep the feedback of assets/explore_navigation_feedback.css ---- */
/* the rail keeps its round button while opening; only the label turns into "Opening…" */
.sp-reels-viewer .sp-reel__rail .sp-card-chart-link.sp-explore-opening .sp-feed-post__explore-icon {
  display: block;
}

.sp-reels-viewer .sp-reel__rail .sp-feed-post__explore.sp-explore-opening::before {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .sp-feed-post__explore.is-inview,
  .sp-feed-post__explore.is-inview .sp-feed-post__explore-icon {
    animation: none !important;
  }
}
