/* ===== BEFORE / AFTER SLIDER ===== */
/* Split-image slider for the homepage trust-builder section.
   Palette reuses --navy / --gold / --off-white from public/css/main.css.
   - --ba-position (0-100%) drives the split.
   - The after image stays anchored to the slider width and is clipped with
     clip-path on a full-width overlay wrapper; this keeps the after image
     at its natural aspect ratio when the user drags left/right. */

.ba-section {
  background: var(--sapphire);
  padding: 80px 0;
  text-align: center;
}

.ba-section .section-eyebrow {
  color: var(--chrome-solid);
}

.ba-section .section-title {
  color: var(--white);
  margin-bottom: 8px;
}

.ba-section-sub {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  margin-bottom: 40px;
}

.ba-slider {
  position: relative;
  width: 100%;
  max-width: 700px;
  aspect-ratio: 16 / 10;
  margin: 0 auto 32px auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  background: #000;
  cursor: ew-resize;
  /* CSS-driven position so JS only writes one custom property. */
  --ba-position: 50%;
  user-select: none;
  -webkit-user-select: none;
}

.ba-slider--no-motion,
.ba-slider--no-motion * {
  transition: none !important;
}

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

/* After-image wrapper spans the full slider; clip-path crops from the left
   so increasing --ba-position reveals more of the after image. */
.ba-after-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(0 0 0 var(--ba-position));
  -webkit-clip-path: inset(0 0 0 var(--ba-position));
  pointer-events: none;
}
.ba-after-wrap .ba-img--after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Handle — vertical bar + circular grabber. */
.ba-handle {
  position: absolute;
  top: 0;
  left: var(--ba-position);
  transform: translateX(-50%);
  height: 100%;
  width: 44px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  cursor: ew-resize;
  z-index: 4;
  /* Don't let touch start default gesture (scroll/zoom). */
  touch-action: none;
}

.ba-handle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  width: 3px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.ba-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--chrome-solid);
  border: 3px solid var(--white);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.ba-handle-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--white);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.ba-handle-arrow--left { left: 6px; }
.ba-handle-arrow--right { right: 6px; }

/* Labels — small pills in the corners. */
.ba-label {
  position: absolute;
  top: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.92);
  color: var(--sapphire);
  padding: 6px 12px;
  border-radius: 999px;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.ba-label--before { left: 16px; }
.ba-label--after  { right: 16px; }

.ba-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--white);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  margin: 0;
  padding: 0 16px;
  pointer-events: none;
  z-index: 3;
}

.ba-completed-stamp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 24px;
  padding: 6px 14px 6px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(192,200,208,0.35);
  border-radius: 999px;
}

.ba-completed-stamp img {
  height: 32px;
  width: auto;
  display: block;
}

.ba-completed-stamp-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--chrome-solid);
}

.ba-section-cta {
  margin-top: 8px;
}

.btn-outline {
  display: inline-block;
  padding: 14px 28px;
  border: 2px solid var(--chrome-solid);
  color: var(--chrome-solid);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--chrome-solid);
  color: var(--sapphire);
  outline: none;
}

/* Responsive */
@media (max-width: 640px) {
  .ba-section { padding: 56px 0; }
  .ba-section-sub { font-size: 15px; margin-bottom: 28px; }
  .ba-slider { max-width: 100%; aspect-ratio: 4 / 3; }
  .ba-handle { width: 36px; }
  .ba-handle::after { width: 36px; height: 36px; }
  .ba-handle-arrow { font-size: 18px; }
  .ba-label { font-size: 10px; padding: 5px 10px; }
  .ba-caption { font-size: 12px; }
}

/* Focus-visible outline on the handle for keyboard users. */
.ba-handle:focus-visible {
  outline: 3px solid var(--chrome-solid);
  outline-offset: 2px;
}
