/* Poster + play button shown in place of a Loom iframe until clicked.
   Pairs with loom-facade.js. */

/* The wrapper (.loom-video / .intro-video) owns the 16:9 aspect-ratio box;
   this fills it so the facade and the swapped-in iframe both inherit that
   height instead of collapsing to zero. */
.loom-embed {
  display: block;
  width: 100%;
  height: 100%;
}

.loom-facade {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  background-color: #000;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  transition: filter 0.2s;
}

.loom-facade:hover,
.loom-facade:focus-visible {
  filter: brightness(1.08);
  outline: none;
}

/* Scrim so a white play glyph stays legible over a bright poster frame. */
.loom-facade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  transition: background 0.2s;
}

.loom-facade:hover::after,
.loom-facade:focus-visible::after {
  background: rgba(0, 0, 0, 0.1);
}

.loom-facade-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  border-radius: 50%;
  background: rgba(77, 170, 255, 0.95);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s;
}

/* CSS triangle, nudged right of centre so it reads as optically centred. */
.loom-facade-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -13px 0 0 -8px;
  border-style: solid;
  border-width: 13px 0 13px 21px;
  border-color: transparent transparent transparent #fff;
}

.loom-facade:hover .loom-facade-play,
.loom-facade:focus-visible .loom-facade-play {
  transform: scale(1.08);
}

.loom-facade-duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.loom-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .loom-facade-play {
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
  }
  .loom-facade-play::before {
    margin: -11px 0 0 -7px;
    border-width: 11px 0 11px 18px;
  }
}
