/*!
 * ba-slider.css — styles for the before/after comparison component
 * MIT License
 */

.ba {
  --ba-split: 50%;
  --ba-line: #f4f1ec;
  --ba-handle-bg: #f4f1ec;
  --ba-handle-fg: #14201c;
  --ba-radius: 4px;

  position: relative;
  overflow: hidden;
  min-width: 0;              /* survives flex/grid parents */
  border-radius: var(--ba-radius);
  touch-action: pan-y;       /* vertical scroll still works on mobile */
  user-select: none;
  -webkit-user-select: none;
  cursor: ew-resize;
  background: #0d1512;
}

.ba img,
.ba video {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* The "after" layer stacks on top and gets clipped from the left. */
.ba__layer--after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 var(--ba-split));
}

.ba__layer--after img,
.ba__layer--after video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Divider line + handle */
.ba__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ba-split);
  width: 2px;
  margin-left: -1px;
  background: var(--ba-line);
  border: 0;
  padding: 0;
  cursor: ew-resize;
  z-index: 2;
}

.ba__grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ba-handle-bg);
  color: var(--ba-handle-fg);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.ba__grip svg { width: 9px; height: 12px; display: block; }

.ba__handle:hover .ba__grip { transform: translate(-50%, -50%) scale(1.06); }
.ba.is-dragging .ba__grip { transform: translate(-50%, -50%) scale(0.94); }

.ba__handle:focus-visible {
  outline: none;
}
.ba__handle:focus-visible .ba__grip {
  outline: 3px solid #e0a32e;
  outline-offset: 3px;
}

/* Optional corner labels */
.ba__tag {
  position: absolute;
  top: 12px;
  z-index: 1;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(13, 21, 18, 0.62);
  backdrop-filter: blur(6px);
  color: #f4f1ec;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  pointer-events: none;
}

.ba__tag--before { left: 12px; }
.ba__tag--after  { right: 12px; }

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