/* =========================================================================
   Bento Showcase Grid — frontend styles
   Every tunable value is a custom property on .bsg-root. Elementor controls
   overwrite them at {{WRAPPER}} .bsg-root, per breakpoint.
   Base selectors use two classes (.bsg-root .x) so theme/kit rules such as
   `.entry-content ul` or `.elementor-kit-5 h3` don't leak in; control
   selectors add {{WRAPPER}} on top, so they always win over these defaults.
   ========================================================================= */

.bsg-root {
	--bsg-cols: 5;
	--bsg-gap: 18px;
	--bsg-h: 580px;
	--bsg-photo-h: 38%;
	--bsg-base-grow: 1;
	--bsg-justify: flex-start;

	--bsg-grow: 3;
	--bsg-shrink: 0.6;
	--bsg-lift: 3px;
	--bsg-dur: 500ms;
	--bsg-ease: cubic-bezier(.32, .72, .35, 1);

	--bsg-ink: #2b241d;
	--bsg-muted: #6b6055;
	--bsg-surface: #fffcf6;
	--bsg-line: rgba(43, 36, 29, 0.1);
	--bsg-photo-text-all: #fff;
	--bsg-fit: cover;
	--bsg-pos: center center;
	--bsg-overlay: transparent;

	color: var(--bsg-ink);
	width: 100%;
}

.bsg-root *,
.bsg-root *::before,
.bsg-root *::after { box-sizing: border-box; }

/* ---------- Header ---------- */
.bsg-root .bsg-head {
	max-width: 720px;
	margin: 0 auto 40px 0;
}
.bsg-root .bsg-heading {
	margin: 0 0 14px;
	font-size: clamp(2rem, 3.4vw, 2.9rem);
	line-height: 1.08;
	letter-spacing: -0.01em;
	color: inherit;
}
.bsg-root .bsg-intro {
	margin: 0;
	font-size: clamp(0.95rem, 1.3vw, 1.08rem);
	line-height: 1.55;
	color: var(--bsg-muted);
}

/* ---------- Grid ----------
   Before JS: cards wrap in one flex container (static fallback).
   After JS (.is-rows): cards are grouped into .bsg-row lines by the current
   --bsg-cols value, so flex-grow has real space to redistribute per row. */
.bsg-root .bsg-grid {
	display: flex;
	flex-wrap: wrap;
	gap: var(--bsg-gap);
	justify-content: var(--bsg-justify);
	margin: 0;
	padding: 0;
	list-style: none;
}
.bsg-root .bsg-grid.is-rows {
	flex-direction: column;
	flex-wrap: nowrap;
}
.bsg-root .bsg-row {
	display: flex;
	gap: var(--bsg-gap);
	justify-content: var(--bsg-justify);
	width: 100%;
}

/* ---------- Card shell ---------- */
.bsg-root .bsg-card {
	--bsg-accent: #d23235;
	position: relative;
	display: flex;
	flex-direction: column;
	flex: var(--bsg-base-grow) 1 calc((100% - (var(--bsg-cols) - 1) * var(--bsg-gap)) / var(--bsg-cols));
	min-width: 0;
	width: auto;
	height: var(--bsg-h);
	margin: 0;
	overflow: hidden;
	background: var(--bsg-surface);
	border: 1px solid var(--bsg-line);
	border-radius: 26px;
	box-shadow: 0 10px 26px -14px rgba(43, 36, 29, 0.28), 0 2px 6px -2px rgba(43, 36, 29, 0.12);
	color: inherit;
	text-decoration: none;
	transition:
		flex-grow var(--bsg-dur) var(--bsg-ease),
		transform calc(var(--bsg-dur) * .7) ease,
		box-shadow calc(var(--bsg-dur) * .7) ease,
		border-color calc(var(--bsg-dur) * .7) ease;
}
.bsg-root a.bsg-card,
.bsg-root a.bsg-card:hover,
.bsg-root a.bsg-card:focus { color: inherit; text-decoration: none; }

.bsg-root .bsg-card:hover,
.bsg-root .bsg-card.is-active {
	box-shadow: 0 22px 40px -16px rgba(43, 36, 29, 0.35), 0 4px 10px -2px rgba(43, 36, 29, 0.18);
}
.bsg-root .bsg-card:focus-visible {
	outline: 3px solid var(--bsg-accent);
	outline-offset: 3px;
}

/* ---------- Photo / brand panel ---------- */
.bsg-root .bsg-photo {
	position: relative;
	flex: 0 0 var(--bsg-photo-h);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px 12px;
	overflow: hidden;
	text-align: center;
	color: var(--bsg-photo-text, var(--bsg-photo-text-all));
	background: var(--bsg-accent);
}
.bsg-fill-gradient .bsg-root .bsg-photo:not(.has-image) {
	background: linear-gradient(150deg,
		color-mix(in srgb, var(--bsg-accent) 88%, #000),
		var(--bsg-accent) 55%,
		color-mix(in srgb, var(--bsg-accent) 52%, #fff));
}
.bsg-root .bsg-photo.has-image { background: #e9e3d8; }

.bsg-root .bsg-photo img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: var(--bsg-fit);
	object-position: var(--bsg-pos);
}
.bsg-root .bsg-photo.has-image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--bsg-overlay);
	pointer-events: none;
}

.bsg-root .bsg-brand {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	max-width: 100%;
}
.bsg-root .bsg-photo-icon {
	font-size: 42px;
	line-height: 1;
	filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .18));
}
.bsg-root .bsg-photo-icon svg,
.bsg-root .bsg-mini-icon svg { width: 1em; height: 1em; fill: currentColor; }

