/* Before and after (the build's pairs, compare.js): in the brand's tokens only (brand.css), so it
   follows the site's style, its corners and its pills. With no script the two photos stand side by
   side, each in its own rounded frame with its pill; with the script they are one frame, the after
   photo cut at the handle. Sizes on the 8 px grid. */
.ba { position: relative; display: flex; flex-direction: column; gap: 16px; margin: 0; min-width: 0; }
.ba__stage { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ba__half { position: relative; aspect-ratio: var(--ba-ratio, 4 / 3); overflow: hidden; border-radius: var(--r-lg); background: var(--card, var(--fill)); }
.ba__img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.ba__tag { position: absolute; top: 16px; left: 16px; display: inline-flex; align-items: center; min-height: 32px; padding: 0 16px; border-radius: var(--r-pill); background: var(--c-paper); color: var(--c-ink); pointer-events: none; box-shadow: 0 0 0 1px var(--line); }
.ba__half--after .ba__tag { background: var(--c-accent); color: var(--c-on-accent); box-shadow: none; }
.ba__slot { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.ba__cap { display: flex; flex-direction: column; gap: 4px; }
.ba__meta { color: var(--quiet); }

/* One frame: both photos in the same place, the after photo shown right of the handle. */
.ba.is-live .ba__stage { display: block; aspect-ratio: var(--ba-ratio, 4 / 3); overflow: hidden; border-radius: var(--r-lg); touch-action: pan-y; cursor: ew-resize; -webkit-tap-highlight-color: transparent; }
.ba.is-live .ba__half { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.ba.is-live .ba__half--after { clip-path: inset(0 0 0 var(--ba-pos, 50%)); }
.ba.is-live .ba__half--after .ba__tag { left: auto; right: 16px; }
.ba.is-dragging { user-select: none; }
.ba__line { position: absolute; top: 0; bottom: 0; left: var(--ba-pos, 50%); width: 2px; margin-left: -1px; background: var(--c-paper); box-shadow: 0 0 0 1px var(--line); pointer-events: none; }
.ba__handle { position: absolute; top: 50%; left: var(--ba-pos, 50%); display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: var(--c-paper); color: var(--c-ink); box-shadow: var(--shadow-2); outline: none; touch-action: pan-y; cursor: ew-resize; transition: transform var(--t-fast) var(--ease-out); }
.ba__handle svg { display: block; width: 24px; height: 24px; }
.ba__handle:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.ba.is-dragging .ba__handle { transform: scale(1.08); }
@media (hover: hover) { .ba__handle:hover { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .ba__handle { transition: none; } .ba.is-dragging .ba__handle, .ba__handle:hover { transform: none; } }

/* The gallery page's section and the grids that hold pairs. */
.ba-sec { padding: 64px 0; background: var(--c-paper); --ground: var(--c-paper); color: var(--c-ink); }
.ba-sec > .s__in { display: flex; flex-direction: column; gap: 48px; }
.ba-sec__head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 720px; }
.ba-sec__lead { color: var(--quiet); }
.ba-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .ba-sec { padding: 48px 0; } }
@media (max-width: 640px) {
  .ba-sec { padding: 40px 0; }
  .ba-sec > .s__in { gap: 32px; }
  .ba-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .ba__stage { gap: 4px; }
  .ba__tag { top: 12px; left: 12px; min-height: 24px; padding: 0 12px; }
  .ba.is-live .ba__half--after .ba__tag { right: 12px; }
}

/* The gallery page's pairs, one at a time (compare.js carousel): each pair as big as the screen
   allows (its frame at most 70 % of the window's height, 720 px), in a strip that snaps to it and
   scrolls on one axis with no drawn bar. The buttons and "2 of 7" share one centre line. */
.ba-car { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.ba-car__track { display: flex; gap: 32px; margin: 0 -4px; padding: 0 4px; scroll-padding: 0 4px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ba-car__track::-webkit-scrollbar { display: none; }
.ba-car__track:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; }
.ba-car__track > .ba { flex: 0 0 100%; align-items: center; scroll-snap-align: start; scroll-snap-stop: always; --ba-w: calc(min(70vh, 720px) * var(--ba-r, 1.333)); }
.ba-car__track > .ba > .ba__stage, .ba-car__track > .ba > .ba__cap { width: min(100%, var(--ba-w)); }
.ba-car__track > .ba:not(.is-live) > .ba__stage { width: min(100%, calc(var(--ba-w) * 2)); }
.ba-car__bar { display: flex; align-items: center; justify-content: center; gap: 16px; }
.ba-car__bar[hidden] { display: none; }
.ba-car__at { min-width: 96px; margin: 0; text-align: center; font-variant-numeric: tabular-nums; }
.ba-car__btn { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%;
  background: transparent; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-fast, 120ms) var(--ease-out, ease), border-color var(--t-fast, 120ms) var(--ease-out, ease), opacity var(--t-fast, 120ms) var(--ease-out, ease); }
.ba-car__btn svg { display: block; width: 24px; height: 24px; flex: none; }
.ba-car__btn:disabled { opacity: 0.32; cursor: default; }
@media (hover: hover) { .ba-car__btn:not(:disabled):hover { background: var(--fill-2); border-color: currentColor; } }
.ba-car__btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
/* The strip reaches 4 px past its column each side (its padding gives it back), so a caption's first
   letter keeps its ink: a strip that scrolls clips at its own edge. */
/* In the strip a finger turns the page; the handle and the strip along its line (the grip) drag it. */
.ba-car .ba.is-live .ba__stage { touch-action: pan-x pan-y; }
.ba-car .ba__handle { touch-action: none; }
.ba__grip { position: absolute; top: 0; bottom: 0; left: var(--ba-pos, 50%); width: 48px; margin-left: -24px; touch-action: none; cursor: ew-resize; }
@media (max-width: 640px) {
  .ba-car { gap: 16px; }
  .ba-car__track { gap: 16px; }
  .ba-car__track > .ba { --ba-w: calc(min(56vh, 720px) * var(--ba-r, 1.333)); }
}
