/*
 * Cards Grid — Modular Page layout 18 (layouts/layout-18.php),
 * e.g. the homepage "OUR COMPANIES" section.
 *
 * Same look as the original three-column blocks (hexagon icon, orange
 * title, bold uppercase text, gradient button) but on a grid that keeps
 * every button on the same line:
 *   < 640px    1 card per row
 *   640-1023px 2 cards per row
 *   >= 1024px  up to 4 cards per row
 */

.icg-grid {
	--icg-gap: 30px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 44px var(--icg-gap);
}

.icg-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 0 1 100%;
	max-width: 340px;
	text-align: center;
}

/* Icon */
.icg-card__icon {
	display: block;
	margin: 0 0 24px;
	line-height: 0;
}

.icg-card__icon img {
	display: block;
	width: 84px;
	height: auto;
	transition: transform .25s ease;
}

a.icg-card__icon:hover img {
	transform: translateY(-4px);
}

/* Title + text (prefixed to beat the theme's h3/p sizes) */
.flexible-content-section .icg-card__title {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.15;
	color: #ff6600;
	text-transform: uppercase;
	text-wrap: balance;
}

.flexible-content-section .icg-card__text {
	margin: 0 0 20px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
	text-transform: uppercase;
	text-wrap: balance;
}

/* Button — pinned to the bottom of the card so all buttons line up */
.icg-card__action {
	margin-top: auto;
}

.flexible-content-section .icg-card__button {
	display: inline-block;
	padding: 12px 24px;
	border-radius: 5px;
	background: linear-gradient(135deg, #ff6900 0%, #cf2e2e 100%);
	box-shadow: 0 2px 6px rgba(207, 46, 46, .2);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.flexible-content-section .icg-card__button:hover,
.flexible-content-section .icg-card__button:focus {
	color: #fff;
	opacity: 1;
	filter: brightness(1.06);
	box-shadow: 0 8px 18px rgba(207, 46, 46, .3);
	transform: translateY(-2px);
}

/* Tablet: 2 per row */
@media (min-width: 640px) {
	.icg-grid {
		gap: 52px var(--icg-gap);
	}

	.icg-card {
		flex-basis: calc((100% - var(--icg-gap)) / 2);
		max-width: none;
	}

	.icg-card__icon img {
		width: 91px;
	}

	.flexible-content-section .icg-card__title {
		font-size: 24px;
	}

	.flexible-content-section .icg-card__text {
		font-size: 18px;
	}
}

/* Desktop: all cards on one row (max 4) */
@media (min-width: 1024px) {
	.icg-grid--cols-2 .icg-card { flex-basis: calc((100% - var(--icg-gap)) / 2); }
	.icg-grid--cols-3 .icg-card { flex-basis: calc((100% - 2 * var(--icg-gap)) / 3); }
	.icg-grid--cols-4 .icg-card { flex-basis: calc((100% - 3 * var(--icg-gap)) / 4); }

	/* 4 narrow columns: scale type down a little until the row is full width */
	.flexible-content-section .icg-grid--cols-4 .icg-card__title {
		font-size: clamp(19px, 1.25vw + 7px, 23px);
	}

	.flexible-content-section .icg-grid--cols-4 .icg-card__text {
		font-size: clamp(15px, .9vw + 6px, 17px);
	}
}
