/* Demo access teaser — stacks above hero blur; CTA = two split-title rows (2nd inverted) */

.w3s-demo-video-teaser.w3s-section {
  position: relative;
  z-index: 21;
  isolation: isolate;
  min-height: unset;
  align-items: center;
}

/* Match navbar horizontal band: .w3s-navbar uses width calc(100% - 160px) max 1400px; mobile full-bleed + 16px like .w3s-navbar__inner */
.w3s-demo-video-teaser .w3s-section__inner {
  box-sizing: border-box;
  width: calc(100% - 160px);
  max-width: 1400px;
  margin-inline: auto;
  padding: clamp(2.5rem, 5vw, 4rem) 20px;
}

@media (max-width: 960px) {
  .w3s-demo-video-teaser .w3s-section__inner {
    width: 100%;
    max-width: 100%;
    padding-inline: 16px;
  }
}

/* Same scroll-driven fade as #discover .w3s-discover-stack-banner__zoom-root (index only) */
.w3s-demo-video-teaser__zoom-root {
  position: relative;
  display: block;
  width: 100%;
  opacity: 0;
  will-change: opacity;
  transition: opacity 0.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .w3s-demo-video-teaser__zoom-root {
    opacity: 1;
    transition: none;
  }
}

/* Default: stacked / generic; desktop row overrides below */
.w3s-demo-video-teaser__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.22rem, 0.55vw, 0.42rem);
  width: 100%;
}

.w3s-demo-video-teaser__media {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.w3s-demo-video-teaser__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

/* Copy column: wide enough for nowrap title lines at max --fs-h2 (prev ~28rem max clipped gradient text) */
.w3s-demo-video-teaser__copy {
  /* Was capped ~28rem — too narrow vs nowrap + display title; upper bound fits longest line + letter-spacing */
  --w3s-demo-copy-w: clamp(24rem, 42vw, 44rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: min(var(--w3s-demo-copy-w), 100%);
  text-align: left;
  overflow-x: visible;
}

/* Inner stack: shrink-to-content width, centered in .copy; text stays left-aligned inside */
.w3s-demo-video-teaser__copy-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
}

@media (min-width: 901px) {
  .w3s-demo-video-teaser__inner {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: clamp(0.22rem, 0.55vw, 0.42rem);
  }

  .w3s-demo-video-teaser__media {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    width: auto;
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  }

  /*
    Media cell height tracks the right column (flex stretch). Cap GIF height to 6/7 of that cell
    (~1/7 shorter) so it sits between title-top and CTA-bottom visually; flex center on .media.
  */
  .w3s-demo-video-teaser__media img {
    display: block;
    min-height: 0;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100% * 6 / 7);
    object-fit: contain;
    object-position: center;
    border-radius: 0;
    box-shadow: none;
  }

  /* Fixed width from clamp (now ~44rem max) — media flex:1 takes remaining space; avoids nowrap title clip */
  .w3s-demo-video-teaser__copy {
    flex: 0 0 var(--w3s-demo-copy-w);
    width: var(--w3s-demo-copy-w);
    max-width: min(var(--w3s-demo-copy-w), 100%);
  }
}

.w3s-demo-video-teaser__title {
  text-align: left;
  max-width: 100%;
  line-height: 0.98;
  overflow: visible;
}

/* Default: full line 2; tight variant hidden (shown only in 901–1024px row layout — see below) */
.w3s-demo-video-teaser__title-l2--tight {
  display: none;
}

/*
  Two-column row: <br> only breaks between logical lines; without nowrap each line can still wrap mid-phrase
  when the copy column is narrower than the phrase (desktop included).
*/
@media (min-width: 901px) {
  .w3s-demo-video-teaser__title .w3s-demo-video-teaser__title-row,
  .w3s-demo-video-teaser__title .w3s-demo-video-teaser__title-l2 {
    white-space: nowrap;
  }
}

/*
  iPad-class widths: copy column is narrow enough that "see how digital assets" still overflows line 2
  with nowrap. Shorter line 2 keeps three clean lines.
*/
@media (min-width: 901px) and (max-width: 1024px) {
  .w3s-demo-video-teaser__title-l2--full {
    display: none;
  }

  .w3s-demo-video-teaser__title-l2--tight {
    display: inline;
  }
}

.w3s-demo-video-teaser__sub {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.65;
  color: #e5e7eb;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* Below 1366px: single flowing paragraph; 1366+ (desktop / horizontal tablet): fixed two-line break */
.w3s-demo-video-teaser__sub--wide {
  display: none;
}

@media (min-width: 1366px) {
  .w3s-demo-video-teaser__sub--default {
    display: none;
  }

  .w3s-demo-video-teaser__sub--wide {
    display: block;
  }
}

/* font-size here so padding em matches split text; avoids border clipping the clip-path layers */
.w3s-demo-video-teaser__cta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 4.5px solid #39d091;
  border-radius: 9px;
  font-size: clamp(0.825rem, 2.025vw, 1.425rem);
  padding: 0.55em 0.95em;
  box-sizing: border-box;
  background-color: transparent;
  overflow: visible;
  transition:
    box-shadow 0.25s ease,
    transform 0.2s ease,
    background-color 0.2s ease;
  max-width: 100%;
  width: max-content;
  text-align: center;
}

