/* values follow the live AEM bannerwithslider on the wood finish page; desktop layout from 992px like the live site */

/* full page width, no section spacing above the banner */
main > .section.banner-video-container:has(.banner-video) {
  margin: 0 0 25px;
  padding: 0;
  text-align: left;
}

main > .section > div:has(> .banner-video) {
  max-width: none;
  padding: 0;
}

.banner-video {
  position: relative;
}

/* slides sit on top of each other and fade */
.banner-video .banner-video-slides {
  display: grid;
}

.banner-video .banner-video-slide {
  position: relative;
  grid-area: 1 / 1;
  height: 502px;
  overflow: hidden;
}

.banner-video.is-slider .banner-video-slide {
  opacity: 0;
  visibility: hidden;
  transition: opacity 2s ease, visibility 2s;
}

.banner-video.is-slider .banner-video-slide.is-active {
  opacity: 1;
  visibility: visible;
}

.banner-video .banner-video-link {
  position: absolute;
  inset: 0;
  display: block;
}

/* 20% dark overlay over the video, under the text and button */
.banner-video .banner-video-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgb(0 0 0 / 20%);
  pointer-events: none;
}

.banner-video .banner-video-image,
.banner-video .banner-video-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.banner-video .banner-video-image img,
.banner-video .banner-video-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* video shows once it is playing, the image stays as poster until then */
.banner-video .banner-video-video {
  opacity: 0;
}

.banner-video .banner-video-slide.is-playing .banner-video-video {
  opacity: 1;
}

/* text image, mobile: top left at 38% / 28% */
.banner-video .banner-video-text {
  position: absolute;
  top: var(--text-mobile-top, 38%);
  left: var(--text-mobile-left, 28%);
  z-index: 2;
}

.banner-video .banner-video-text img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

/* CTA button, mobile: 57% / 37% */
.banner-video .banner-video-cta {
  position: absolute;
  top: var(--cta-mobile-top, 57%);
  left: var(--cta-mobile-left, 37%);
  z-index: 2;
}

.banner-video .banner-video-cta a {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 6px 16px;
  border: 1px solid #fff;
  border-radius: 45px;
  background: transparent;
  color: #fff;
  font-size: clamp(14px, 1vw, 16px);
  font-weight: 700;
  line-height: 22px;
  text-decoration: none;
  white-space: nowrap;
}

.banner-video .banner-video-cta a:hover,
.banner-video .banner-video-cta a:focus-visible {
  border-color: #232426;
  background: #fff7e8;
  color: #000;
  text-decoration: none;
}

/* arrow takes the text colour: white, black on hover */
.banner-video .banner-video-arrow {
  display: flex;
  flex: none;
  width: 17px;
  height: 17px;
  background-color: currentcolor;
  mask: url("../../icons/arrow-right.svg") center / 100% 100% no-repeat;
}

/* slider dots in a white pill, 30px from the bottom */
.banner-video .banner-video-nav {
  position: absolute;
  bottom: 30px;
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  height: 16px;
  padding: 3px 5px 5px;
  border-radius: 40px;
  background: #fff;
  transform: translateX(-50%);
}

.banner-video .banner-video-prev,
.banner-video .banner-video-next {
  display: none;
}

.banner-video .banner-video-dot {
  width: 6px;
  height: 6px;
  margin: 0 5px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #8c8e90;
  cursor: pointer;
}

.banner-video .banner-video-dot[aria-current="true"] {
  width: 24px;
  border-radius: 30px;
  background: #4c4e52;
}

@media (width >= 992px) {
  main > .section.banner-video-container:has(.banner-video) {
    margin-bottom: 50px;
  }

  /* height follows the video (1920 x 658 on the live page) */
  .banner-video .banner-video-slide {
    height: auto;
    aspect-ratio: var(--banner-ratio, 1920 / 658);
  }

  /* text image centred on 30% / 50%, 373px wide */
  .banner-video .banner-video-text {
    top: var(--text-desktop-top, 30%);
    left: var(--text-desktop-left, 50%);
    transform: translate(-50%, -50%);
  }

  .banner-video .banner-video-text img {
    width: 373px;
  }

  .banner-video .banner-video-cta {
    top: var(--cta-desktop-top, 50%);
    left: var(--cta-desktop-left, 43%);
  }

  .banner-video .banner-video-cta a {
    min-height: 44px;
    padding: 14px 20px;
    font-size: clamp(16px, 1vw, 20px);
  }

  .banner-video .banner-video-nav {
    height: auto;
    padding: 8px 12px;
    border-radius: 30px;
  }

  .banner-video .banner-video-prev,
  .banner-video .banner-video-next {
    display: block;
    width: 16px;
    height: 16px;
    margin: 0 8px 0 0;
    padding: 0;
    border: 0;
    background-color: #000;
    mask: url("../../icons/arrow-right.svg") center / 100% 100% no-repeat;
    cursor: pointer;
  }

  .banner-video .banner-video-prev {
    transform: rotate(180deg);
  }

  .banner-video .banner-video-next {
    margin: 0 0 0 8px;
  }

  .banner-video .banner-video-prev:disabled,
  .banner-video .banner-video-next:disabled {
    opacity: 0.3;
    pointer-events: none;
  }
}
