/* ---------------------------------------------------------------------------
 * rush-chrome.css — the header store switcher ("the slate", spec §1.9), the
 * bottom mobile dock (§2.12) and, since REDESIGN r2 (Part C §C8), the
 * theme-aware header surface + the M19 cut underline. Site-wide chrome,
 * loaded after rush-home.css so its rules win on the legacy templates too.
 * Every colour is a role token (--t-*): the switcher and the dock render on
 * dark chrome and on paper chrome from the same rules.
 *
 * Gold discipline (r2, relaxed but still counted): the switcher is a MARK
 * surface — an 8px status dot, a hairline that turns gold on hover/focus and
 * one gold SWEEP (M18). The dock's Shop disc is the phone's gold fill; the
 * dock's fifth item is the theme toggle (owner decision 1).
 * ------------------------------------------------------------------------ */

/* ══ Header chrome (REDESIGN r2, Part C §C8) ════════════════════════════
 * The header's layout belongs to the page sheets (rush-shot.css on the front
 * page, rush-home.css on the routes); this block owns the theme-aware
 * surface and the cut underline (M19) on every route. */
.rush-header.is-scrolled { background-color: var(--t-header-bg); }
@media (min-width: 768px) {
	/* Blur backdrops only ≥ 768 and only after the LCP has landed (cost). */
	html.rush-loaded .rush-header.is-scrolled,
	html.rush-loaded .rush-header[data-rush-header]:not(.is-scrolled):hover {
		-webkit-backdrop-filter: blur(18px);
		backdrop-filter: blur(18px);
	}
}
/* M19: the nav underline is a 30° cut, drawn from the left, un-drawn from the left. */
.rush-nav-links a::after {
	background: var(--t-gold-text);
	border-radius: 0;
	clip-path: polygon(0 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
	transition: transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
	.rush-nav-links a::after { transition: none; }
}

/* ══ Header store switcher ══════════════════════════════════════════════ */
.rush-storesw {
	display: inline-flex;
	align-items: center;
	min-width: 0;
	max-width: 100%;
}
.rush-storesw[hidden] { display: none; }
.rush-storesw-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 160px;
	max-width: 100%;
	height: 40px;
	padding: 0 12px 0 14px;
	border: 1px solid var(--t-line);
	border-radius: 999px;
	background: var(--t-bg-3);
	color: var(--t-fg);
	font-family: "Work Sans", "Helvetica Neue", sans-serif;
	text-align: left;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: border-color 150ms ease;
	box-sizing: border-box;
	position: relative;
	overflow: hidden;
	isolation: isolate;
}
/* M18: one gold sweep across the pill on hover / focus (motion only). */
.rush-storesw-btn::before {
	content: "";
	position: absolute;
	top: -20%;
	bottom: -20%;
	left: 0;
	width: 40%;
	background: var(--t-sweep);
	mix-blend-mode: var(--t-sweep-blend);
	transform: translateX(-140%) skewX(-30deg);
	pointer-events: none;
	z-index: 0;
}
.rush-storesw-btn > * { position: relative; z-index: 1; }
@keyframes rush-chrome-sweep {
	from { transform: translateX(-140%) skewX(-30deg); }
	to   { transform: translateX(240%) skewX(-30deg); }
}
@media (hover: hover) {
	html.rush-motion .rush-storesw-btn:hover::before,
	html.rush-motion .rush-storesw-btn:focus-visible::before { animation: rush-chrome-sweep 450ms cubic-bezier(0.77, 0, 0.18, 1) both; }
}
.rush-storesw-btn:hover,
.rush-storesw-btn[aria-expanded="true"] { border-color: var(--t-gold); }
.rush-storesw-btn:focus-visible {
	outline: 2px solid var(--t-focus);
	outline-offset: 3px;
}
.rush-storesw-dot {
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--t-fg-3);
	box-sizing: border-box;
	visibility: hidden;
}
.rush-storesw.is-set .rush-storesw-dot,
.rush-storesw.is-viewing .rush-storesw-dot { visibility: visible; }
.rush-storesw.is-open .rush-storesw-dot { background: var(--t-gold); }
/* The open dot breathes (M11), motion only. */
@keyframes rush-chrome-pulse {
	0%   { box-shadow: 0 0 0 0 var(--t-glow); }
	100% { box-shadow: 0 0 0 10px transparent; }
}
html.rush-motion .rush-storesw.is-open .rush-storesw-dot { animation: rush-chrome-pulse 2.4s ease-out infinite; }
.rush-storesw.is-closed .rush-storesw-dot { background: var(--t-fg-3); }
/* Viewing (URL-named, not saved): a hollow dot — the page is about this
 * store, but nobody has claimed it. */