.bsg-root .bsg-wordmark {
	font-size: clamp(1.15rem, 2vw, 1.5rem);
	line-height: 1.05;
	overflow-wrap: anywhere;
	text-shadow: 0 2px 10px rgba(0, 0, 0, .2);
}
.bsg-root .bsg-tagline {
	font-size: 0.68rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	opacity: 0.92;
}

.bsg-root .bsg-badge {
	position: absolute;
	z-index: 2;
	right: 10px;
	bottom: 10px;
	padding: 4px 9px;
	border-radius: 999px;
	font-size: 0.66rem;
	line-height: 1.3;
	white-space: nowrap;
	color: #fff;
	background: rgba(0, 0, 0, .3);
}
.bsg-root .bsg-badge--hint { opacity: .75; font-style: italic; }

/* ---------- Body ---------- */
.bsg-root .bsg-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	padding: 16px 18px 18px;
}
.bsg-root .bsg-title-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 6px;
}
.bsg-root .bsg-mini-icon { font-size: 1.05rem; line-height: 1; flex: 0 0 auto; color: var(--bsg-accent); }
.bsg-root .bsg-title {
	margin: 0;
	padding: 0;
	font-size: 1.02rem;
	line-height: 1.2;
	color: var(--bsg-accent-text, var(--bsg-accent));
}

.bsg-root .bsg-details {
	flex: 1 1 auto;
	min-height: 0;
	max-height: 640px;
	/* Soft fade instead of a hard cut if a narrow card runs out of room. */
	-webkit-mask-image: var(--bsg-mask, linear-gradient(#000 calc(100% - 24px), transparent));
	mask-image: var(--bsg-mask, linear-gradient(#000 calc(100% - 24px), transparent));
	opacity: 1;
	overflow: hidden;
	transition:
		max-height var(--bsg-dur) ease,
		opacity calc(var(--bsg-dur) * .7) ease;
}
.bsg-root .bsg-desc {
	margin: 0 0 10px;
	font-size: 0.83rem;
	line-height: 1.5;
	color: var(--bsg-muted);
}
.bsg-root .bsg-divider {
	height: 0;
	margin: 0 0 10px;
	border: 0;
	border-top: 1px solid var(--bsg-line);
	background: none;
}
.bsg-root .bsg-specs {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
}
.bsg-root .bsg-specs li {
	display: flex;
	align-items: baseline;
	gap: 7px;
	margin: 0;
	padding: 0;
	font-size: 0.76rem;
	line-height: 1.4;
	list-style: none;
}
.bsg-root .bsg-specs li::before,
.bsg-root .bsg-specs li::marker { content: none; }
.bsg-root .bsg-bullet {
	flex: 0 0 auto;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--bsg-accent);
	transform: translateY(-2px);
}
.bsg-bullet-square .bsg-root .bsg-bullet { border-radius: 1px; }
.bsg-bullet-none .bsg-root .bsg-bullet { display: none; }
.bsg-root .bsg-spec-text strong { font-weight: 600; }

.bsg-root .bsg-price {
	margin: auto 0 0;
	padding-top: 10px;
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--bsg-accent-text, var(--bsg-accent));
}

/* Full rows: equal shares from a zero basis, so grow ratios are exact. */
.bsg-root .bsg-row > .bsg-card { flex: 1 1 0; }
/* Last partial row: column-width basis; stretch or keep via --bsg-base-grow. */
.bsg-root .bsg-row.is-partial > .bsg-card {
	flex: var(--bsg-base-grow) 1 calc((100% - (var(--bsg-cols) - 1) * var(--bsg-gap)) / var(--bsg-cols));
}

/* =========================================================================
   Grow / shrink reflow — scoped to the hovered card's own row.
   ========================================================================= */

/* Mouse / trackpad hover */
@media (hover: hover) and (pointer: fine) {
	.bsg-root .bsg-hover-on .bsg-row:has(> .bsg-card:hover) > .bsg-card {
		flex-grow: var(--bsg-shrink);
	}
	.bsg-root .bsg-hover-on .bsg-row:has(> .bsg-card:hover) > .bsg-card:hover {
		flex-grow: var(--bsg-grow);
		transform: translateY(calc(var(--bsg-lift) * -1));
		z-index: 2;
	}
	.bsg-root .bsg-hover-on.bsg-collapse .bsg-row:has(> .bsg-card:hover) > .bsg-card:not(:hover) .bsg-details {
		max-height: 0;
		opacity: 0;
	}
}

/* Keyboard focus + tap mode (JS toggles .has-active on the row) */
.bsg-root .bsg-hover-on .bsg-row.has-active > .bsg-card {
	flex-grow: var(--bsg-shrink);
}
.bsg-root .bsg-hover-on .bsg-row.has-active > .bsg-card.is-active {
	flex-grow: var(--bsg-grow);
	transform: translateY(calc(var(--bsg-lift) * -1));
	z-index: 2;
}
.bsg-root .bsg-hover-on.bsg-collapse .bsg-row.has-active > .bsg-card:not(.is-active) .bsg-details {
	max-height: 0;
	opacity: 0;
}

/* A row holding one card has nothing to trade width with. */
.bsg-root .bsg-row.is-solo > .bsg-card { transform: none !important; }

@media (prefers-reduced-motion: reduce) {
	.bsg-root .bsg-card,
	.bsg-root .bsg-details { transition: none !important; }
	.bsg-root .bsg-card { transform: none !important; }
}