.w3s-demo-video-teaser__cta:hover,
.w3s-demo-video-teaser__cta:focus-visible,
.w3s-demo-video-teaser__cta:active {
  background-color: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 1px rgba(57, 208, 145, 0.35), 0 8px 28px rgba(57, 208, 145, 0.2);
}

.w3s-demo-video-teaser__cta:focus-visible {
  outline: 2px solid #7df5c4;
  outline-offset: 4px;
}

.w3s-demo-video-teaser__cta-split {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
}

.w3s-demo-video-teaser__cta-split--inline {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
}

.w3s-demo-video-teaser__cta-split--inline .w3s-split-title--demo-cta-row {
  flex: 0 0 auto;
}

.w3s-demo-video-teaser .w3s-split-title--demo-cta-row {
  display: inline-grid;
  place-content: center;
  justify-items: start;
  align-items: center;
  min-height: unset;
  width: max-content;
  max-width: none;
  padding-inline: 0.06em;
  padding-block: 0.18em;
  box-sizing: content-box;
  font-family: "Oswald", system-ui, sans-serif;
  font-size: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.12;
}

.w3s-demo-video-teaser .w3s-split-title--demo-cta-row > div {
  grid-area: 1 / 1 / -1 / -1;
}

.w3s-demo-video-teaser .w3s-split-title--demo-cta-row:not(.w3s-split-title--demo-cta-row--invert) .w3s-split-title__top {
  clip-path: polygon(0% 0%, 100% 0%, 100% 48%, 0% 58%);
  color: var(--w3s-green);
}

.w3s-demo-video-teaser .w3s-split-title--demo-cta-row:not(.w3s-split-title--demo-cta-row--invert) .w3s-split-title__bottom {
  clip-path: polygon(0% 60%, 100% 50%, 100% 100%, 0% 100%);
  color: transparent;
  background: linear-gradient(177deg, transparent 53%, #ffffff 65%);
  background-clip: text;
  -webkit-background-clip: text;
  transform: translateX(-0.02em);
}

.w3s-demo-video-teaser .w3s-split-title--demo-cta-row--invert .w3s-split-title__top {
  clip-path: polygon(0% 0%, 100% 0%, 100% 48%, 0% 58%);
  color: #f1f5f9;
}

.w3s-demo-video-teaser .w3s-split-title--demo-cta-row--invert .w3s-split-title__bottom {
  clip-path: polygon(0% 60%, 100% 50%, 100% 100%, 0% 100%);
  color: transparent;
  background: linear-gradient(177deg, transparent 48%, var(--w3s-green) 72%);
  background-clip: text;
  -webkit-background-clip: text;
  transform: translateX(-0.02em);
}

/* Stacked: title → GIF → sub → CTA; sub + CTA same max width as GIF column */
@media (max-width: 900px) {
  .w3s-demo-video-teaser__inner {
    --w3s-demo-stack-w: min(100%, 32rem);
  }

  .w3s-demo-video-teaser__copy {
    display: contents;
  }

  .w3s-demo-video-teaser__copy-inner {
    display: contents;
  }

  .w3s-demo-video-teaser__title {
    order: 1;
    text-align: center;
    max-width: var(--w3s-demo-stack-w);
    margin-inline: auto;
  }

  .w3s-demo-video-teaser__media {
    order: 2;
    width: 100%;
    max-width: var(--w3s-demo-stack-w);
    margin-inline: auto;
  }

  .w3s-demo-video-teaser__media img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  }

  .w3s-demo-video-teaser__sub {
    order: 3;
    text-align: center;
    max-width: var(--w3s-demo-stack-w);
    width: 100%;
    margin-inline: auto;
  }

  .w3s-demo-video-teaser__cta {
    order: 4;
    align-self: center;
    width: 100%;
    max-width: var(--w3s-demo-stack-w);
    font-size: clamp(0.54rem, 2.775vw + 0.33rem, 1.425rem);
    min-height: 3.5rem;
    padding: 0.5em 0.75em;
    box-sizing: border-box;
  }

  .w3s-demo-video-teaser__cta-split--inline {
    flex-wrap: nowrap;
    white-space: nowrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: center;
    column-gap: clamp(0.2em, 1.2vw, 0.45em);
  }

  .w3s-demo-video-teaser__cta-split--inline .w3s-split-title--demo-cta-row {
    font-size: inherit;
    line-height: 1.12;
    flex-shrink: 0;
  }
}
