/* ─── Before / after compare slider ───────────────────────────────────
   Two stacked images; drag the handle (or use the keyboard — the control is a
   native range input, so keyboard + click + drag all work for free) to wipe
   between "before" and "after". Built for transformations (yards, remodels,
   restorations). compare.js (widget) maps the range value to --hzo-compare-pos.
   Markup: blocks/compare.html + the [hzo_compare] shortcode (compare.php).
   Horizontal-only by design — the clip-path inset, divider offset, and
   ew-resize cursor are all left/right. */
.hzo-compare {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-panel);
    aspect-ratio: 16 / 9;
    --hzo-compare-pos: 50%;
    user-select: none;
}
.hzo-compare__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
}
/* The "before" image sits on top, clipped from the right to --hzo-compare-pos,
   so the left portion shows "before" and the right reveals the "after" beneath. */
.hzo-compare__img--before {
    clip-path: inset(0 calc(100% - var(--hzo-compare-pos)) 0 0);
}
.hzo-compare__divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--hzo-compare-pos);
    width: 2px;
    margin-left: -1px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}
.hzo-compare__divider::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    transform: translate(-50%, -50%);
    border: var(--border-2) solid #fff;
    border-radius: var(--radius-full);   /* geometric circle — must stay round under square-corner archetypes */
    background: color-mix(in srgb, var(--brand) 80%, transparent);
    box-shadow: var(--shadow-md);
}
/* The accessible control: a real range input overlaying the whole image. */
.hzo-compare__range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
    /* G21/G43: claim horizontal drags for the wipe while leaving vertical
       gestures to scroll the page — so a touch-drag anywhere on the image
       moves the divider (a native range only follows a grab on its thumb),
       and compare.js's pointer handler gets continuous pointermove events. */
    touch-action: pan-y;
}
.hzo-compare__range:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.hzo-compare__label {
    position: absolute;
    bottom: var(--space-md);
    padding: var(--space-xs) var(--space-smd);
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--brand-deep) 72%, transparent);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: var(--fw-500);
    pointer-events: none;
}
.hzo-compare__label--before { left: var(--space-md); }
.hzo-compare__label--after  { right: var(--space-md); }

/* Reduced motion: the widget itself never animates (the wipe tracks the
   user's own input 1:1 — no transitions above), but kill any theme-added
   transitions/animations so the divider and clip never lag a gesture for
   motion-sensitive users. */
@media (prefers-reduced-motion: reduce) {
    .hzo-compare,
    .hzo-compare * {
        transition: none !important;
        animation: none !important;
    }
}
