/* Avant / après : curseur de comparaison (mécanique reprise de cmc6.fr, habillée DA Waapluka) */
.ba { margin: clamp(36px, 5vw, 64px) auto 0; max-width: 1040px; }
.ba__eyebrow { display: inline-flex; margin-bottom: 14px; }
.ba__fig { --pos: 50%; margin: 0; }
.ba__frame {
  position: relative; overflow: hidden; aspect-ratio: 16 / 10;
  border-radius: var(--r-lg);
  background: var(--paper-2);
  border: 8px solid var(--paper-2);
  box-shadow: var(--shadow-md);
  cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-tap-highlight-color: transparent;
}
.ba__img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: center top; pointer-events: none; -webkit-user-drag: none; border-radius: calc(var(--r-lg) - 8px); }
.ba__img picture, .ba__before picture { display: block; width: 100%; height: 100%; }
.ba__before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); border-radius: calc(var(--r-lg) - 8px); overflow: hidden; }
.ba__handle { position: absolute; inset: 0; z-index: 3; pointer-events: none; transform: translateX(calc(var(--pos) - 50%)); }
.ba__handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 1.5px); width: 3px; background: var(--paper-2); box-shadow: 0 0 18px rgba(48, 20, 63, 0.35); }
.ba__knob {
  position: absolute; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--violet); color: #fff;
  box-shadow: 0 0 0 5px var(--paper-2), 0 12px 28px rgba(135, 56, 242, 0.45);
  transition: transform .3s var(--ease, cubic-bezier(.22, 1, .36, 1));
}
.ba__fig.is-active .ba__knob { transform: scale(1.08); }
.ba__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.ba__frame:has(.ba__range:focus-visible) .ba__knob { outline: 3px solid var(--ink); outline-offset: 5px; }

.ba__tag {
  position: absolute; bottom: clamp(12px, 2.2vw, 22px); z-index: 2; pointer-events: none;
  padding: 8px 14px; border-radius: var(--r-pill);
  font-family: var(--font-bubble); font-weight: 600; font-size: 0.82rem; line-height: 1; letter-spacing: .01em;
  box-shadow: var(--shadow-sm); transition: opacity .25s;
}
.ba__tag--before { left: clamp(12px, 2.2vw, 22px); background: var(--paper-2); color: var(--ink); }
.ba__tag--after { right: clamp(12px, 2.2vw, 22px); background: var(--violet); color: #fff; }
.ba__fig.is-no-before .ba__tag--before, .ba__fig.is-no-after .ba__tag--after { opacity: 0; }

.ba__caption { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 18px; }
.ba__who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; color: var(--ink); }
.ba__name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; }
.ba__job { opacity: .85; }
.ba__link { margin-left: auto; }

@media (max-width: 640px) {
  .ba__frame { aspect-ratio: 9 / 16; border-width: 6px; }
  .ba__img, .ba__before { border-radius: calc(var(--r-lg) - 6px); }
  .ba__knob { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
  .ba__tag { font-size: 0.7rem; padding: 7px 11px; }
  .ba__link { margin-left: 0; }
}

/* Version compacte dans une carte de Réalisations */
.ba--card { max-width: none; margin: 0; }
.ba--card .ba__frame { aspect-ratio: 8 / 5; border: 0; box-shadow: none; border-radius: 16px calc(var(--r-lg) - 10px) 16px 16px; }
.ba--card .ba__img, .ba--card .ba__before { border-radius: 0; }
.ba--card .ba__knob { width: 44px; height: 44px; margin: -22px 0 0 -22px; box-shadow: 0 0 0 4px var(--paper-2), 0 10px 22px rgba(135, 56, 242, 0.4); }
.ba--card .ba__tag { font-size: 0.7rem; padding: 6px 11px; bottom: 10px; }
.ba--card .ba__tag--before { left: 10px; }
.ba--card .ba__tag--after { right: 10px; }
@media (max-width: 640px) {
  .ba--card .ba__frame { aspect-ratio: 4 / 5; border-width: 0; }
  .ba--card picture { display: block; width: 100%; height: 100%; }
}

/* Dans la carte "Site vitrine" de Services */
.ba--lever .ba__frame { border-radius: 0 calc(var(--r-lg) - 12px) 16px 16px; }
.ba__caption--card { margin-top: 12px; padding: 0 4px 2px; gap: 8px 16px; }
.ba__caption--card .ba__who { color: var(--ink); }
.ba__caption--card .ba__name { font-size: 1.1rem; }
.ba__caption--card .ba__link { padding: 10px 16px; font-size: 0.85rem; }
@media (max-width: 640px) {
  .ba--lever .ba__frame { aspect-ratio: 9 / 14; }
  .ba__caption--card .ba__link { width: 100%; justify-content: center; }
}

/* Mobile : zone de glisser confortable, pas de menu contextuel au toucher long */
.ba__frame { -webkit-touch-callout: none; }
@media (hover: none) {
  .ba__knob { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
}
