/* ==========================================================================
   Before / after slider  —  <div class="ba" data-ba data-start="50">
   Both images are stacked in the same box with the same crop. Only the top
   (before) image is clipped; the images never move.
   ========================================================================== */
.ba {
  --pos: 50%;
  --ba-orange: #f15a24;
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #111;
  cursor: ew-resize;
  touch-action: pan-y;          /* horizontal drags go to the slider, vertical still scrolls */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.ba__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.ba__img--before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); will-change: clip-path; }

.ba__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
  will-change: left;
  outline: none;
}

.ba__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ba-orange);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
}

.ba__handle svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ba.is-dragging .ba__handle,
.ba__divider:focus-visible .ba__handle { transform: translate(-50%, -50%) scale(1.1); }
.ba__divider:focus-visible .ba__handle { box-shadow: 0 0 0 3px #fff, 0 2px 10px rgba(0, 0, 0, 0.28); }

@media (max-width: 600px) {
  .ba__handle { width: 38px; height: 38px; }
  .ba__handle svg { width: 19px; height: 19px; }
}

/* Home page placement: torn dark strip with a dust-toned background */
.ba-section {
  position: relative;
  color: #f4f0e9;
  background-color: #0f0d0c;
  background-image: linear-gradient(90deg, rgba(12, 11, 10, .38) 0%, rgba(12, 11, 10, .64) 48%, rgba(12, 11, 10, .9) 100%), url("../images/storyteller/bg/GXV-Hilt-Dust-Brown-BG.avif");
  background-position: center, left center;
  background-size: cover;
  padding: calc(var(--edge-top) + clamp(28px, 3vw, 48px)) 0 clamp(48px, 5vw, 72px);
}
.ba-section.edge-top { z-index: 2; margin-top: calc(-1 * var(--edge-top) - 2.4vw); padding-top: calc(var(--edge-top) + 2.4vw + clamp(20px, 2.5vw, 40px)); }
.ba-section + .perf.edge-top { margin-top: calc(-1 * var(--edge-top)); padding-top: var(--edge-top); }

.ba-section > .st-container--wide { width: min(1464px, 100% - 2 * var(--gutter)); }
.ba-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  align-items: center;
  gap: clamp(36px, 5.5vw, 84px);
}
.ba-figure { min-width: 0; margin: 0; }
.ba-section .ba { width: 100%; max-height: 560px; margin: 0 auto; }
.ba__legend {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  color: rgba(244, 240, 233, .76);
  font: 700 11px/1.2 var(--font-label);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ba__legend span:last-child { text-align: right; }
.ba-copy { max-width: 470px; padding: clamp(22px, 3vw, 42px) 0; }
.ba-copy__eyebrow { margin: 0 0 14px; color: #f15a24; font: 700 11px/1.2 var(--font-label); letter-spacing: .16em; text-transform: uppercase; }
.ba-copy__title { margin: 0 0 24px; color: #f4f0e9; font: 900 clamp(27px, 2.5vw, 36px)/1.08 var(--font-head); letter-spacing: .01em; text-transform: uppercase; }
.ba-copy__states { display: grid; min-height: 118px; }
.ba-copy__state {
  grid-area: 1 / 1;
  align-self: start;
  padding: 5px 0 5px 18px;
  border-left: 2px solid #f15a24;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .32s ease, transform .32s ease;
}
.ba-copy__state.is-active { opacity: 1; pointer-events: auto; transform: translateY(0); }
.ba-copy__label { margin: 0 0 10px; color: #f15a24; font: 800 clamp(17px, 1.45vw, 20px)/1.2 var(--font-head); text-transform: uppercase; }
.ba-copy__description { max-width: 38ch; margin: 0; color: rgba(244, 240, 233, .9); font: 400 clamp(16px, 1.25vw, 19px)/1.55 var(--font-body); }
.ba-copy__hint { margin: 20px 0 0; padding-top: 13px; border-top: 1px solid rgba(244, 240, 233, .25); color: rgba(244, 240, 233, .68); font: 500 12px/1.5 var(--font-body); }

/* Deeper tear on small screens so the band's cream strip never shows */
.ba-section.edge-top { margin-top: calc(-1 * var(--edge-top) - max(2.4vw, 16px)); padding-top: calc(var(--edge-top) + max(2.4vw, 16px) + clamp(20px, 2.5vw, 40px)); }

@media (max-width: 760px) {
  .ba-layout { grid-template-columns: minmax(0, 1fr); gap: clamp(26px, 6vw, 42px); }
  .ba-copy { max-width: 620px; padding: 0; }
  .ba-copy__title { max-width: 15ch; }
}

@media (prefers-reduced-motion: reduce) {
  .ba-copy__state { transition: none; transform: none; }
}
