/* Product cards ([bml_featured_products]). Everything is scoped to .bml-products, like the site header. */
.bml-products {
	--bml-card-ink: #13222f;
	--bml-card-muted: #55657a;
	--bml-card-primary: #0b4f8c;
	--bml-card-line: #dbe4ee;
	--bml-card-radius: 16px;
	--bml-card-shadow: 0 10px 30px rgb(19 34 47 / 12%), 0 2px 6px rgb(19 34 47 / 6%);
	--bml-card-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bml-products__item {
	display: flex;
	margin: 0;
	padding: 0;
}

.bml-product {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--bml-card-line);
	border-radius: var(--bml-card-radius);
	transition:
		box-shadow 0.25s var(--bml-card-ease),
		transform 0.25s var(--bml-card-ease),
		border-color 0.25s var(--bml-card-ease);
}

.bml-product:hover,
.bml-product:focus-within {
	border-color: transparent;
	box-shadow: var(--bml-card-shadow);
	transform: translateY(-4px);
}

/* Same square box for every photo, whatever its size. */
.bml-product__media {
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	padding: 16px;
	background: linear-gradient(180deg, #f7fafd 0%, #eef3f8 100%);
}

.bml-product__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply; /* Blends white photo backgrounds into the box. */
	transition: transform 0.4s var(--bml-card-ease);
}

.bml-product:hover .bml-product__img,
.bml-product:focus-within .bml-product__img {
	transform: scale(1.05);
}

.bml-product__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 8px;
	padding: 16px 18px 18px;
}

/* Two classes, so the Elementor kit's "h3" sizes (.elementor-kit-N h3) do not apply here. */
.bml-products .bml-product__title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
}

/* The parent theme sets its own font and line height on every link. */
.bml-product__link {
	font: inherit;
	color: var(--bml-card-ink);
	text-decoration: none;
	transition: color 0.2s var(--bml-card-ease);
}

/* The title link covers the whole card, so the photo and the text are clickable too. */
.bml-product__link::after {
	position: absolute;
	inset: 0;
	z-index: 1;
	content: "";
}

.bml-product:hover .bml-product__link,
.bml-product__link:focus-visible {
	color: var(--bml-card-primary);
}

.bml-product__link:focus-visible {
	outline: none;
}

/* Keyboard focus outlines the whole card, since the link covers it. */
.bml-product:has(.bml-product__link:focus-visible) {
	outline: 3px solid var(--bml-card-primary);
	outline-offset: 2px;
}

.bml-product__summary {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	font-size: 14px;
	line-height: 1.5;
	color: var(--bml-card-muted);
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
}

.bml-product__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	padding-top: 4px;
	font-size: 14px;
	font-weight: 600;
	color: var(--bml-card-primary);
}

.bml-product__more svg {
	transition: transform 0.25s var(--bml-card-ease);
}

.bml-product:hover .bml-product__more svg {
	transform: translateX(4px);
}

@media (max-width: 1024px) {
	.bml-products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}
}

@media (max-width: 599px) {
	.bml-products {
		gap: 12px;
	}

	.bml-product__media {
		padding: 10px;
	}

	.bml-product__body {
		gap: 6px;
		padding: 12px;
	}

	.bml-products .bml-product__title {
		font-size: 14px;
	}

	.bml-product__summary {
		display: none;
	}

	.bml-product__more {
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bml-product,
	.bml-product__img,
	.bml-product__link,
	.bml-product__more svg {
		transition: none;
	}

	.bml-product:hover,
	.bml-product:focus-within {
		transform: none;
	}

	.bml-product:hover .bml-product__img,
	.bml-product:focus-within .bml-product__img {
		transform: none;
	}
}
