/* ---------------------------------------------------------------------------
   RunBoats Bridge — marketplace listing cards, rendered inside the hub.

   Built on the Resources theme's own tokens (--type-*, --space-*, defined in
   the theme's style.css) with a literal fallback on every one, because this
   stylesheet is enqueued from a plugin and must not assume a particular theme
   is active.

   NO `background` SHORTHAND ANYWHERE. A shorthand resets background-size to
   auto and silently kills any longhand declared above it — a paint-only bug
   that passes every geometry check. Longhands only.

   Class prefix is rbl- ("RunBoats listings") and NOT rbh-, which the
   marketplace side already uses for its guides box. Same repo, two documents,
   and one origin: a shared prefix would eventually collide.
--------------------------------------------------------------------------- */

.rbl-box {
	margin: var(--space-xl, 32px) 0;
}

.rbl-box__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-md, 16px);
	margin: 0 0 var(--space-md, 16px);
}

.rbl-box__title {
	margin: 0;
	font-size: var(--type-md, 1.125rem);
	line-height: 1.3;
}

/* --- Grid ----------------------------------------------------------------
   Column count arrives as a class, never inline: an inline custom property
   beats every stylesheet rule on the same element and would leave the
   breakpoints below unable to clamp anything down on a phone.
------------------------------------------------------------------------- */

.rbl-box__grid {
	display: grid;
	grid-template-columns: repeat(var(--rbl-cols, 4), minmax(0, 1fr));
	gap: var(--space-lg, 24px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.rbl-box--cols-1 .rbl-box__grid { --rbl-cols: 1; }
.rbl-box--cols-2 .rbl-box__grid { --rbl-cols: 2; }
.rbl-box--cols-3 .rbl-box__grid { --rbl-cols: 3; }
.rbl-box--cols-4 .rbl-box__grid { --rbl-cols: 4; }
.rbl-box--cols-5 .rbl-box__grid { --rbl-cols: 5; }
.rbl-box--cols-6 .rbl-box__grid { --rbl-cols: 6; }

/* --- Card ---------------------------------------------------------------- */

.rbl-card {
	min-width: 0;
}

.rbl-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border-radius: 16px;
	background-color: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
	color: inherit;
	text-decoration: none;
	transition: transform .18s ease, box-shadow .18s ease;
}

.rbl-card__link:hover,
.rbl-card__link:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}

/* A featured boat is paid placement. It gets an accent, not a different card —
   the marketplace makes the same distinction the same way. */
.rbl-card--featured .rbl-card__link {
	box-shadow: 0 0 0 2px var(--brand-dark, #004a80), 0 1px 3px rgba(0, 0, 0, .08);
}

.rbl-card__media {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background-color: #eef2f5;
}

.rbl-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rbl-card__body {
	display: block;
	padding: var(--space-md, 16px);
}

.rbl-card__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	font-size: var(--type-sm, 0.875rem);
	font-weight: 600;
	line-height: 1.35;
}

.rbl-card__price {
	display: block;
	margin-top: var(--space-xs, 8px);
	font-size: var(--type-md, 1.125rem);
	font-weight: 700;
	color: var(--brand-dark, #004a80);
}

.rbl-card__specs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: var(--space-xs, 8px);
}

/* A pill reads best on one line, but `white-space: nowrap` on its own has no
   upper bound — a long field value such as "Motor Boats and Yachts" ran
   straight out of the card and over the one beside it. Clamped to the card
   width and ellipsised instead. `min-width: 0` is required because these are
   flex children: without it a flex item refuses to shrink below its content
   width and `overflow: hidden` never gets the chance to apply. */
.rbl-card__spec {
	min-width: 0;
	max-width: 100%;
	padding: 2px 8px;
	border-radius: 8px;
	background-color: #eef2f5;
	font-size: var(--type-xs, 0.75rem);
	line-height: 1.6;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* --- Inside the article (mid-article block, 2026-12-01) -------------------
   The end-of-article block sits outside .rb-prose; this one sits inside it,
   where the theme's `.rb-prose ul` (indent), `.rb-prose a` (blue, underlined),
   `.rb-prose p` (bottom margin) and `.rb-prose img` (radius) all outrank the
   single-class rules above. Restated here at the same weight plus one.

   A tinted panel, not bare cards on the page: it is an aside to the guide,
   and must read as one, not as part of the text. No border stripe, no
   eyebrow (owner rules). */

.rb-prose .rbl-box__grid {
	margin: 0;
	padding: 0;
}

.rb-prose .rbl-card {
	margin: 0;
}

.rb-prose .rbl-card__link,
.rb-prose .rbl-card__link:hover,
.rb-prose .rbl-card__link:focus {
	color: inherit;
	text-decoration: none;
}

.rb-prose .rbl-card__img {
	border-radius: 0;
}

.rb-prose .rbl-box__title {
	margin: 0;
}

.rbl-box--mid {
	margin: var(--space-xl, 32px) 0;
	padding: var(--space-md, 16px) var(--space-md, 16px) var(--space-lg, 24px);
	border-radius: 14px;
	background-color: var(--rb-bg, #f4fafe);
	border: 1px solid var(--rb-border, #dae1e7);
}

.rbl-box--mid .rbl-box__title {
	color: var(--rb-dark, #004a80);
	font-size: 1rem;
	font-weight: 700;
}

.rbl-box--mid .rbl-box__grid {
	gap: var(--space-md, 16px);
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 1024px) {
	.rbl-box--cols-4 .rbl-box__grid,
	.rbl-box--cols-5 .rbl-box__grid,
	.rbl-box--cols-6 .rbl-box__grid { --rbl-cols: 3; }
}

@media (max-width: 767px) {
	.rbl-box__grid { --rbl-cols: 2 !important; }
}

@media (max-width: 420px) {
	.rbl-box__grid { --rbl-cols: 1 !important; }
}

/* Mid-article on a phone: three compact rows (photo left, text right), so
   the block interrupts the read by about one screen, not three. */
@media (max-width: 767px) {
	.rbl-box--mid .rbl-box__grid { --rbl-cols: 1 !important; gap: 10px; }
	.rbl-box--mid .rbl-card__link { flex-direction: row; border-radius: 12px; }
	.rbl-box--mid .rbl-card__media { flex: 0 0 38%; aspect-ratio: 4 / 3; }
	.rbl-box--mid .rbl-card__body { padding: 10px 12px; }
	.rbl-box--mid .rbl-card__price { margin-top: 4px; font-size: 1rem; }
	.rbl-box--mid .rbl-card__specs { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.rbl-card__link { transition: none; }
	.rbl-card__link:hover,
	.rbl-card__link:focus-visible { transform: none; }
}
