/* Before-and-after sliders (library: builders/before-after-slider), and the tabs that switch between jobs.
   Lift out: remove this file, compare.js and the {{ba:…}} / .ba-switch markup. */
.ba-fig { margin: 0; }
.ba { position: relative; overflow: hidden; border-radius: 20px; background: #dfe9ec; aspect-ratio: 4 / 3; user-select: none; -webkit-user-select: none; touch-action: pan-y; box-shadow: var(--shadow-l); }
.ba-layer { position: absolute; inset: 0; }
.ba-layer > svg { width: 100%; height: 100%; display: block; }
.ba-after { clip-path: inset(0 0 0 50%); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; pointer-events: none; }
.ba-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .15); }
.ba-knob { position: absolute; top: 50%; left: 0; width: 52px; height: 52px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--yolk); box-shadow: 0 4px 14px rgb(0 0 0 / .3); display: grid; place-items: center; color: var(--ink); transition: transform .2s; }
.ba-knob svg { width: 26px; height: 26px; }
.ba.is-dragging .ba-knob { transform: translate(-50%, -50%) scale(1.1); }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.ba-range:focus-visible + .ba-handle .ba-knob { outline: 3px solid var(--focus); outline-offset: 3px; }
.ba-tag { position: absolute; top: 12px; padding: 7px 11px; border-radius: 999px; background: rgb(19 32 29 / .82); color: #fff; font: 700 .75rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
.ba-tag.before { left: 12px; }
.ba-tag.after { right: 12px; background: var(--yolk); color: var(--ink); }
.ba-fig figcaption { margin-top: 12px; font-size: .95rem; color: var(--muted); }
.no-js .ba-after { clip-path: none; }
.no-js .ba-range, .no-js .ba-handle, .no-js .ba-tag.before { display: none; }

/* Job tabs over the sliders: radio buttons and CSS, so they work with scripts off. */
.ba-switch { position: relative; }
.ba-switch > input { position: absolute; opacity: 0; pointer-events: none; }
.ba-tabs { display: flex; gap: 6px; margin: 0 0 16px; padding: 5px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; }
.ba-tabs label { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background-color .2s, color .2s; }
.ba-tabs label:hover { background: var(--sage); }
.ba-panel { display: none; }
#ba-out:checked ~ .ba-tabs [for="ba-out"], #ba-in:checked ~ .ba-tabs [for="ba-in"], #ba-rep:checked ~ .ba-tabs [for="ba-rep"] { background: var(--ink); color: var(--paper); }
#ba-out:focus-visible ~ .ba-tabs [for="ba-out"], #ba-in:focus-visible ~ .ba-tabs [for="ba-in"], #ba-rep:focus-visible ~ .ba-tabs [for="ba-rep"] { outline: 3px solid var(--focus); outline-offset: 2px; }
#ba-out:checked ~ .ba-panels .p-out, #ba-in:checked ~ .ba-panels .p-in, #ba-rep:checked ~ .ba-panels .p-rep { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .ba-panel { animation: ba-in .45s var(--ease, ease) both; }
}
@keyframes ba-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .ba-knob { transition: none; } }
