/**
 * Bloky „Vitoul features“ a „Vitoul feature – sloupec“.
 * Styly sdílené editorem i frontendem.
 *
 * Rozměry podle Figmy (frame `features-section`, 1440 × 442):
 * odsazení 80, mezera mezi sloupci 48, ikona 60 × 60.
 */

.vm-features {
	--vm-features-columns: 3;

	align-items: center;
	background-color: var( --vm-color-teal-bg );
	border-bottom: 1px solid var( --vm-color-border-light );
	border-top: 1px solid var( --vm-color-border-light );
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: var( --vm-space-3xl ) var( --vm-gutter );
	position: relative;
	width: 100%;
}

.vm-features--white {
	background-color: var( --vm-color-white );
}

.vm-features--no-borders {
	border-bottom: 0;
	border-top: 0;
}

/* Dekorativní vlna – bílá, na světlém pozadí jen naznačená. */
.vm-features__wave {
	display: block;
	height: 218px;
	left: 50%;
	max-width: none;
	min-width: 1614px;
	pointer-events: none;
	position: absolute;
	top: 56px;
	transform: translateX( -50% );
	user-select: none;
	width: 112%;
	z-index: 0;
}

.vm-features__inner {
	display: flex;
	flex-direction: column;
	gap: var( --vm-space-2xl );
	margin: 0 auto;
	max-width: var( --vm-container );
	position: relative;
	width: 100%;
	z-index: 1;
}

/*
 * Flex místo gridu záměrně: když poslední řádek není plný, zbylé sloupce
 * se vycentrují. V gridu by zůstaly zarovnané doleva.
 * `--vm-features-cols` je počet sloupců po zohlednění breakpointů,
 * `--vm-features-columns` přichází z nastavení bloku.
 */
.vm-features__grid {
	--vm-features-gap: var( --vm-space-2xl );
	--vm-features-cols: var( --vm-features-columns );

	display: flex;
	flex-wrap: wrap;
	gap: var( --vm-features-gap );
	justify-content: center;
}

/*
 * Šířku určuje třída položky, ne `> *`. V editoru je totiž mezi potomky
 * mřížky navíc tlačítko pro přidání sloupce a případný obal bloků.
 */
.vm-feature {
	flex: 0 1 calc(
		( 100% - ( var( --vm-features-cols ) - 1 ) * var( --vm-features-gap ) )
		/ var( --vm-features-cols )
	);
	max-width: 100%;
	min-width: 0;
}

/* ----------------------------------------------------------------------
 * Jeden sloupec
 * -------------------------------------------------------------------- */

.vm-feature {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: var( --vm-space-md );
	text-align: center;
}

.vm-feature__icon {
	align-items: center;
	display: flex;
	flex-shrink: 0;
	height: 60px;
	justify-content: center;
	width: 60px;
}

.vm-feature__icon-image {
	display: block;
	height: 100%;
	object-fit: contain;
	width: 100%;
}

.vm-feature__stack {
	display: flex;
	flex-direction: column;
	gap: var( --vm-space-xs );
	width: 100%;
}

/* Heading/H4 – 18 Montserrat Bold, tracking 1 */
.vm-feature__title {
	color: var( --vm-color-text-heading );
	font-family: var( --vm-font-heading );
	font-size: var( --vm-size-h4 );
	font-weight: var( --vm-weight-bold );
	letter-spacing: var( --vm-tracking-wide );
	line-height: var( --vm-leading-none );
	margin: 0;
	text-transform: uppercase;
}

/* Body/Medium Bold – 15 Mulish Medium (skutečná váha 500, jak žádá Figma) */
.vm-feature__subtitle {
	color: var( --vm-color-text-primary );
	font-family: var( --vm-font-body );
	font-size: var( --vm-size-body-md );
	font-weight: var( --vm-weight-medium );
	line-height: var( --vm-leading-none );
	margin: 0;
}

/* Body/Regular – 14/1.5 */
.vm-feature__text {
	color: var( --vm-color-text-body );
	font-family: var( --vm-font-body );
	font-size: var( --vm-size-body );
	font-weight: var( --vm-weight-regular );
	line-height: var( --vm-leading-snug );
	margin: 0;
}

/* Řádek s odkazem pod sloupci. */
.vm-features__link-row {
	margin: 0;
	text-align: center;
}

/* ----------------------------------------------------------------------
 * Responzivita
 * -------------------------------------------------------------------- */

@media ( max-width: 1024px ) {

	/* Nikdy víc než dva sloupce – méně jich ale zůstat může. */
	.vm-features__grid {
		--vm-features-cols: min( 2, var( --vm-features-columns ) );
	}

	.vm-features {
		padding: var( --vm-space-2xl ) var( --vm-gutter );
	}
}

@media ( max-width: 680px ) {

	.vm-features__grid {
		--vm-features-gap: var( --vm-space-xl );
		--vm-features-cols: 1;
	}

	.vm-features__wave {
		min-width: 900px;
		top: 24px;
	}
}
