/**
 * Блок «Три направления» (acf/home-directions).
 * Секция «Категории» главной: бенто-сетка из категорий каталога.
 */

.directions {
	padding: clamp(72px, 9vh, 116px) 0;
	background: var(--t-bg);
}

.directions__inner {
	width: 100%;
	padding: 0 var(--t-pad-x);
}

.directions__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 24px;
	margin-bottom: 48px;
}

.directions__title {
	max-width: 20ch;
	margin: 0;
	font-family: var(--t-font-display);
	font-weight: 800;
	font-size: clamp(30px, 3.6vw, 52px);
	line-height: 1.02;
	letter-spacing: -.025em;
}

.directions__subtitle {
	max-width: 38ch;
	margin: 0;
	font-size: 18px;
	line-height: 1.6;
	color: #4C463F;
}

/* ───────────────  Сетка карточек  ─────────────── */

.directions__grid {
	display: grid;
	grid-template-columns: 1.7fr 1fr;
	grid-template-rows: 1.55fr 1fr;
	gap: 20px;
	height: clamp(540px, 64vh, 720px);
}

/* Первая карточка — большая, во всю высоту левой колонки. */
.directions__card:first-child {
	grid-column: 1;
	grid-row: 1 / span 2;
}

/* Категорий не три — раскладываем ровными карточками, чтобы сетка не ломалась. */
.directions__grid--flow {
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	grid-template-rows: none;
	height: auto;
}

.directions__grid--flow .directions__card:first-child {
	grid-column: auto;
	grid-row: auto;
}

.directions__grid--flow .directions__card {
	min-height: 340px;
}

.directions__card {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 10px;
	background: var(--t-dark);
	box-shadow: inset 0 0 0 1px rgba(34, 31, 28, .25);
	text-decoration: none;
}

.directions__media {
	position: relative;
	height: 100%;
	overflow: hidden;
}

.directions__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: .5s;
}

.directions__card:hover .directions__img {
	transform: scale(1.05);
}

/* Тонкая вертикальная линия по центру — деталь макета. */
.directions__lines {
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: .22;
	background: linear-gradient(90deg, transparent calc(50% - 1px), #14110d calc(50% - 1px), #14110d calc(50% + 1px), transparent calc(50% + 1px));
}

.directions__shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 46%, rgba(28, 21, 15, .84));
}

.directions__num,
.directions__arrow {
	position: absolute;
	z-index: 3;
	color: #fff;
}

.directions__num {
	left: 22px;
	top: 20px;
	font-family: var(--t-font-display);
	font-weight: 800;
	font-size: 14px;
	color: rgba(255, 255, 255, .92);
}

.directions__arrow {
	right: 22px;
	top: 18px;
	font-size: 22px;
}

.directions__body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	padding: 28px;
	color: #fff;
}

.directions__name {
	margin: 0 0 8px;
	font-family: var(--t-font-display);
	font-weight: 800;
	font-size: 25px;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: #fff;
}

/* Размеры заголовков в макете разные — по величине карточки. */
.directions__card:nth-child(1) .directions__name {
	font-size: 32px;
}

.directions__card:nth-child(3) .directions__name {
	font-size: 20px;
}

.directions__text {
	display: block;
	font-size: 14px;
	line-height: 1.45;
	color: rgba(255, 255, 255, .86);
}

.directions__footer {
	display: flex;
	justify-content: flex-end;
	margin-top: 30px;
}

/* ───────────────  Адаптив  ─────────────── */

@media (max-width: 980px) {
	.directions__grid {
		grid-template-columns: 1fr;
		grid-template-rows: none;
		height: auto;
	}

	.directions__card,
	.directions__card:first-child {
		grid-column: auto;
		grid-row: auto;
		height: 300px;
	}

	.directions__card:nth-child(1) .directions__name,
	.directions__card:nth-child(3) .directions__name {
		font-size: 25px;
	}
}

@media (max-width: 640px) {
	.directions__head {
		margin-bottom: 32px;
	}

	.directions__body {
		padding: 22px;
	}

	.directions__footer {
		justify-content: stretch;
	}

	.directions__footer .t-btn {
		width: 100%;
	}
}
