/*
 * Business - Companies.
 *
 * Read from cp-all-designer css/business.css:22-40 (the tokens), 126-139
 * (.bzg__head, .bzg__title) and the .bzc tile, and css/business-detail.css
 * :43-200 (the grid, the plate, the copy, the house brands, the button).
 *
 * The band has no ground of its own: the design paints the whole page pale
 * blue (business.css:39) and lets every section show it.
 *
 * What the Style tab sets is not repeated here: padding, gaps, colours,
 * sizes, corners, shadows and the button's padding all arrive through the
 * widget's own selectors.
 *
 * The grid steps where the design steps — 1000px and 620px
 * (business-detail.css:197-215) — not on Elementor's tiers: a card is as wide
 * on this page as the design draws it at every width.
 */

.custom-business-companies {
	position: relative;
	display: block;
	box-sizing: border-box;
}

.custom-business-companies__inner {
	box-sizing: border-box;
	width: 100%;
	max-width: 1920px;                     /* the content cap, every band */
	margin: 0 auto;
}

/* ------------------------------------------------------------------ */
/* The heading — business.css:126-139                                  */
/* ------------------------------------------------------------------ */

.custom-business-companies__title {
	margin: 0;
	padding: 0;
	font-weight: 600;
	line-height: 1.45;
	letter-spacing: 0;
	text-wrap: balance;
}

/* ------------------------------------------------------------------ */
/* The grid — business-detail.css:60-80                                */
/* ------------------------------------------------------------------ */

/*
 * Six tracks, every card spanning two: a short last row can then start on
 * track 2 or 3 and land on the row's centre. One fr per row makes every row
 * as tall as the tallest card on the page.
 */
.custom-business-companies__grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	grid-auto-rows: 1fr;
}

.custom-business-companies__card {
	grid-column: span 2;
}

.custom-business-companies__card:nth-child(3n + 1):nth-last-child(2) {
	grid-column: 2 / span 2;
}

.custom-business-companies__card:nth-child(3n + 1):last-child {
	grid-column: 3 / span 2;
}

/* ------------------------------------------------------------------ */
/* The card — business.css .bzc                                        */
/* ------------------------------------------------------------------ */

.custom-business-companies__card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	box-sizing: border-box;
	min-width: 0;
	overflow: hidden;
	text-align: center;
	/* the rise-in fades as the base answers it; the lift and the shadow keep the tile's own pace */
	transition: opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            box-shadow 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-business-companies--lift-yes .custom-business-companies__card:hover {
	transform: translateY(-6px);
}

/*
 * A fixed plate, not a least height — business-detail.css:92-101: every mark
 * sits in the same box, so every name starts on the same line whatever the
 * artwork's proportion.
 */
.custom-business-companies__logo {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	box-sizing: border-box;
	width: 100%;
}

.custom-business-companies__logo img {
	display: block;
	width: 100%;
	max-height: 100%;
	height: auto;
	object-fit: contain;
	transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-business-companies__card:hover .custom-business-companies__logo img {
	transform: scale(1.05);
}

/* business.css .bzc__logo--text — the name, quiet, in the logo's place */
.custom-business-companies__logo--text {
	align-content: center;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.6;
	color: #94A3B8;                        /* app.css:43 var(--g500) */
	text-wrap: balance;
}

/* business.css .bzc__name */
.custom-business-companies__name {
	position: relative;
	display: block;
	font-weight: 600;
	line-height: 1.55;
	letter-spacing: 0;
	text-wrap: balance;
}

/*
 * margin-bottom: auto parks the button on the foot of the card and still
 * keeps the button's own top margin as a real gap — business-detail.css:105-118.
 */
.custom-business-companies__desc {
	margin: 10px 0 auto;
	font-weight: 300;
	line-height: 1.65;
	text-wrap: pretty;
}

/* the house brands — business-detail.css:120-135 */
.custom-business-companies__brands {
	display: grid;
	place-items: center;
	width: 100%;
}

.custom-business-companies__brands img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
}

/* ------------------------------------------------------------------ */
/* The button — business-detail.css:137-170                            */
/* ------------------------------------------------------------------ */

.custom-business-companies__link {
	--custom-press-shadow: 0 4px 12px rgba(80, 163, 213, 0.28);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
	transition: background-color 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            box-shadow 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-business-companies__link:hover {
	--custom-press-shadow: 0 8px 18px rgba(80, 163, 213, 0.38);
	transform: translateY(-2px);
}

.custom-business-companies__link:focus-visible {
	outline: 2px solid #16418C;            /* var(--navy) */
	outline-offset: 3px;
}

.custom-business-companies__arrow {
	display: inline-block;
	transition: transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-business-companies__link:hover .custom-business-companies__arrow {
	transform: translate(2px, -2px);
}

/* the house brands already hold the gap under the copy — business-detail.css:157 */
.custom-business-companies__brands + .custom-business-companies__link {
	margin-top: 22px !important;
}

/* ------------------------------------------------------------------ */
/* Two to a row — 1000px and down                                      */
/* ------------------------------------------------------------------ */

@media (max-width: 1000px) {
	.custom-business-companies__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
	.custom-business-companies__card:nth-child(3n + 1):nth-last-child(2),
	.custom-business-companies__card:nth-child(3n + 1):last-child {
		grid-column: span 2;
	}
	.custom-business-companies__card:nth-child(2n + 1):last-child {
		grid-column: 2 / span 2;
	}
	.custom-business-companies__brands + .custom-business-companies__link {
		margin-top: 15px !important;       /* 1.6 * 9.2 */
	}
}

/* ------------------------------------------------------------------ */
/* One to a row — 620px and down                                       */
/* ------------------------------------------------------------------ */

/*
 * Stacked, equal heights would only pad every short card out to the
 * longest one, so each card takes its own height again — business-detail.css:207.
 */
@media (max-width: 620px) {
	.custom-business-companies__grid {
		grid-template-columns: minmax(0, 1fr);
		grid-auto-rows: auto;
	}
	.custom-business-companies__card,
	.custom-business-companies__card:nth-child(3n + 1):nth-last-child(2),
	.custom-business-companies__card:nth-child(3n + 1):last-child,
	.custom-business-companies__card:nth-child(2n + 1):last-child {
		grid-column: 1 / -1;
	}
	.custom-business-companies__brands + .custom-business-companies__link {
		margin-top: 14px !important;
	}
}

/* business-detail.css:104 — the plate follows the smallest phones' mark down */
@media (max-width: 380px) {
	.custom-business-companies__logo {
		height: 112px !important;
	}
}

/* ------------------------------------------------------------------ */
/* A reader who has asked for less movement                            */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.custom-business-companies__card,
	.custom-business-companies__logo img,
	.custom-business-companies__link,
	.custom-business-companies__arrow {
		transition: none;
	}
	.custom-business-companies--lift-yes .custom-business-companies__card:hover,
	.custom-business-companies__card:hover .custom-business-companies__logo img,
	.custom-business-companies__link:hover,
	.custom-business-companies__link:hover .custom-business-companies__arrow {
		transform: none;
	}
}
