/* =========================================================
   WILLIAM LOUEY — VIDEO CAROUSEL ONLY
   ========================================================= */


/* ---------------------------------------------------------
   VIDEO SECTION
   --------------------------------------------------------- */

.wl-video-section {
  padding: 160px 5vw 120px;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}


/* ---------------------------------------------------------
   HEADER LAYOUT
   --------------------------------------------------------- */

.wl-video-section__header {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.5fr);
  align-items: end;
  margin-bottom: 72px;
  gap: 8vw;
}


/* ---------------------------------------------------------
   CAROUSEL CONTROLS
   --------------------------------------------------------- */

.wl-video-controls {
  display: flex;
  align-items: center;
  margin-top: 34px;
  gap: 14px;
}

.wl-video-controls button {
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;

  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;

  background: transparent;
  color: #fff;

  font-size: 20px;

  transition:
    border-color 0.3s ease,
    background 0.3s ease,
    color 0.3s ease;
}

.wl-video-controls button:hover:not(:disabled) {
  border-color: #f3f1ec;
  background: #f3f1ec;
  color: #111;
}

.wl-video-controls button:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.wl-video-controls p {
  display: flex;
  min-width: 66px;
  margin: 0;
  justify-content: center;

  color: #77736b;

  font-size: 12px;
  letter-spacing: 0.12em;
}

.wl-video-controls strong {
  margin-right: 7px;
  color: #fff;
  font-weight: 500;
}


/* ---------------------------------------------------------
   HORIZONTAL VIDEO CAROUSEL
   --------------------------------------------------------- */

.wl-video-grid {
  display: grid;

  grid-auto-flow: column;
  grid-auto-columns: clamp(286px, 31vw, 430px);

  gap: 24px;
  align-items: flex-start;

  margin: 0 -5vw;
  padding: 0 5vw 32px;

  overflow-x: auto;

  overscroll-behavior-inline: contain;

  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;

  scrollbar-width: none;
}

.wl-video-grid::-webkit-scrollbar {
  display: none;
}


/* ---------------------------------------------------------
   VIDEO CARD
   --------------------------------------------------------- */

.wl-video-card {
  min-width: 0;

  scroll-snap-align: start;
  scroll-snap-stop: always;
}


/* ---------------------------------------------------------
   CARD ENTRANCE ANIMATION
   --------------------------------------------------------- */

.wl-video-card.wl-reveal {
  transform: translate3d(0, 64px, 0) scale(0.985);
}

.wl-video-card.wl-reveal.is-visible {
  transform: translate3d(0, 0, 0) scale(1);
}


/* ---------------------------------------------------------
   VIDEO / THUMBNAIL
   --------------------------------------------------------- */

.wl-video-card__media,
.wl-video-card__iframe {
  position: relative;

  display: block;

  width: 100%;
  aspect-ratio: 16 / 9;

  padding: 0;
  overflow: hidden;

  border: 0;

  background: #171717;

  clip-path: inset(0 0 12% 0);

  transform: translateY(16px);

  transition:
    clip-path 1.05s cubic-bezier(0.2, 0.7, 0.2, 1)
      var(--reveal-delay, 0ms),
    transform 0.75s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.75s ease;
}

.wl-video-card__media {
  cursor: pointer;
}


/* ---------------------------------------------------------
   VIDEO REVEAL
   --------------------------------------------------------- */

.wl-video-card.is-visible .wl-video-card__media,
.wl-video-card.is-visible .wl-video-card__iframe {
  clip-path: inset(0);
  transform: translateY(0);
}


/* ---------------------------------------------------------
   VIDEO HOVER
   --------------------------------------------------------- */

.wl-video-card.is-visible .wl-video-card__media:hover {
  transform: translateY(-7px);

  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.38);
}


/* ---------------------------------------------------------
   THUMBNAIL DARK OVERLAY
   --------------------------------------------------------- */

.wl-video-card__media::after {
  position: absolute;

  inset: 0;

  content: "";

  background:
    linear-gradient(
      180deg,
      transparent 52%,
      rgba(0, 0, 0, 0.34)
    );

  transition: background 0.45s ease;
}


