/* ---------------------------------------------------------------------------
   video-stories — merchant video + quote rail on a deep-blue band that fades
   into the white sections above and below.

   Loaded by resources/views/components/sections/video-stories.blade.php,
   which also sets the optional line-art layer (::after) per section.
   Plain CSS — no Tailwind @apply here.
   Bump the ?v in that component's <link> whenever this file changes.
--------------------------------------------------------------------------- */

section.section-video-stories {
  --vs-ink: #16213d;
  --vs-muted: #738095;
  --vs-quote: #77839a;
  --vs-blue: #1d4aa3;
  --vs-tint: #e7effd;
  position: relative;
  isolation: isolate;
  padding: 185px 0 148px;
  background: var(--color-white);
  color: var(--color-white);
}

/* The band is masked to transparent at both ends, so it blends into the white
   section background instead of starting on a hard edge. */
section.section-video-stories::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background: radial-gradient(72% 68% at 54% 50%, #1552b6 0%, #0c3e9b 58%, #082e84 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.12) 48px, rgba(0, 0, 0, 0.58) 128px, #000 205px, #000 calc(100% - 220px), rgba(0, 0, 0, 0.6) calc(100% - 128px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.12) 48px, rgba(0, 0, 0, 0.58) 128px, #000 205px, #000 calc(100% - 220px), rgba(0, 0, 0, 0.6) calc(100% - 128px), transparent 100%);
  pointer-events: none;
}

/* Line art (content 'decor_img') shows only at the left and right edges,
   clear of the cards. The component sets its image and stroke filter. */
section.section-video-stories::after {
  --vs-art-centre-fade: linear-gradient(90deg, #000 0%, #000 10%, rgba(0, 0, 0, 0.35) 24%, transparent 36%, transparent 64%, rgba(0, 0, 0, 0.35) 76%, #000 90%, #000 100%);
  --vs-art-vertical-fade: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.18) 90px, #000 205px, #000 calc(100% - 220px), transparent 100%);
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: center / cover no-repeat;
  opacity: 0.32;
  -webkit-mask-image: var(--vs-art-vertical-fade), var(--vs-art-centre-fade);
  -webkit-mask-composite: source-in;
  mask-image: var(--vs-art-vertical-fade), var(--vs-art-centre-fade);
  mask-composite: intersect;
  pointer-events: none;
}

.section-video-stories .vs-filter {
  position: absolute;
  pointer-events: none;
}

.section-video-stories .vs-head {
  max-width: 850px;
  margin: 0 auto 44px;
  text-align: center;
}

.section-video-stories .vs-head .kicker {
  margin: 0;
  color: var(--color-yellow);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-video-stories .vs-head h2 {
  max-width: 820px;
  margin: 14px auto 0;
  color: var(--color-white);
  text-wrap: balance;
}

.section-video-stories .vs-body {
  position: relative;
}

.section-video-stories .vs-rail {
  display: flex;
  align-items: stretch;
  gap: 32px;
  padding: 0 0 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
}

/* Soft edges instead of a hard crop where stories run past the rail;
   the script sets has-before / has-after from the scroll position. */
.section-video-stories .vs-rail {
  --vs-fade-start: 0px;
  --vs-fade-end: 0px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--vs-fade-start), #000 calc(100% - var(--vs-fade-end)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--vs-fade-start), #000 calc(100% - var(--vs-fade-end)), transparent 100%);
}

.section-video-stories .vs-rail.has-before {
  --vs-fade-start: 64px;
}

.section-video-stories .vs-rail.has-after {
  --vs-fade-end: 64px;
}

.section-video-stories .vs-rail::-webkit-scrollbar {
  display: none;
}

.section-video-stories .vs-rail.is-dragging {
  scroll-snap-type: none;
  scroll-behavior: auto;
  cursor: grabbing;
  user-select: none;
}

.section-video-stories .vs-rail.is-dragging > * {
  pointer-events: none;
}

.section-video-stories .vs-story {
  display: grid;
  grid-template-columns: 298px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  flex: 0 0 620px;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.section-video-stories .vs-video {
  position: relative;
  width: 298px;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 16px;
  background: #f4f6fa;
}

.section-video-stories .vs-video video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f4f6fa;
}

.section-video-stories .vs-quote {
  display: flex;
  flex-direction: column;
  align-self: start;
  margin-top: 24px;
  padding: 26px 24px 28px;
  border: 1px solid #c8d7f4;
  border-radius: 16px;
  background: var(--color-white);
  color: var(--vs-ink);
}

.section-video-stories .vs-quote blockquote {
  margin: 0;
  padding: 0;
  border: 0;
}

