/* =========================================================
   MB Site – small site-wide classes
   ========================================================= */

/* Stock labels, e.g. in GravityView custom content (write each on one line):
   <span class="mb-stock mb-stock-in">In stock</span>
   <span class="mb-stock mb-stock-low">Low stock</span>
   <span class="mb-stock mb-stock-out">Out of stock</span>
   <span class="mb-stock mb-stock-reserved">Reserved</span>
   Or let MB Site write them: a block with the class mb-stock-auto (includes/card-fields.php).
   A small coloured dot before the text. The dot colours are one-offs (no palette colour fits). */
.mb-stock {
	--mb-stock-dot: var(--wp--preset--color--secondary);
	display: inline-flex;
	align-items: center;
	gap: .5em;
	color: var(--wp--preset--color--main);
	font-size: var(--wp--preset--font-size--x-small, .85rem);
	line-height: 1.2;
}
.mb-stock::before {
	content: "";
	flex-shrink: 0;
	width: .55em;
	height: .55em;
	border-radius: 50%;
	background: var(--mb-stock-dot);
}
.mb-stock-in  { --mb-stock-dot: #4a9466; }
.mb-stock-low { --mb-stock-dot: #d29a2e; }
.mb-stock-out {
	--mb-stock-dot: #b8483a;
	color: var(--wp--preset--color--secondary);
}
.mb-stock-reserved {
	--mb-stock-dot: #d29a2e;
	color: var(--wp--preset--color--secondary);
}

/* Booking status ({mb_booking_status:badge}, includes/booking-status.php) – the same dot and text as the stock labels */
.mb-status {
	--mb-stock-dot: var(--wp--preset--color--secondary);
	display: inline-flex;
	align-items: center;
	gap: .5em;
	color: var(--wp--preset--color--main);
	font-size: var(--wp--preset--font-size--x-small, .85rem);
	line-height: 1.2;
}
.mb-status::before {
	content: "";
	flex-shrink: 0;
	width: .55em;
	height: .55em;
	border-radius: 50%;
	background: var(--mb-stock-dot);
}
.mb-status-confirmed { --mb-stock-dot: #4a9466; }
.mb-status-pending   { --mb-stock-dot: #d29a2e; }
.mb-status-cancelled,
.mb-status-denied    { --mb-stock-dot: #b8483a; color: #b8483a; }

/* Gallery that fits its column: add the class mb-gallery-fit to a Gallery block (Advanced → Additional CSS class(es)).
   Columns follow the gallery's own width, not the screen's – for galleries in narrow columns (e.g. 25% on desktop):
   under 240px 1 per row, under 480px 2, under 720px 3; wider than that, the block's Columns setting applies.
   (.mb-gallery-fit twice outranks WordPress's own column rules.) */
.mb-gallery-fit.wp-block-gallery {
	container-type: inline-size;
}
@container (max-width: 719px) {
	.mb-gallery-fit.mb-gallery-fit.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
		width: calc((100% - 2 * var(--wp--style--unstable-gallery-gap, 16px)) / 3);
	}
}
@container (max-width: 479px) {
	.mb-gallery-fit.mb-gallery-fit.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
		width: calc((100% - var(--wp--style--unstable-gallery-gap, 16px)) / 2);
	}
}
@container (max-width: 239px) {
	.mb-gallery-fit.mb-gallery-fit.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
		width: 100%;
	}
}
