/* ── Case-study hero film ──────────────────────────────────────────────
   A play button layered on the case-study hero image, opening a full
   screen player with the same reveal used on the BlackYouthCan.ca launch
   site (see launch-site/index.html, Webflow interactions a-4 / a-5).

   The styles below are a port of the launch site's `.play-icon`,
   `.lightbox`, `.yt-video` and `.close-video` rules. The launch site keeps
   its own copy inside its Webflow stylesheet, so the two can drift; if the
   launch site's player is restyled, this file has to be updated by hand.

   Nothing here applies unless js/hero-film.js finds a film on the hero, so
   a case study without a video renders exactly as it did before. */

/* The play button is mounted into `.projects-template-image-wrapper`,
   which is already `position: absolute` and clips the hero, so the button
   shares a positioning context with the hero image.

   The 50%/50% below is only a starting point. js/hero-film.js measures the
   image and writes an exact `top`/`left` over it, because the hero image
   carries its own padding and negative margins and is taller than the
   wrapper — the wrapper's middle is not the photo's middle. */
.hero-film-play {
  z-index: 4;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  line-height: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hero-film-play-icon {
  width: 80px;
  max-width: 100%;
  transition: opacity .35s;
  display: block;
}

.hero-film-play:hover .hero-film-play-icon,
.hero-film-play:focus-visible .hero-film-play-icon {
  opacity: .8;
}

/* Reveal: the panel slides up from below over 750ms (`inOutQuint`, which
   is cubic-bezier(.86,0,.07,1) in CSS terms), then the video fades in over
   500ms. Closing sends the panel up and out while the video fades, which
   is what the launch site does — it does not slide back down. */
/* The launch site puts its lightbox at z-index 1000, but the portfolio's
   fixed navbar and page-transition curtain sit as high as 999999, and the
   navbar was swallowing clicks on the close button. This has to clear
   everything on the page. */
.hero-film-lightbox {
  z-index: 1000001;
  background-color: #0c0b0b;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  row-gap: 42px;
  padding-top: 42px;
  padding-bottom: 42px;
  display: none;
  position: fixed;
  inset: 0;
  transform: translateY(100%);
  transition: transform .75s cubic-bezier(.86, 0, .07, 1);
}

.hero-film-lightbox.is-open {
  transform: translateY(0);
}

.hero-film-lightbox.is-closing {
  transform: translateY(-100%);
}

.hero-film-stage {
  flex: 1;
  width: 80%;
  min-height: 0;
  opacity: 0;
  transition: opacity .5s ease;
}

/* The fade waits for the slide to finish on the way in, and runs straight
   away on the way out. */
.hero-film-lightbox.is-open .hero-film-stage {
  opacity: 1;
  transition-delay: .75s;
}

.hero-film-video {
  width: 100%;
  height: 100%;
  background-color: #000;
  object-fit: contain;
  display: block;
}

.hero-film-title {
  color: #fff;
  text-align: center;
  padding-left: 20px;
  padding-right: 20px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.hero-film-close {
  color: #fff;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  font-size: 64px;
  font-weight: 400;
  line-height: .5;
  text-decoration: none;
  transition: opacity .35s;
  position: absolute;
  top: 3%;
  right: 1%;
}

.hero-film-close:hover,
.hero-film-close:focus-visible {
  opacity: .7;
}

@media screen and (max-width: 991px) {
  .hero-film-play-icon {
    width: 50px;
  }
}

@media screen and (max-width: 767px) {
  .hero-film-play-icon {
    width: 40px;
  }

  .hero-film-stage {
    width: 92%;
  }

  .hero-film-close {
    font-size: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-film-lightbox,
  .hero-film-stage {
    transition-duration: .01ms;
  }
}
