/* ------------------------ */
/*        FILMTV           */
/* ------------------------ */

.filmtv-section {
  position: relative;
  height: 100vh;
  width: 100%;
  perspective: 1600px;
  display: block;
  touch-action: pan-y;
  overflow: hidden;
}

.carousel {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ------------------------ */
/*        POSTERS           */
/* ------------------------ */

.poster {
  position: absolute;
  top: 50%;
  left: 50%;

  width: 260px;
  height: 390px;

  transform-origin: center;
  will-change: transform;

  margin: 0;
  padding: 0;

  transform-style: preserve-3d;
  cursor: pointer;

  opacity: 1;
  filter: none;

  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.poster:focus-visible {
  outline: 2px solid #111;
  outline-offset: 4px;
  border-radius: 10px;
}

/* image */
.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;

  border-radius: 10px;

  backface-visibility: hidden;

  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

/* ------------------------ */
/*   DIM OVERLAY (non-active) */
/* ------------------------ */

.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: rgba(10, 10, 10, 0.55);
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 2;
}

.poster.active::before {
  opacity: 0;
}

/* ------------------------ */
/*   ACTIVE STATE            */
/* ------------------------ */

.poster.active {
  z-index: 999;
}

/* ------------------------ */
/*   REFLECTION              */
/* ------------------------ */

.poster::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;

  width: 100%;
  height: 100%;

  border-radius: 10px;

  background-image: var(--img);
  background-size: cover;
  background-position: center;

  transform: scaleY(-1);

  opacity: 0.10;
  filter: blur(2px);

  mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,0.35),
    transparent 75%
  );

  pointer-events: none;
}

/* ------------------------ */
/*   SAFETY RESET             */
/* ------------------------ */

.carousel,
.carousel-track,
.filmtv-section {
  transform: none !important;
}

/* ------------------------ */
/*   META (title / director / festival) */
/* ------------------------ */

.poster .meta {
  position: relative;
  margin-top: 16px;
  text-align: center;

  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(12px);
  transition: opacity 200ms ease, transform 200ms ease, visibility 0s linear 200ms;
}

.poster.active .meta {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(1px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.poster .meta h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

/* override style.css's global ".director { display: none }" rule,
   which was written for the project-archive page and unintentionally
   hides these same-named classes here too */
.poster .meta .director {
  display: block !important;
  color: #111;
}

/* ------------------------ */
/*   DOTS                    */
/* ------------------------ */

.carousel-dots {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 1000;
}

/* dark dots: site background is light (--pageBG), not black */
.carousel-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.carousel-dots .dot.active {
  background: #111;
  transform: scale(1.5);
}

.carousel-dots .dot:focus-visible {
  outline: 1px solid #111;
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .poster {
    width: 180px;
    height: 270px;
  }
}
