/* Shared rail (templates/rail/README.md). Only rows that rail.ts upgraded are touched; without JavaScript the page's own CSS decides
   (a sideways-scrollable row, or a grid). `build-mock init` copies this file next to a mock's styles.css: link it before styles.css. */

/* the window the endless row is seen through: clips sideways only (shadows and hover lifts may still spill up and down), takes its width
   from the page, never from the (very wide) track inside, and leaves vertical swipes to the page */
.rail-live { position: relative; overflow: hidden; contain: inline-size; min-width: 0; touch-action: pan-y; touch-action: pan-y pinch-zoom; }
@supports (overflow: clip) { .rail-live { overflow: clip visible; } }
@media (hover: hover) and (pointer: fine) { .rail-live { cursor: grab; } }
.rail-live.rail-grab, .rail-live.rail-grab * { cursor: grabbing; }
.rail-grab { -webkit-user-select: none; user-select: none; }
.rail-live img { -webkit-user-drag: none; }

/* the row itself is the track: one line, moved by a transform on its own layer (never by scrolling). It is as wide as all its sets, so the
   page's own observers (scroll reveals) still see it on screen wherever it has moved to. */
.rail-on { width: max-content !important; min-width: 100% !important; max-width: none !important; overflow: visible !important; flex-wrap: nowrap !important; scroll-snap-type: none !important; transform: translate3d(0, 0, 0); }
.rail-moving { will-change: transform; }
[data-rail]:not(.rail-on) > [data-rail-copy] { display: none !important; }

/* a row the component refused (its items fit, or there are too few to scroll) and that asked for a grid: data-rail-fit="grid" */
.rail-grid { flex-wrap: wrap !important; overflow: visible !important; row-gap: var(--rail-row-gap, 24px); }

/* arrow buttons (mouse and trackpad screens only); a page may restyle .rail-btn or place them with data-rail-arrows="<selector>" */
.rail-nav[hidden] { display: none !important; }
.rail-vp > .rail-nav { display: contents; }
.rail-btn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgb(0 0 0 / .12); border-radius: 50%;
  background: rgb(255 255 255 / .96); color: #111; cursor: pointer; box-shadow: 0 4px 14px rgb(0 0 0 / .16);
  transition: transform 120ms ease-out, background-color 150ms ease-out, color 150ms ease-out;
}
.rail-btn:active { transform: scale(.92); }
.rail-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rail-vp > .rail-nav > .rail-btn { position: absolute; z-index: 3; top: var(--rail-btn-top, 50%); margin-top: -22px; }
.rail-vp > .rail-nav > .rail-prev { left: var(--rail-btn-inset, 8px); }
.rail-vp > .rail-nav > .rail-next { right: var(--rail-btn-inset, 8px); }
@media (hover: none) { .rail-vp > .rail-nav { display: none; } }
@media (prefers-reduced-motion: reduce) { .rail-btn { transition: none; } }