.section-video-stories .vs-quote blockquote p {
  margin: 0;
  color: var(--vs-quote);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.section-video-stories .vs-quote mark {
  padding: 0;
  background: var(--vs-tint);
  color: var(--vs-blue);
  font-size: 21px;
  font-weight: 650;
  line-height: 1.28;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.section-video-stories .vs-quote-open {
  display: block;
  height: 40px;
  margin: 0 0 10px;
  color: var(--vs-blue);
  font-size: 52px;
  font-weight: 750;
  line-height: 1;
}

.section-video-stories .vs-attribution {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.section-video-stories .vs-attribution > div {
  min-width: 0;
}

.section-video-stories .vs-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1px solid #e5ebf4;
  border-radius: 50%;
  background: var(--color-white);
}

.section-video-stories .vs-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.section-video-stories .vs-attribution strong {
  display: block;
  color: var(--vs-ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.section-video-stories .vs-attribution span {
  display: block;
  margin-top: 5px;
  color: var(--vs-muted);
  font-size: 13px;
  line-height: 1.4;
}

/* Zero-height bar; the script sets its top to the middle of the first video. */
.section-video-stories .vs-controls {
  position: absolute;
  z-index: 5;
  right: 0;
  left: 0;
  height: 0;
  pointer-events: none;
}

.section-video-stories .vs-controls button {
  position: absolute;
  top: 0;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid var(--color-white);
  border-radius: 50%;
  background: var(--color-white);
  color: var(--vs-blue);
  box-shadow: 0 8px 24px rgba(0, 29, 94, 0.16);
  cursor: pointer;
  pointer-events: auto;
  transform: translateY(-50%);
  transition: background 0.18s, opacity 0.18s;
}

.section-video-stories .vs-controls button svg {
  width: 24px;
  height: 24px;
}

.section-video-stories .vs-controls [data-direction="-1"] {
  left: -27px;
}

.section-video-stories .vs-controls [data-direction="1"] {
  right: -27px;
}

.section-video-stories .vs-controls button:hover:not(:disabled) {
  background: var(--vs-tint);
}

.section-video-stories .vs-controls button:disabled {
  opacity: 0.4;
  cursor: default;
}

.section-video-stories button:focus-visible,
.section-video-stories .vs-rail:focus-visible {
  outline: 2px solid var(--color-yellow);
  outline-offset: 4px;
}

@media (max-width: 1000px) {
  .section-video-stories .vs-rail {
    gap: 26px;
  }

  .section-video-stories .vs-story {
    grid-template-columns: 255px minmax(0, 1fr);
    flex-basis: 520px;
    gap: 19px;
  }

  .section-video-stories .vs-video {
    width: 255px;
  }
}

@media (max-width: 900px) {
  section.section-video-stories {
    padding-bottom: 140px;
  }
}

/* Phones: video stacked over its quote, and the rail runs edge to edge. */
@media (max-width: 760px) {
  section.section-video-stories::after {
    background-size: auto 100%;
  }

  .section-video-stories .vs-head {
    margin-bottom: 24px;
  }

  .section-video-stories .vs-head .kicker {
    font-size: 10px;
  }

  .section-video-stories .vs-head h2 {
    max-width: 540px;
    margin-top: 12px;
  }

  .section-video-stories .vs-rail {
    width: 100vw;
    margin-inline: calc(50% - 50vw);
    padding: 0 16px 6px;
    gap: 20px;
    scroll-padding-left: 16px;
  }

  .section-video-stories .vs-story {
    grid-template-columns: minmax(0, 1fr);
    flex-basis: calc(85vw - 49px);
    gap: 12px;
  }

  .section-video-stories .vs-video {
    justify-self: center;
    width: min(90%, 255px);
    border-radius: 12px;
  }

  .section-video-stories .vs-quote {
    place-self: start center;
    width: min(90%, 255px);
    margin-top: 0;
    padding: 19px 19px 21px;
    border-radius: 12px;
  }

  .section-video-stories .vs-quote-open {
    height: 27px;
    margin-bottom: 6px;
    font-size: 38px;
    line-height: 0.95;
  }

  .section-video-stories .vs-attribution {
    gap: 8px;
    margin-top: 18px;
  }

  .section-video-stories .vs-avatar {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .section-video-stories .vs-attribution strong {
    font-size: 14px;
  }

  .section-video-stories .vs-attribution span {
    margin-top: 3px;
    font-size: 12px;
    word-break: keep-all;
  }

  .section-video-stories .vs-controls button {
    width: 46px;
    height: 46px;
  }

  .section-video-stories .vs-controls [data-direction="-1"] {
    left: -8px;
  }

  .section-video-stories .vs-controls [data-direction="1"] {
    right: -8px;
  }
}

@media (max-width: 600px) {
  section.section-video-stories {
    padding-top: 102px;
    padding-bottom: 132px;
  }

  section.section-video-stories::before {
    -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.55) 48px, #000 110px, #000 calc(100% - 155px), transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.55) 48px, #000 110px, #000 calc(100% - 155px), transparent 100%);
  }

  section.section-video-stories::after {
    --vs-art-vertical-fade: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.5) 80px, #000 160px, #000 calc(100% - 155px), transparent 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .section-video-stories .vs-controls button {
    transition: none;
  }
}
