/**
 * HFM Garage Bar — hero card matching the garage badge's vehicle preview.
 *
 * Layout:
 *   ┌───────────────────────────────────────┐
 *   │           Car image hero              │
 *   │       (drive-in / drive-out)          │
 *   ├───────────────────────────────────────┤
 *   │ FILTERING BY            [Change]      │
 *   │ Silvia/200SX S14        [Clear]       │
 *   │ Nissan · 1993-2000                    │
 *   └───────────────────────────────────────┘
 *
 * Used on:
 *   - Category / shop archives (edge-to-edge full-bleed)
 *   - Search and taxonomy pages
 */

.hfm-garagebar {
	position: relative;
	display: flex;
	align-items: stretch;
	margin: 0 0 18px;
	border-radius: 10px;
	border: 1px solid var(--hfm-line);
	background: light-dark(#f5f5f5, #1a1a1a);
	overflow: hidden;
	cursor: pointer;
	transition: background-color 160ms ease;
	-webkit-tap-highlight-color: transparent;
}
.hfm-garagebar:hover {
	background: light-dark(#eeeeee, #1f1f1f);
}
.hfm-garagebar:focus-visible {
	outline: 2px solid var(--hfm-accent);
	outline-offset: 2px;
}

/* ── Edge-to-edge on archive — single-row card spans the full viewport.
   Standard "100vw breakout" so the card "falls off" both horizontal edges
   regardless of parent padding. */
.hfm-garagebar--ctx-archive {
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	width: 100vw;
	max-width: 100vw;
	border-radius: 0;
	border-left: 0;
	border-right: 0;
}

/* ── Image hero ───────────────────────────────────────────────── */

.hfm-garagebar__hero {
	position: relative;
	display: block;
	/* Capped below the image's effective right edge (image width 200 - 35
	   left-offset = 165) so the boot always bleeds past the hero. */
	flex: 0 0 clamp(130px, 18vw, 158px);
	height: 80px;
	overflow: hidden;
	background: light-dark(#efefef, #1f1f1f);
}
.hfm-garagebar__img {
	position: absolute;
	top: 0;
	bottom: 0;
	/* Image is wider than the hero column so the rear of the car
	   bleeds past the right edge (overflow:hidden on .hero clips it). */
	left: -35px;
	width: 200px;
	height: 100%;
	object-fit: cover;
	object-position: left center;
	display: block;
	will-change: transform;
}

/* ── Info panel (matches .hfm-vp-preview__info from the garage badge) ── */

.hfm-garagebar__panel {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0;
	padding: 10px clamp(14px, 3vw, 24px);
	background: transparent; /* inherits .hfm-garagebar's surface */
}

.hfm-garagebar__copy {
	flex: 1 1 auto;
	min-width: 0;
}

.hfm-garagebar__eyebrow {
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hfm-accent);
	line-height: 1.2;
}

.hfm-garagebar__title {
	font-size: clamp(15px, 2.4vw, 20px);
	font-weight: 800;
	color: var(--hfm-ink);
	line-height: 1.15;
	margin-top: 3px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hfm-garagebar__detail {
	font-size: 11px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	color: var(--hfm-ink-2);
	margin-top: 3px;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}


/* ── Mobile — stacked card: image hero on top, info panel below ── */

@media (max-width: 640px) {
	.hfm-garagebar {
		flex-direction: column;
		align-items: stretch;
		margin-bottom: 14px;
	}
	.hfm-garagebar__hero {
		flex: 0 0 auto;
		width: 100%;
		height: clamp(110px, 28vw, 150px);
	}
	.hfm-garagebar__img {
		left: -16%;
		width: 80%;
		object-position: left center;
	}
	.hfm-garagebar__panel {
		padding: 10px 16px 12px;
	}
	.hfm-garagebar__title {
		font-size: 17px;
	}
	.hfm-garagebar__detail {
		font-size: 11px;
	}
}

/* ── Spacer (reserves space when sticky variant pins the bar) ───── */
.hfm-garagebar__spacer {
	display: none;
}

/* ── Reduced motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.hfm-garagebar,
	.hfm-garagebar__btn {
		transition: none;
	}
	.hfm-garagebar__img.drive-out-right,
	.hfm-garagebar__img.drive-in-left {
		animation: none !important;
		transform: none !important;
	}
}
