/* Floating scrollbar (client notes, image 3). It keeps to the edge opposite
   the side slips: right in English, left in Hebrew. Only the thumb takes
   the pointer, so the slips under the rail stay clickable. */

html:has(> body.site),
html:has(> body.villa) {
    scrollbar-width: none;
}

html:has(> body.site)::-webkit-scrollbar,
html:has(> body.villa)::-webkit-scrollbar {
    display: none;
}

.scroll-rail {
    position: fixed;
    inset-block: 0;
    right: 0;
    z-index: calc(var(--z-header) + 1);
    width: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-slow) var(--ease-out);
}

.scroll-rail.is-scrollable { opacity: 1; }

.scroll-rail__thumb {
    position: absolute;
    right: 3px;
    top: 0;
    width: 4px;
    height: var(--thumb-h, 80px);
    border-radius: 2px;
    background: var(--chrome-ink-light);
    box-shadow: 0 0 3px rgba(20, 18, 15, 0.35);
    opacity: 0.6;
    transform: translateY(var(--thumb-y, 0px));
    cursor: grab;
    pointer-events: auto;
    transition: width var(--dur-fast) var(--ease-out),
                opacity var(--dur-fast) var(--ease-out),
                background var(--dur-base) var(--ease-out);
}

.scroll-rail__thumb[data-bg="light"] {
    background: var(--chrome-ink-dark);
    box-shadow: none;
    opacity: 0.45;
}

.scroll-rail__thumb:hover,
.scroll-rail.is-dragging .scroll-rail__thumb {
    width: 6px;
    opacity: 0.85;
}

.scroll-rail.is-dragging .scroll-rail__thumb { cursor: grabbing; }

[dir="rtl"] .scroll-rail {
    right: auto;
    left: 0;
}

[dir="rtl"] .scroll-rail__thumb {
    right: auto;
    left: 3px;
}

@media (hover: none) {
    .scroll-rail__thumb { pointer-events: none; }
}
