.c-hero__img.has-video-desktop,
.c-hero__img.has-video-mobile,
.c-search-hero__bg.has-video-desktop,
.c-search-hero__bg.has-video-mobile {
  background-color: #25303b;
}

@media (min-width: 960px) {
  .c-hero__img.has-video-desktop > img,
  .c-search-hero__bg.has-video-desktop > img {
    opacity: 0;
  }
}

.c-hero__img .c-hero__background-video,
.c-search-hero__bg .c-hero__background-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.c-hero__img .c-hero__background-video.is-playing,
.c-search-hero__bg .c-hero__background-video.is-playing {
  opacity: 1;
}

/* Keep the image overlay for fallbacks, but show the video without darkening. */
@media (prefers-reduced-motion: no-preference) {
  .c-hero__img > .c-hero__background-video.is-playing ~ .c-hero__img-bleed {
    background: none;
  }
}

.c-hero__video-toggle {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffe500;
  color: #172532;
  cursor: pointer;
}

/* The extended Hero's contact strip occupies the bottom 75px of the section. */
.c-hero--extended > .c-hero__video-toggle {
  bottom: 95px;
}

.c-hero__video-toggle::before,
.c-hero__video-toggle::after {
  content: '';
  display: block;
  width: 3px;
  height: 16px;
  background: currentColor;
}

.c-hero__video-toggle::before {
  margin-right: 4px;
}

.c-hero__video-toggle.is-paused::before {
  width: 0;
  height: 0;
  margin: 0 0 0 4px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid currentColor;
  background: transparent;
}

.c-hero__video-toggle.is-paused::after {
  display: none;
}

.c-hero__video-toggle[hidden] {
  display: none;
}

.c-hero__video-toggle:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (max-width: 959px) {
  .c-hero__img.has-video-mobile > img,
  .c-search-hero__bg.has-video-mobile > img {
    opacity: 0;
  }

  .c-hero.c-hero--full {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  }

  .c-hero.c-hero--full.c-hero--extended {
    min-height: calc(100svh + 90px);
  }

  .c-hero .c-hero__video-toggle {
    top: auto;
    right: 16px;
    bottom: 20px;
  }

  .c-hero--extended > .c-hero__video-toggle {
    bottom: 95px;
  }

  .c-search-hero .c-hero__video-toggle {
    position: relative;
    right: auto;
    bottom: auto;
    margin: 12px 16px 16px auto;
  }
}

.c-hero__img.is-video-fallback > img,
.c-search-hero__bg.is-video-fallback > img {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .c-hero__img.has-video-desktop > img,
  .c-hero__img.has-video-mobile > img,
  .c-search-hero__bg.has-video-desktop > img,
  .c-search-hero__bg.has-video-mobile > img {
    opacity: 1;
  }

  .c-hero__img .c-hero__background-video,
  .c-search-hero__bg .c-hero__background-video {
    display: none;
  }
}
