/* Before / after comparison slider */
.ba {
  position: relative;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  background: #ddd;
  aspect-ratio: 4 / 3;
}

.ba.portrait {
  aspect-ratio: 3 / 4;
  max-height: min(78vh, 880px);
  margin-inline: auto;
}

.ba > .after-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.ba .before-clip {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
  z-index: 1;
}

.ba .before-clip .before-img {
  position: absolute;
  top: 0;
  left: 0;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  transform: translateX(-50%);
  z-index: 3;
}

.ba-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  border: 2px solid #fff;
  background: rgba(183, 95, 95, 0.95);
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.ba-tag {
  position: absolute;
  top: 1rem;
  z-index: 4;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.ba-tag.before { left: 1rem; }
.ba-tag.after { right: 1rem; }