.rush-storesw.is-viewing .rush-storesw-dot {
	background: transparent;
	border: 1.5px solid currentColor;
}
.rush-storesw.is-viewing.is-open .rush-storesw-dot { border-color: var(--t-gold); }
.rush-storesw-text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	line-height: 1.1;
}
.rush-storesw-kicker {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--t-fg-2);
}
.rush-storesw-name {
	display: block;
	max-width: 18ch;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 14px;
	font-weight: 800;
	letter-spacing: 0.01em;
	color: var(--t-fg);
}
.rush-storesw-caret {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	color: var(--t-fg-3);
}
.rush-storesw-caret svg { width: 100%; height: 100%; display: block; }
.rush-storesw-btn:hover .rush-storesw-caret { color: var(--t-gold-text); }
/* Legacy pin (old markup) stays hidden if a stale template still prints it. */
.rush-storesw-pin { display: none; }

@media (max-width: 767px) {
	.rush-storesw { max-width: 44vw; flex: 1 1 auto; min-width: 0; }
	.rush-storesw-btn { min-width: 0; padding: 0 10px 0 12px; gap: 8px; }
	/* r2 fix (P2 CLS): the name slot never collapses below ~10ch, so the
	 * neutral label → store name rebind does not re-lay the header. */
	.rush-storesw-name { max-width: 100%; min-width: 10ch; font-size: 13px; }
}
@media (min-width: 768px) { .rush-storesw-name { min-width: 12ch; } } /* r2 fix (P2 CLS): the neutral label → name swap keeps its slot on the routes too */
/* r2 fix (P0): the ROUTE header (switcher + toggle + "Shop Now") re-broke the
 * 1.20.1 phone geometry — "Hazel…" and a two-line pill. Under 480px the
 * header toggle steps aside (the dock's fifth item is the theme) and the
 * pill never wraps. The front page's header has no Shop pill, so its toggle
 * stays. */
.rush-nav-actions .rush-button { white-space: nowrap; }
@media (max-width: 479px) {
	.rush-nav-actions .rush-theme--header { display: none; }
}
/* r2 fix (P1): the REAL wordmark inked on the light theme (gold on paper is
 * 1.8:1). rush-home.css's drop-shadow filter is replaced here (loads later). */
:root:not([data-theme="dark"]) .rush-brand-logo { filter: brightness(0); }
@media (max-width: 480px) {
	/* The kicker leaves the visible pill but stays in the accessible name
	 * ("Your store Hazel Park"), so a phone reader still hears what the
	 * button is for. */
	.rush-storesw-kicker {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}
	.rush-storesw-caret { display: none; }
}

