/* Surprises in the demo feed (js/home/play.js): buttons that behave like X's */

.demo .browser {
  position: relative;
}

.demo .post__inner {
  position: relative;
}

.x-act {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.x-act[aria-pressed="true"] img {
  opacity: 1;
}

.x-act img {
  border-radius: 50%;
  transition: background-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

/* X's colour on hover: blue reply/share/bookmark, green repost, pink like */
.x-act--reply:hover,
.x-act--share:hover,
.x-act--bookmark:hover,
.x-act--more:hover {
  color: #1D9BF0;
}

.x-act--repost:hover,
.x-act--repost[aria-pressed="true"] {
  color: #00BA7C;
}

.x-act--like:hover,
.x-act--like[aria-pressed="true"] {
  color: #F91880;
}

.x-act--reply:hover img,
.x-act--share:hover img,
.x-act--bookmark:hover img,
.x-act--more:hover img {
  background: rgba(29, 155, 240, 0.12);
  box-shadow: 0 0 0 5px rgba(29, 155, 240, 0.12);
}

.x-act--repost:hover img {
  background: rgba(0, 186, 124, 0.12);
  box-shadow: 0 0 0 5px rgba(0, 186, 124, 0.12);
}

.x-act--like:hover img {
  background: rgba(249, 24, 128, 0.12);
  box-shadow: 0 0 0 5px rgba(249, 24, 128, 0.12);
}

.x-act:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 3px;
  border-radius: 4px;
}

.x-act.is-popping img {
  animation: act-pop 360ms cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes act-pop {
  0% { scale: 0.6; }
  60% { scale: 1.25; }
  100% { scale: 1; }
}

.x-act__spark {
  position: absolute;
  top: 50%;
  left: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #F91880;
  pointer-events: none;
}

.x-post__more.x-act,
.x-act--more {
  margin-left: auto;
}

.x-post__ad + .x-act--more {
  margin-left: 6px;
}

/* "Show more" opens the full post */
button.x-post__show-more {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

button.x-post__show-more:hover {
  text-decoration: underline;
}

.x-post__text.is-full {
  white-space: pre-line;
}

/* The play button and the real clip */
.x-post__video[role="button"] {
  cursor: pointer;
}

.x-post__video.is-playing::after {
  display: none;
}

.x-post__video video {
  display: block;
  object-fit: cover;
  background: var(--black);
}

/* Double-tap heart */
.feed-heart {
  position: absolute;
  z-index: 2;
  width: 72px;
  height: 72px;
  pointer-events: none;
  translate: none;
  transform: translate(-50%, -50%);
}

/* One toast at the bottom of the window */
.feed-toast {
  position: absolute;
  bottom: 20px;
  left: 50%;
  z-index: 3;
  max-width: calc(100% - 40px);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: #1D9BF0;
  color: var(--white);
  font-family: var(--font-x);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  translate: -50% 12px;
  transition: opacity 200ms var(--ease), translate 300ms var(--ease);
}

.feed-toast.is-on {
  opacity: 1;
  translate: -50% 0;
}

@media (prefers-reduced-motion: reduce) {
  .x-act.is-popping img {
    animation: none;
  }

  .feed-toast {
    transition: none;
  }
}
