/**
 * Component: sticky rail, a sidebar column that stays in view on wide
 * screens (js/sticky-rail.js adds .is-sticky and sets `top`).
 *
 *     <aside class="sticky-rail" data-sticky-rail>…</aside>
 *
 * Without JS, and below --bp-lg, the rail is a static column, so nothing can
 * be cut off. Tokens are local: only this component uses them.
 *
 * @package cartrack
 */

.sticky-rail {
	/* Under the sticky header (and the admin bar); TODO: verify in Figma. */
	--sticky-rail-offset: calc(var(--header-height) + var(--wp-admin--admin-bar--height, 0px) + var(--space-md));
	--sticky-rail-gap: var(--space-md); /* Space kept below a rail taller than the viewport. */

	align-self: start; /* Sticky needs the rail shorter than its grid row. */
	min-inline-size: 0;
}

@media (min-width: 64em) { /* --bp-lg */
	.sticky-rail.is-sticky {
		position: sticky;
	}
}
