/* beforeafter.css - minimal, responsive */
.ba {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  background: #111;
  border-radius: 12px;
  user-select: none;
  touch-action: none;
}

/* Maintain aspect ratio via padding hack - adjust to your video aspect if needed */
.ba .frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 -> change to 75% for 4:3, etc. */
  overflow: hidden;
  background: #000;
}

.ba .layer {
  position: absolute;
  inset: 0;
  display: block;
}

.ba img, .ba video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* or cover if you prefer cropping */
  display: block;
  pointer-events: none;
}

/* the "after" layer will be clipped from the right by JS */
.ba .after {
  pointer-events: none;
}

/* handle */
.ba .handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255,255,255,0.95);
  transform: translateX(-1px);
  z-index: 30;
  pointer-events: auto;
  touch-action: none;
}

/* handle knob */
.ba .knob {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* subtle icon lines */
.ba .knob svg { width: 18px; height: 18px; opacity: .9; }

/* top labels */
.ba .label {
  position: absolute;
  top: 10px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 13px;
  border-radius: 6px;
  z-index: 40;
  pointer-events: none;
}

.ba .label.before { left: 10px; }
.ba .label.after  { right: 10px; }

/* small controls line under the frame */
.ba .controls {
  margin-top: 10px;
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #444;
}

/* mobile: make handle area easier to touch */
@media (max-width: 640px) {
  .ba .knob { width: 56px; height: 56px; }
}
