/* ==========================================
   SAAS VIDEOS — YOUTUBE SHOWCASE
========================================== */

.saas-video-showcase,
.saas-video-showcase * {
  box-sizing: border-box;
}

.saas-video-showcase {
  width: 100%;
  padding: 64px 44px;
}

.saas-video-showcase__inner {
  width: 100%;
  max-width: 992px;
  margin: 0 auto;
}

.saas-video-showcase__item + .saas-video-showcase__item {
  margin-top: 16px;
}

/* ==========================================
   VIDEO CONTAINER
========================================== */

.saas-video-showcase__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 20px;
  background: #18181a;
  isolation: isolate;
  contain: paint;
  touch-action: pan-y;
}

.saas-video-showcase__player {
  position: absolute;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100%;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: inherit;
  background: #18181a;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ==========================================
   VIDEO THUMBNAIL
========================================== */

.saas-video-showcase__thumbnail {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;

  transition: transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.saas-video-showcase__thumbnail[hidden] {
  display: none;
}

.saas-video-showcase__player::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

/* ==========================================
   PLAY BUTTON
   Original Circle + Bigger Triangle
========================================== */

.saas-video-showcase__play-icon {
  position: relative;
  z-index: 2;

  display: grid;
  place-items: center;

  width: 76px;
  height: 76px;

  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;

  background: rgba(20, 20, 22, 0.64);
  color: #fff;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease;
}

/* Bigger triangle with adjusted positioning */

.saas-video-showcase__play-icon svg {
  display: block;
  width: 46px;
  height: 46px;
  margin-left: 0;
  fill: currentColor;
  transform: translateX(-1px);
}

/* ==========================================
   PLAYER HOVER
========================================== */

.saas-video-showcase__player:not(:disabled):hover
  .saas-video-showcase__thumbnail {
  transform: scale(1.035);
}

.saas-video-showcase__player:not(:disabled):hover
  .saas-video-showcase__play-icon {
  transform: scale(1.08);
  background: #ea0044;
  border-color: #ea0044;
}

.saas-video-showcase__player:focus-visible {
  outline: 3px solid #ea0044;
  outline-offset: -3px;
}

/* ==========================================
   VIDEO PLACEHOLDERS
========================================== */

.saas-video-showcase__player:disabled {
  cursor: default;

  background: radial-gradient(ellipse at 65% 32%, #2a2a2e, #19191c 65%);
}

.saas-video-showcase__player:disabled .saas-video-showcase__play-icon {
  opacity: 0.5;
}

.saas-video-showcase__placeholder-label {
  position: absolute;
  z-index: 2;
  bottom: 24px;
  left: 28px;

  color: #a8a8aa;

  font:
    500 14px/1.4 "Roboto",
    sans-serif;

  letter-spacing: 0.02em;
}

.saas-video-showcase__player:not(:disabled)
  .saas-video-showcase__placeholder-label {
  display: none;
}

/* ==========================================
   YOUTUBE IFRAME
========================================== */

.saas-video-showcase__iframe {
  position: absolute;
  inset: 0;

  display: block;

  width: 100%;
  height: 100%;

  max-width: 100%;
  max-height: 100%;

  border: 0;
  border-radius: inherit;

  z-index: 1;
  background: #000;

  touch-action: auto;
}

/* ==========================================
   HEADLINE & DESCRIPTION
========================================== */

.saas-video-showcase__content {
  padding: 48px 0;
}

.saas-video-showcase__title {
  margin: 0 0 18px;

  color: #fafafa;

  font-family: "Space Grotesk", "Roboto", sans-serif;
  font-size: 29px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;

  text-wrap: balance;
}

.saas-video-showcase__description {
  margin: 0;

  max-width: 920px;

  color: #b8b8b8;

  font-family: "Roboto", sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
}

.saas-video-showcase__description span {
  display: block;
}

/* ==========================================
   TABLET
========================================== */

@media (min-width: 769px) and (max-width: 1079px) {
  .saas-video-showcase__title {
    font-size: 18px;
  }
}

/* ==========================================
   MOBILE LAYOUT
========================================== */

@media (max-width: 768px) {
  .saas-video-showcase {
    padding: 48px 22px;
  }

  .saas-video-showcase__media {
    border-radius: 16px;
  }

  .saas-video-showcase__content {
    padding: 32px 0;
  }

  .saas-video-showcase__title {
    margin-bottom: 16px;
    font-size: clamp(14px, 4.5vw, 20px);
  }

  .saas-video-showcase__description {
    font-size: 16px;
  }

  /* Original mobile circle size */

  .saas-video-showcase__play-icon {
    width: 58px;
    height: 58px;
  }

  /* Bigger triangle, adjusted 1px left */

  .saas-video-showcase__play-icon svg {
    width: 36px;
    height: 36px;
    margin-left: 0;
    transform: translateX(-1px);
  }

  .saas-video-showcase__placeholder-label {
    left: 16px;
    bottom: 14px;
    font-size: 12px;
  }
}

/* ==========================================
   MOBILE YOUTUBE NOTICE
   ONLY 767px AND BELOW
========================================== */

/* Hidden on desktop and tablet */

.saas-video-showcase__mobile-notice {
  display: none;
}

/* Mobile only */

@media (max-width: 767px) {
  .saas-video-showcase__mobile-notice {
    display: grid;
    grid-template-rows: 0fr;

    opacity: 0;
    transform: translateY(-9px);

    visibility: hidden;
    pointer-events: none;

    transition:
      grid-template-rows 0.48s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.35s ease,
      transform 0.48s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0.48s;
  }

  /* Visible notification */

  .saas-video-showcase__mobile-notice.is-visible {
    grid-template-rows: 1fr;

    opacity: 1;
    transform: translateY(0);

    visibility: visible;
    pointer-events: auto;

    transition-delay: 0s;
  }

  /* Smooth height transition */

  .saas-video-showcase__mobile-notice-clip {
    min-height: 0;
    overflow: hidden;
  }

  /* Pink notification box */

  .saas-video-showcase__mobile-notice-box {
    margin-top: 12px;
    padding: 10px 12px;

    background: rgba(234, 0, 68, 0.075);

    border-left: 2px solid #ea0044;
    border-radius: 0 8px 8px 0;
  }

  /* Message */

  .saas-video-showcase__mobile-notice p {
    margin: 0;

    color: #d4d4d4;

    font-family: "Roboto", Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
  }

  /* ==========================================
     YOUTUBE LINK
     Same Baseline and Line Height
  ========================================== */

  .saas-video-showcase__mobile-notice a {
    display: inline;

    color: #ff477c;

    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    line-height: inherit;

    vertical-align: baseline;

    text-decoration: none;
    white-space: nowrap;

    -webkit-tap-highlight-color: transparent;
  }

  /* YouTube icon */

  .saas-video-showcase__mobile-notice a svg {
    display: inline-block;

    width: 16px;
    height: 16px;

    margin-right: 4px;

    vertical-align: -3px;
  }

  /* Keyboard accessibility */

  .saas-video-showcase__mobile-notice a:focus-visible {
    outline: 2px solid #ea0044;
    outline-offset: 3px;
    border-radius: 3px;
  }
}
