/* ============================================
   Blueprint 1122 — V2 interior-page additions
   Loaded after brand.css + v2.css on: about.html,
   projects.html, team.html, resources.html, outlook.html.

   Contents:
   1. Before/after drag slider (projects.html) — JS-enhanced
      version of the brand.css .ba-pair fallback markup.
   ============================================ */

/* --- Before / after drag slider ------------------------------------------
   beforeafter.js replaces the static .ba-pair (brand.css) with this markup
   at runtime. If JS never runs, .ba-pair stays exactly as shipped —
   the side-by-side before/after pair — so there is no broken fallback. */

.ba-slider {
  position: relative;
}

.ba-slider-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bp-ink);
}

.ba-layer {
  position: absolute;
  inset: 0;
}

.ba-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Top layer (before) is clipped from the right; JS moves the clip line. */
.ba-layer-before {
  clip-path: inset(0 50% 0 0);
  transition: clip-path 0.15s var(--ease-out);
}
.ba-slider.dragging .ba-layer-before {
  transition: none;
}

.ba-badge {
  position: absolute;
  top: 10px;
  padding: 0.3em 0.8em;
  background: rgba(31, 33, 33, 0.72);
  color: var(--bp-paper);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  pointer-events: none;
}
.ba-badge-before { left: 10px; }
.ba-badge-after  { right: 10px; background: var(--bp-red); color: var(--bp-white); }

/* Drag handle */
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 44px;
  margin-left: -22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
  touch-action: none;
  transition: left 0.15s var(--ease-out);
}
.ba-slider.dragging .ba-handle {
  transition: none;
}
.ba-handle::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px;
  background: var(--bp-white);
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(31, 33, 33, 0.3);
}
.ba-handle-grip {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bp-white);
  color: var(--bp-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(31, 33, 33, 0.3);
}
.ba-handle:focus-visible {
  outline: 2px solid var(--bp-red);
  outline-offset: 3px;
}
.ba-handle:focus-visible .ba-handle-grip {
  box-shadow: 0 4px 14px rgba(31, 33, 33, 0.3), 0 0 0 3px rgba(124, 46, 33, 0.35);
}

@media (max-width: 480px) {
  .ba-handle { width: 36px; margin-left: -18px; }
  .ba-handle-grip { width: 32px; height: 32px; font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ba-layer-before,
  .ba-handle {
    transition: none;
  }
}
