/* before and after */

/* ===== Before / After styles ===== */
.project-featured-image {
  width: 100%;
}

.ba-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: #000;
  user-select: none;
  touch-action: none;
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
}

/* Keep a nice aspect ratio (edit if needed) */
.ba-wrap::before {
  content: "";
  display: block;
  padding-top: 62%;
}

.ba-img,
.ba-before-layer,
.ba-handle {
  position: absolute;
  inset: 0;
}

.ba-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.ba-before-layer {
  width: var(--ba-pos, 50%);
  overflow: hidden;
}

.ba-handle {
  left: calc(var(--ba-pos, 50%) - 18px);
  width: 36px;
  height: 100%;
  border: 0;
  background: transparent;
  cursor: ew-resize;
  display: grid;
  place-items: center;
  padding: 0;
}

.ba-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: rgba(255,255,255,.85);
}

.ba-knob {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.12);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
  position: relative;
  transition: transform .15s ease, background .15s ease;
}

.ba-wrap:hover .ba-knob,
.ba-wrap.is-dragging .ba-knob {
  transform: scale(1.04);
  background: #fff;
}

.ba-arrow {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: .9;
}

.ba-left {
  left: 11px;
  border-right: 8px solid rgba(0,0,0,.7);
}

.ba-right {
  right: 11px;
  border-left: 8px solid rgba(0,0,0,.7);
}

/* Labels */
.ba-label {
  position: absolute;
  top: 14px;
  padding: 6px 10px;
  font-size: 13px;
  letter-spacing: .2px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  color: #fff;
  backdrop-filter: blur(6px);
}

.ba-label-before { left: 14px; }
.ba-label-after  { right: 14px; }

/* Nice entrance animation (optional) */
.ba-wrap.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: baFadeUp .6s ease forwards;
}
@keyframes baFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile */
@media (max-width: 768px) {
  .ba-wrap::before { padding-top: 72%; }
}
