/* Before and after: the kit block signatures/before-and-after-slider (claude-skills/website-builder), style part, with
   the kh- prefix. Pasted 2026-11-28 for Task 18; the Kissell lines sit just before the reduced-motion rule. */
/* Before and after: two photos of one job. With no script the after photo shows first and the before photo sits under
   it as a plain figure with its caption. The script adds the ba-on class, which stacks them in one box: the before
   photo underneath, the after photo on top. The slider clips the top photo from the left to a handle; the crossfade
   (the ba-fade class) fades it by opacity. --ba-x is the handle's place in percent of the box width. */
.kh-ba-sec{padding:12vh 6% 10vh;container-type:inline-size;container-name:ba;color:var(--kh-ba-ink,#1a1a1a)}
.kh-ba-head{max-width:900px;margin:0 auto 32px;text-align:center}
.kh-ba-head small{display:block;margin-bottom:10px;font-size:14px;letter-spacing:.14em;text-transform:uppercase;color:var(--kh-ba-muted,#6b665c)}
.kh-ba-head h2{margin:0;font-size:clamp(26px,4.4cqw,56px);line-height:1.06;font-weight:600;letter-spacing:-.01em}
/* No script: two plain figures, after first, each at most 78vh tall, its caption on the photo's corner. */
.kh-ba-box{display:flex;flex-direction:column;align-items:center;gap:16px;margin:0 auto}
.kh-ba-fig{position:relative;margin:0;max-width:100%}
.kh-ba-top{order:-1}
.kh-ba-img{display:block;width:auto;height:auto;max-width:100%;max-height:78vh}
.kh-ba-tag{position:absolute;top:14px;left:14px;margin:0;padding:4px 10px;background:var(--kh-ba-tag,rgba(0,0,0,.62));color:#fff;font-size:13px;line-height:1.4;letter-spacing:.1em;text-transform:uppercase;pointer-events:none}
.kh-ba-range,.kh-ba-handle,.kh-ba-pills{display:none}
/* Script on: one box at the after photo's shape. --ba-x is registered as a number so the one-time nudge can run as a
   CSS transition, with no frame loop. */
@property --kh-ba-x{syntax:'<number>';inherits:true;initial-value:50}
.kh-ba-nudging{transition:--kh-ba-x var(--kh-ba-dur,.9s) cubic-bezier(.65,0,.35,1)}
.kh-ba-on .kh-ba-box{--kh-ba-x:50;display:block;position:relative;width:min(100%,1100px,calc(78vh * var(--kh-ba-r,1.3333)));aspect-ratio:var(--kh-ba-r,1.3333);overflow:hidden;background:var(--kh-ba-ground,#ddd8ce);touch-action:pan-y;cursor:ew-resize;user-select:none;-webkit-user-select:none}
.kh-ba-on .kh-ba-fig{position:absolute;inset:0;max-width:none}
.kh-ba-on .kh-ba-img{position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;pointer-events:none}
/* Each pair's own alignment: the script copies data-bz, data-bx and data-by from the before photo into these. */
.kh-ba-on .kh-ba-before{transform:translate(calc(var(--kh-ba-bx,0) * 1%),calc(var(--kh-ba-by,0) * 1%)) scale(var(--kh-ba-bz,1))}
.kh-ba-on .kh-ba-top{clip-path:inset(0 0 0 calc(var(--kh-ba-x) * 1%))}
.kh-ba-on .kh-ba-tag-a{left:auto;right:14px}
/* The range input is the slider's keyboard and screen-reader control. It stays in the page, one pixel square at the
   handle, so focus never jumps, and its focus ring shows on the knob. */
.kh-ba-on .kh-ba-range{display:block;position:absolute;left:calc(var(--kh-ba-x) * 1%);top:50%;width:1px;height:1px;margin:0;padding:0;opacity:0;pointer-events:none}
.kh-ba-on .kh-ba-handle{display:block;position:absolute;top:0;bottom:0;left:calc(var(--kh-ba-x) * 1%);width:0;pointer-events:none}
.kh-ba-handle::before{content:"";position:absolute;top:0;bottom:0;left:-1px;width:2px;background:var(--kh-ba-line,#fff);box-shadow:0 0 10px rgba(0,0,0,.45)}
.kh-ba-knob{position:absolute;top:50%;left:0;width:var(--kh-ba-handle,44px);height:var(--kh-ba-handle,44px);transform:translate(-50%,-50%);border-radius:50%;background:var(--kh-ba-line,#fff);box-shadow:0 2px 12px rgba(0,0,0,.35);display:grid;place-items:center;color:var(--kh-ba-ink,#1a1a1a)}
.kh-ba-knob svg{width:56%;height:56%}
.kh-ba-range:focus-visible ~ .kh-ba-handle .kh-ba-knob{outline:3px solid var(--kh-ba-accent,#b5651d);outline-offset:3px}
.kh-ba-cap{max-width:900px;margin:18px auto 0;text-align:center;color:var(--kh-ba-muted,#6b665c)}
/* Crossfade: the after photo fades over the before photo. Two buttons pick the photo; a tap on the photo swaps. The
   handle, the range input and the corner tags hide, since the pressed button names the photo that shows. */
.kh-ba-fade .kh-ba-box{cursor:pointer}
.kh-ba-fade .kh-ba-top{clip-path:none;opacity:var(--kh-ba-o,1);transition:opacity var(--kh-ba-fade-dur,.6s) ease}
.kh-ba-fade .kh-ba-handle,.kh-ba-fade .kh-ba-range,.kh-ba-fade .kh-ba-tag{display:none}
.kh-ba-fade .kh-ba-pills{display:flex;justify-content:center;margin:18px auto 0}
.kh-ba-pills button{min-height:44px;padding:12px 22px;font:600 15px/1 system-ui,sans-serif;letter-spacing:.06em;text-transform:uppercase;border:2px solid var(--kh-ba-ink,#1a1a1a);background:transparent;color:var(--kh-ba-ink,#1a1a1a);cursor:pointer}
.kh-ba-pills button + button{border-left:0}
.kh-ba-pills button[aria-pressed="true"]{background:var(--kh-ba-ink,#1a1a1a);color:var(--kh-ba-paper,#f4f2ee)}
.kh-ba-pills button:focus-visible{outline:3px solid var(--kh-ba-accent,#b5651d);outline-offset:3px}
/* The script's ba-cut class sets a photo with no fade: the first view parks on before this way, out of sight. */
.kh-ba-cut .kh-ba-top{transition:none}
/* Kissell (Task 18, 2026-11-28): the block on a paper band in the site's tokens and faces, its heading at the size of
   the other bands' headings. No eyebrow line over it (DESIGN.md prohibitions), so the kit's small label is left out. */
.kh-ba-sec{background:var(--kh-paper);padding:88px 24px 96px;--kh-ba-ink:var(--kh-ink);--kh-ba-muted:var(--kh-muted);--kh-ba-paper:var(--kh-paper);--kh-ba-accent:var(--kh-ink);--kh-ba-ground:#cfccc5}
.kh-ba-head h2{font-size:clamp(2.6rem,6vw,5.4rem);font-weight:bold;line-height:.96;letter-spacing:.005em}
.kh-ba-pills button{font-family:var(--kh-sans)}
/* The optional caption line under the pills (Task 21 fix, 2026-11-29) at the size of a section lead. */
.kh-ba-cap{max-width:46ch;font-size:clamp(1.1rem,1.5vw,1.3rem);line-height:1.4}
@media (max-width:600px){
  .kh-ba-sec{padding:64px 16px}
}
/* Reduced motion stays last so it wins every cascade: the buttons and the handle move the photo with no fade or glide. */
@media (prefers-reduced-motion:reduce){
  .kh-ba-fade .kh-ba-top,.kh-ba-nudging{transition:none}
}
