/* Tiraz Labs: home "before-after", THE paper band of the home page. Owner: B Home. See js/sections/before-after.js.
   Tokens flip inside .band-paper (ink text, leaf-deep actions, gold-ink prices). Logical properties; the clip of the "after"
   layer is physical by necessity (clip-path has no logical inset), mirrored per direction below.
   Phones: head · comparison · price/note/CTA. ≥ 900: text (reading start) | comparison (reading end). */

.ba { background: var(--bg); color: var(--text); }
.ba-layout { display: grid; gap: 28px; }
.ba-text { display: contents; }
.ba-text > .sec-head { margin-block-end: 0; }
.ba-side { display: grid; justify-items: start; gap: 14px; order: 3; }
.ba-price { margin: 0; }
.ba-was { text-decoration: line-through; }
.ba-note { margin: 0; color: var(--text-soft); max-width: 46ch; }
.ba-cta { margin-block-start: 8px; width: 100%; }
@media (max-width: 479px) { .ba-cta .btn { width: 100%; } }

/* the comparison */
.ba-frame { --ba: 50%; position: relative; order: 2; margin: 0; width: 100%; max-width: 560px; justify-self: center; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: var(--r-media); background: var(--surface-2); box-shadow: var(--shadow-2); isolation: isolate; user-select: none; -webkit-user-select: none; }
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ba-after-wrap { position: absolute; inset: 0; z-index: 1; clip-path: inset(0 0 0 var(--ba)); }           /* LTR: after on the right */
html[dir="rtl"] .ba-after-wrap { clip-path: inset(0 var(--ba) 0 0); }                                       /* RTL: after on the left */
.ba-line { position: absolute; z-index: 2; inset-block: 0; inset-inline-start: var(--ba); width: 2px; margin-inline-start: -1px; background: var(--paper);
  box-shadow: 0 0 0 1px rgba(var(--ink-rgb), .18); pointer-events: none; }
.ba-knob { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; translate: -50% -50%; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--paper); color: var(--ink); box-shadow: 0 6px 20px rgba(var(--ink-rgb), .28); transition: scale var(--dur-2) var(--ease-out); }
html[dir="rtl"] .ba-knob { translate: 50% -50%; }
.ba-tag { position: absolute; z-index: 3; inset-block-start: 14px; padding: 6px 12px; border-radius: var(--r-pill); font-size: var(--t-caption); font-weight: 500; line-height: 1.3;
  background: rgba(var(--ink-rgb), .72); color: var(--paper); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); pointer-events: none; }
.ba-tag-before { inset-inline-start: 14px; }
.ba-tag-after { inset-inline-end: 14px; }

/* the native range covers the whole frame: drag anywhere (touch: horizontal drags only, the page still scrolls vertically) */
.ba-range { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y;
  -webkit-appearance: none; appearance: none; background: transparent; }
.ba-range::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.ba-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 2px; height: 100%; background: transparent; }
.ba-range::-moz-range-track { height: 100%; background: transparent; }
.ba-range::-moz-range-thumb { width: 2px; height: 100%; border: 0; background: transparent; }
.ba-frame:has(.ba-range:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 4px; }
.ba-frame:has(.ba-range:focus-visible) .ba-knob { background: var(--accent-fill); color: var(--accent-ink); scale: 1.08; }
@media (hover: hover) { .ba-frame:hover .ba-knob { scale: 1.06; } }

@media (min-width: 900px) {
  .ba-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(40px, 6vw, 96px); align-items: center; }
  .ba-text { display: grid; gap: 28px; align-content: center; }
  .ba-frame { order: 0; max-width: min(100%, calc((100svh - var(--hdr-h) - 80px) * .8)); }
  .ba-side { order: 0; }
}
@media (prefers-reduced-motion: reduce) { .ba-knob { transition: none; } }
.ba-was { unicode-bidi: isolate; }
/* long labels (EN) wrap instead of overflowing on narrow phones */
@media (max-width: 479px) { #before-after .btn { white-space: normal; text-align: center; height: auto; min-height: 48px; padding-block: 10px; } }
