/* Cinemafreak trailer player and overlay */

.cf-trailer { --cf-orange: #F59C2D; --cf-cream: #F8F2E7; --cf-sand: #FAD59F; max-width: 1100px; }

.cf-trailer__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid rgba(0, 0, 0, .8);
  border-radius: 4px;
  overflow: hidden;
}

.cf-trailer__frame iframe,
.cf-trailer-modal__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

/* The still with the play button. Everything is set explicitly, the site styles all buttons. */
.cf-trailer .cf-trailer__play,
.cf-trailer .cf-trailer__play:hover,
.cf-trailer .cf-trailer__play:focus {
  position: absolute; inset: 0;
  display: block; width: 100%; height: 100%;
  margin: 0; padding: 0;
  background: #000; border: 0; border-radius: 0; box-shadow: none;
  color: var(--cf-cream); text-align: left; cursor: pointer;
}

.cf-trailer__img {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important; max-width: none;
  object-fit: cover;
  opacity: .82;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1), opacity .3s;
}

.cf-trailer__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(20, 0, 0, .92) 0%, rgba(20, 0, 0, .35) 38%, rgba(0, 0, 0, 0) 62%),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .55) 100%);
}

.cf-trailer__icon {
  position: absolute; left: 50%; top: 50%;
  width: 76px; height: 76px; margin: -38px 0 0 -38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cf-orange); color: #1a0000;
  border-radius: 50%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .55);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), background-color .2s;
}
.cf-trailer__icon svg { margin-left: 3px; }

.cf-trailer__meta { position: absolute; left: 22px; right: 22px; bottom: 18px; display: block; }

.cf-trailer__label,
.cf-trailer-modal__label {
  display: block;
  font-family: "Roboto Condensed", Roboto, Arial, sans-serif;
  font-size: 13px; line-height: 1; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--cf-orange);
}

.cf-trailer__title,
.cf-trailer-modal__title {
  display: block; margin-top: 7px;
  font-family: Domine, Georgia, serif;
  font-size: clamp(18px, 2.4vw, 26px); line-height: 1.2; font-weight: 700;
  color: var(--cf-cream);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}

.cf-trailer__play:hover .cf-trailer__img,
.cf-trailer__play:focus-visible .cf-trailer__img { transform: scale(1.04); opacity: 1; }
.cf-trailer__play:hover .cf-trailer__icon,
.cf-trailer__play:focus-visible .cf-trailer__icon { transform: scale(1.08); background: var(--cf-sand); }
.cf-trailer .cf-trailer__play:focus-visible { outline: 2px solid var(--cf-orange); outline-offset: -4px; }

/* Bar under the player */
.cf-trailer__bar { display: flex; justify-content: flex-end; margin-top: 10px; }

.cf-trailer .cf-trailer__expand,
.cf-trailer-modal .cf-trailer-modal__close {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0; padding: 9px 14px;
  background: rgba(0, 0, 0, .5); color: var(--cf-cream, #F8F2E7);
  border: 1px solid rgba(0, 0, 0, .8); border-radius: 4px; box-shadow: none;
  font-family: "Roboto Condensed", Roboto, Arial, sans-serif;
  font-size: 15px; line-height: 1; font-weight: 400; letter-spacing: .04em; text-transform: none;
  cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.cf-trailer .cf-trailer__expand:hover,
.cf-trailer .cf-trailer__expand:focus-visible,
.cf-trailer-modal .cf-trailer-modal__close:hover,
.cf-trailer-modal .cf-trailer-modal__close:focus-visible {
  background: rgba(0, 0, 0, .7); color: #F59C2D; border-color: #F59C2D; outline: 0;
}

/* Overlay */
.cf-trailer-modal {
  --cf-orange: #F59C2D; --cf-cream: #F8F2E7;
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(12, 0, 0, .94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility 0s linear .25s;
}
.cf-trailer-modal.is-open { opacity: 1; visibility: visible; transition: opacity .25s, visibility 0s; }

.cf-trailer-modal__inner {
  /* as large as fits: limited by the width and by the height of the screen */
  width: min(1400px, 100%, calc((100vh - 150px) * 16 / 9));
  transform: translateY(12px) scale(.98);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.cf-trailer-modal.is-open .cf-trailer-modal__inner { transform: none; }

.cf-trailer-modal__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.cf-trailer-modal__title { text-shadow: none; }

.cf-trailer-modal__frame {
  position: relative; aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid rgba(0, 0, 0, .8); border-radius: 4px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .7);
}

html.cf-trailer-lock, html.cf-trailer-lock body { overflow: hidden; }

@media (max-width: 600px) {
  .cf-trailer__icon { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
  .cf-trailer__meta { left: 14px; right: 14px; bottom: 12px; }
  .cf-trailer-modal { padding: 12px; }
  .cf-trailer-modal__head { align-items: center; }
  .cf-trailer-modal__close span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cf-trailer__img, .cf-trailer__icon, .cf-trailer-modal, .cf-trailer-modal__inner { transition: none; }
}
