/* =====================================================================================
   Videos: trip videos, one per screen, scrolled like reels (views/videos.js).
   Always dark, like Ideas and stories. The verified shield is .clip__shield (base.css).
   ===================================================================================== */

body[data-route='videos'] {
  overflow: hidden;
}
/* Opacity only: a transform on the page would break the fixed feed. */
body[data-route='videos'] .page--enter {
  animation-name: fade-in;
}
body[data-route='videos'] .verify-banner {
  display: none;
}
@media (max-width: 1023.98px) {
  body[data-route='videos'] .topbar {
    display: none;
  }
}
html.vx-open,
html.vx-open body {
  overflow: hidden;
  overscroll-behavior: none;
}
body[data-route='videos'] .toasts {
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
}

.vx {
  position: fixed;
  z-index: 1;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-b));
  background: #000;
  color: #fff;
  color-scheme: dark;
}
.vx :focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.vx__head {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: calc(var(--safe-t) + 6px) calc(8px + var(--safe-r)) 18px calc(8px + var(--safe-l));
  background: linear-gradient(rgb(0 0 0 / 0.5), transparent);
  pointer-events: none;
}
.vx__head > * {
  pointer-events: auto;
}
.vx__title {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.5);
  pointer-events: none;
}
.vx__btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none !important;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.5));
}
.vx__btn:active {
  transform: scale(0.92);
}

/* ---------- The feed: one screen per video ---------- */
.vx__feed {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.vx__feed::-webkit-scrollbar {
  display: none;
}
.vx__item,
.vx__note {
  position: relative;
  height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.vx__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
/* 4:3 and square videos: the whole picture, on a blurred copy of the cover. */
.vx__item--fit .vx__video {
  object-fit: contain;
  background: transparent;
}
.vx__backdrop {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  filter: blur(28px) brightness(0.45);
}
/* Shade under the words and buttons, so they read on any video. */
.vx__item::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.6));
  pointer-events: none;
}
.vx__tap {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.vx__paused {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.35);
  color: #fff;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition:
    opacity var(--dur-2) var(--ease),
    transform var(--dur-2) var(--ease);
  pointer-events: none;
}
.vx__item.is-paused .vx__paused {
  opacity: 1;
  transform: translate(-50%, -50%);
}

/* ---------- Who, where and the caption (bottom left) ---------- */
.vx__info {
  position: absolute;
  z-index: 2;
  left: calc(14px + var(--safe-l));
  right: 84px;
  bottom: 18px;
  display: grid;
  gap: 6px;
  justify-items: start;
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.6);
}
.vx__who,
.vx__place {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  color: #fff;
  text-decoration: none !important;
}
.vx__who {
  font-size: 15px;
  font-weight: 800;
}
.vx__who > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vx__place {
  gap: 4px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 700;
  text-shadow: none;
}
.vx__caption {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

/* ---------- Like, comments, share and sound (right side, above the shield) ---------- */
.vx__rail {
  position: absolute;
  z-index: 2;
  right: calc(8px + var(--safe-r));
  bottom: 64px;
  display: grid;
  gap: 14px;
  justify-items: center;
}
.vx__act {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 52px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.55));
}
.vx__act:active {
  transform: scale(0.9);
}
.vx__like .vx__heart-on,
.vx__like[aria-pressed='true'] .vx__heart-off {
  display: none;
}
.vx__like[aria-pressed='true'] .vx__heart-on {
  display: block;
  color: #ff3b6b;
}
.vx__sound {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.16);
}
.vx__sound[aria-pressed='false'] .icon:last-child,
.vx__sound[aria-pressed='true'] .icon:first-child {
  display: none;
}
.vx__shield {
  bottom: 16px;
  right: calc(16px + var(--safe-r));
}

/* ---------- Loading, empty and the end ---------- */
.vx__note {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: #fff;
}
.vx__note h2 {
  margin: 0;
  font-size: 22px;
}
.vx__note p {
  max-width: 300px;
  margin: 0;
  color: #c9c6c7;
}
.vx__noteicon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.1);
}

/* ---------- Computers: a centred phone-shaped column ---------- */
@media (min-width: 1024px) {
  .vx {
    bottom: 0;
  }
  .vx__item,
  .vx__note {
    width: min(100%, calc((100dvh - 32px) * 9 / 16));
    height: calc(100% - 32px);
    margin: 16px auto;
    scroll-margin-top: 16px;
    border-radius: 18px;
  }
  .vx__head {
    left: 50%;
    right: auto;
    top: 16px;
    width: min(100%, calc((100dvh - 32px) * 9 / 16));
    padding: 6px 8px 18px;
    border-radius: 18px 18px 0 0;
    transform: translateX(-50%);
  }
  body[data-route='videos'] .toasts {
    bottom: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vx__paused {
    transition: none;
  }
}

/* ---------- The "Ideas and Videos" chooser and the switched-off page (discover.js) ---------- */
.discover__intro {
  margin: 0 0 12px;
  color: var(--text-2);
}
.discover-sheet .option.is-active {
  background: var(--surface-2);
}
.discover__tick {
  margin-left: auto;
  color: var(--brand);
}
.discover-off {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 420px;
  margin: 48px auto;
  padding: 24px;
  text-align: center;
}
.discover-off h1 {
  margin: 0;
  font-size: 24px;
}
.discover-off p {
  margin: 0;
  color: var(--text-2);
}
.discover-off__icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--brand);
}