/* ══ Bottom dock (≤ 767) ════════════════════════════════════════════════ */
nav.rush-dock { display: none; }
@media (max-width: 767px) {
	nav.rush-dock {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 800;
		align-items: flex-end;
		justify-content: space-around;
		height: calc(64px + env(safe-area-inset-bottom));
		padding: 0 max(4px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-right));
		background-color: var(--t-dock-bg);
		-webkit-backdrop-filter: blur(18px);
		backdrop-filter: blur(18px);
		border-top: 0;
		box-sizing: border-box;
	}
	html.rush-loaded nav.rush-dock {
		/* soft-light: the grain is a dark texture, so it reads on the dark dock and
		 * is measurably nothing on the paper one — no theme branch needed. */
		background-image: url("../img/rush-black-grain.webp?v=1.23.2");
		background-size: 512px 512px;
		background-blend-mode: soft-light;
	}
	nav.rush-dock::before {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		top: 0;
		height: 1px;
		background: var(--t-gold);
		opacity: 0.9;
	}
	nav.rush-dock .rush-dock-item {
		position: relative;
		flex: 1 1 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: flex-end;
		gap: 4px;
		height: 64px;
		padding: 0 0 9px;
		text-decoration: none;
		color: var(--t-fg-2);
		font-family: "Work Sans", "Helvetica Neue", sans-serif;
		font-size: 12px; /* r2 fix: 11px labels were under the review floor */
		font-weight: 800;
		letter-spacing: 0.05em;
		text-transform: uppercase;
		-webkit-tap-highlight-color: transparent;
	}
	nav.rush-dock .rush-dock-item::after {
		content: "";
		position: absolute;
		left: 18%;
		right: 18%;
		top: 0;
		height: 2px;
		background: var(--t-gold);
		transform: scaleX(0);
		transform-origin: center;
		transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
	}
	nav.rush-dock .rush-dock-item.is-active { color: var(--t-gold-text); }
	nav.rush-dock .rush-dock-item.is-active::after { transform: scaleX(1); }
	/* r2 fix (P1): on the paper dock the active LABEL is ink (#9a5e00 sampled
	 * 3.9–4.0:1 through the blur); the gold state stays on the icon + rule. */
	:root:not([data-theme="dark"]) nav.rush-dock .rush-dock-item.is-active { color: var(--t-fg); }
	:root:not([data-theme="dark"]) nav.rush-dock .rush-dock-item.is-active .rush-dock-ic { color: var(--t-gold-text); }
	:root:not([data-theme="dark"]) nav.rush-dock { background-color: rgba(251, 250, 244, 0.97); } /* fixed: paper dock, near-opaque */
	html.rush-loaded:not([data-theme="dark"]) nav.rush-dock { background-image: none; }
	nav.rush-dock .rush-dock-ic { display: block; }
	nav.rush-dock .rush-dock-ic svg { width: 22px; height: 22px; display: block; }
	/* The Shop disc: the mobile gold fill. Raised 14px, R monogram in carbon. */
	nav.rush-dock .rush-dock-shop { color: var(--t-fg-2); }
	nav.rush-dock .rush-dock-shop.is-active { color: var(--t-gold-text); }
	nav.rush-dock .rush-dock-shop::after { display: none; }
	nav.rush-dock .rush-dock-shop .rush-dock-ic {
		display: grid;
		place-items: center;
		width: 52px;
		height: 52px;
		margin-top: -14px;
		border-radius: 50%;
		background: var(--t-gold);
		color: var(--t-on-gold);
		box-shadow: var(--t-shadow-card), 0 0 0 4px var(--t-dock-bg);
	}
	nav.rush-dock .rush-dock-shop .rush-dock-ic svg { width: 24px; height: 24px; }
	/* r2: the disc is foil once the LCP has landed (flat gold until then). */
	html.rush-loaded nav.rush-dock .rush-dock-shop .rush-dock-ic {
		background-image: linear-gradient(rgba(255, 170, 0, 0.72), rgba(255, 170, 0, 0.72)), url("../img/rush-gold-texture.webp?v=1.23.2"); /* fixed: foil flat over the texture */
		background-size: cover;
	}
	nav.rush-dock .rush-dock-shop .rush-dock-ic img {
		display: block;
		width: 30px;
		height: 30px;
		object-fit: contain;
		/* The monogram asset is the GOLD R; on the gold disc it must read as
		 * carbon (spec §2.12), so it is inked here rather than shipping a
		 * second derivative. */
		filter: brightness(0) saturate(0);
		opacity: 0.94;
	}
	nav.rush-dock .rush-dock-item:focus-visible {
		outline: 2px solid var(--t-focus);
		outline-offset: -4px;
		border-radius: 8px;
	}
	/* r2 Part A §A6 — dock item 5 is the theme toggle (rush_canna_theme_toggle('dock')).
	 * The wrapper is a .rush-dock-item like the others; the button fills it. */
	nav.rush-dock .rush-dock-theme { padding: 0; }
	nav.rush-dock .rush-theme--dock {
		inline-size: 100%;
		block-size: 64px;
		padding: 0 0 9px;
		font: inherit;
		letter-spacing: inherit;
		text-transform: inherit;
		color: inherit;
	}
	nav.rush-dock .rush-theme--dock .rush-theme-orb { inline-size: 24px; block-size: 24px; color: inherit; }
	nav.rush-dock .rush-theme--dock .rush-theme-orb svg { width: 24px; height: 24px; }
	body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
	.rush-mobile-sticky { display: none !important; }
}