/* ---------------------------------------------------------
   THUMBNAIL IMAGE
   --------------------------------------------------------- */

.wl-video-card__media img {
  width: 100%;
  height: 100%;

  object-fit: cover;

  transition:
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.wl-video-card.is-visible .wl-video-card__media img {
  animation:
    wl-image-settle
    1.1s
    cubic-bezier(0.2, 0.7, 0.2, 1)
    both;
}

.wl-video-card__media:hover img {
  transform: scale(1.035);
}


/* ---------------------------------------------------------
   IMAGE ENTRANCE ANIMATION
   --------------------------------------------------------- */

@keyframes wl-image-settle {
  from {
    transform: scale(1.055);
  }

  to {
    transform: scale(1);
  }
}


/* ---------------------------------------------------------
   PLAY BUTTON
   --------------------------------------------------------- */

.wl-video-card__play {
  position: absolute;

  bottom: 22px;
  left: 24px;

  z-index: 2;

  width: 62px;

  color: #fff;
}

.wl-video-card__play svg {
  display: block;

  width: 100%;

  fill: none;
}

.wl-video-card__play circle {
  stroke: currentColor;
}

.wl-video-card__play path {
  fill: currentColor;
}


/* ---------------------------------------------------------
   VIDEO CARD TEXT / META
   --------------------------------------------------------- */

.wl-video-card__copy {
  display: grid;

  grid-template-columns: 72px minmax(0, 1fr);

  padding-top: 22px;

  gap: 20px;

  opacity: 0;

  transform: translateY(14px);

  transition:
    opacity 0.65s ease
      calc(var(--reveal-delay, 0ms) + 180ms),

    transform 0.75s
      cubic-bezier(0.2, 0.7, 0.2, 1)
      calc(var(--reveal-delay, 0ms) + 180ms);
}

.wl-video-card.is-visible .wl-video-card__copy {
  opacity: 1;

  transform: translateY(0);
}


/* ---------------------------------------------------------
   FILM NUMBER
   --------------------------------------------------------- */

.wl-video-card__copy p {
  margin: 4px 0 0;

  color: #77736b;

  font-size: 12px;

  letter-spacing: 0.14em;

  text-transform: uppercase;
}


/* ---------------------------------------------------------
   VIDEO TITLE
   --------------------------------------------------------- */

.wl-video-card__copy h3 {
  margin: 0;

  color: #f2efe9;

  font-family: var(--tp-ff-marcellus);

  min-height: 2.3em;

  font-size: clamp(18px, 1.4vw, 27px);

  font-weight: 400;

  letter-spacing: -0.025em;

  line-height: 1.15;
}


/* ---------------------------------------------------------
   YOUTUBE LINK
   --------------------------------------------------------- */

.wl-video-card__copy a {
  grid-column: 2;

  width: fit-content;

  margin-top: 9px;

  color: #99948a;

  font-size: 13px;

  letter-spacing: 0.08em;

  text-transform: uppercase;
}

.wl-video-card__copy a:hover {
  color: #fff;
}



/* =====================================================
   FIX: PREVENT ASTRA / ELEMENTOR BUTTON STYLES
   FROM AFFECTING VIDEO CAROUSEL
   ===================================================== */

.wl-video-card__media {
    /* Remove Astra / Elementor button styling */
    appearance: none !important;
    -webkit-appearance: none !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 0 !important;

    background: #171717 !important;

    box-shadow: none !important;

    font-family: inherit !important;
    font-size: inherit !important;
    line-height: normal !important;

    text-align: initial !important;

    outline: none !important;
}

/* Keep the actual carousel media dimensions */
.wl-video-card__media {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;

    overflow: hidden !important;

    cursor: pointer !important;
}

/* Prevent Elementor/Astra image rules from distorting thumbnail */
.wl-video-card__media img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;

    max-width: none !important;
    margin: 0 !important;

    object-fit: cover !important;
}

/* Keep the iframe consistent with the thumbnail */
.wl-video-card__iframe {
    display: block !important;
    width: 100% !important;
    height: auto !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 0 !important;
}