/* Clips that play once on scroll (js/core/clip.js). A framed clip is a dark 16:9 picture of its own,
   so it sits in a rounded frame on light and dark sections alike. The frame holds the still picture
   the clip ends on; the clip lies over it and shows only while it plays. */

.mo-clip {
  max-width: 1040px;
  margin: var(--s-7) auto 0;
}

.mo-clip__frame {
  position: relative;
  overflow: clip;
  border-radius: var(--r-panel);
  aspect-ratio: 16 / 9;
  background: #050a14;
  /* Short: the frame is positioned, so its shadow is painted over whatever follows it. */
  box-shadow: 0 10px 24px -8px rgb(5 16 28 / 0.22);
}

.mo-clip__still {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mo-clip__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.mo-clip__video[data-mo-state='playing'] {
  opacity: 1;
}

/* A clip whose words are part of the picture, in Chinese: shown in the Chinese reading only
   (core/i18n.js sets the document's lang). */
.mo-clip--zh {
  display: none;
}

html[lang^='zh'] .mo-clip--zh {
  display: block;
}

/* On a phone or a small tablet the words inside such a clip are a few pixels high: it is left out
   there. This rule comes after the one above and must stay after it. */
@media (max-width: 900px) {
  html[lang^='zh'] .mo-clip--zh {
    display: none;
  }
}
