/* Game trailer in a «screen»: a self-hosted video that plays silently in a
   loop while it is on screen, with a button to hear it from the start. Used by
   the social&games band on the home page and by news with a `video:`. */
.trailer {
  --trailer-ink: #14141c;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 4px solid var(--trailer-ink);
  border-radius: 14px;
  background: #000;
  box-shadow: 10px 12px 0 var(--trailer-ink);
}
.trailer video { display: block; width: 100%; height: 100%; object-fit: cover; }

.trailer-sound {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px 8px 11px;
  border: 0;
  border-radius: 999px;
  background: rgb(0 0 0 / .62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.trailer-sound:hover { background: var(--pink, #ea1d76); transform: translateY(-2px); }
.trailer-sound:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.trailer-sound svg { width: 20px; height: 20px; flex: none; }
.trailer-sound .is-on { display: none; }
.trailer-sound[aria-pressed="true"] .is-on { display: block; }
.trailer-sound[aria-pressed="true"] .is-off { display: none; }
/* With the browser's own controls (no autoplay), the button is not needed. */
.trailer.has-controls .trailer-sound { display: none; }

@media (max-width: 480px) {
  .trailer { border-width: 3px; border-radius: 10px; box-shadow: 6px 8px 0 var(--trailer-ink); }
  .trailer-sound { right: 8px; bottom: 8px; min-height: 36px; padding: 6px 11px 6px 9px; font-size: 12px; }
}
