/*
 * FindRoute public video embed (pairs with /js/findroute-video-embed.js).
 * Regular video: 16:9, full content width. Shorts: 9:16, centered, max ~390px on PC,
 * screen width on mobile (capped so the whole player fits in the viewport).
 * Space is reserved with aspect-ratio before the thumbnail/iframe loads (no layout shift).
 */
.fr-video-embed {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 24px auto;
  padding: 0;
}

.fr-video-embed--shorts {
  max-width: min(100%, 390px);
}

.fr-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0f1a1d;
  border-radius: 16px;
  contain: layout paint;
}

.fr-video-embed--shorts .fr-video-frame {
  aspect-ratio: 9 / 16;
}

/* Fallback for browsers without aspect-ratio support. */
@supports not (aspect-ratio: 1 / 1) {
  .fr-video-frame { height: 0; padding-bottom: 56.25%; }
  .fr-video-embed--shorts .fr-video-frame { padding-bottom: 177.7778%; }
}

.fr-video-facade,
.fr-video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Server placeholder before JS runs (or without JS): centered link inside the reserved box. */
.fr-video-frame > a {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: #fff;
  font-weight: 600;
  text-align: center;
  text-decoration: underline;
}

.fr-video-facade {
  display: block;
  margin: 0;
  padding: 0;
  color: #fff;
  font: inherit;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fr-video-facade:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -6px;
  box-shadow: inset 0 0 0 6px #0b6573;
}

/* Higher specificity than `.rich-content img` (display/margin/height rules). */
.fr-video-embed .fr-video-thumb {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
}

.fr-video-embed .fr-video-thumb[hidden] {
  display: none;
}

.fr-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 68px;
  height: 48px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.fr-video-play svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
}

.fr-video-play-plate {
  fill: #212121;
  fill-opacity: .8;
  transition: fill .15s ease, fill-opacity .15s ease;
}

.fr-video-play-arrow {
  fill: #fff;
}

.fr-video-facade:hover .fr-video-play-plate,
.fr-video-facade:focus-visible .fr-video-play-plate {
  fill: #ff0033;
  fill-opacity: 1;
}

.fr-video-caption {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.fr-video-caption a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 767px) {
  .fr-video-embed {
    margin: 20px auto;
  }

  .fr-video-frame {
    border-radius: 12px;
  }

  /* Screen width, but never taller than the visible viewport (minus header/action bar). */
  .fr-video-embed--shorts {
    max-width: min(100%, calc((100vh - 140px) * 9 / 16));
    max-width: min(100%, calc((100svh - 140px) * 9 / 16));
  }
}

@media (prefers-reduced-motion: reduce) {
  .fr-video-play-plate {
    transition: none;
  }
}
