/**
 * Секция «Направления хирургии».
 * Шаблон: template-parts/sections/directions.php
 */

.directions {
	--dr-navy: #133b50;
	--dr-accent: #a51e24;
	--dr-line: #e3e7eb;

	padding: 46px 0 52px;
	background-color: #fff;
}

.directions .directions__title {
	position: relative;
	margin: 0 0 40px;
	padding: 0 0 18px;
	font-size: 32px;
	line-height: 1.2;
	font-weight: bold;
	text-align: center;
	text-transform: uppercase;
	color: var(--dr-navy);
}

/* Короткая красная черта под заголовком — как в остальных секциях */
.directions .directions__title:after {
	content: '';
	display: block;
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 44px;
	height: 3px;
	margin-left: -22px;
	border-radius: 2px;
	background-color: var(--dr-accent);
}

.directions__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}

.directions__card {
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	min-width: 0;
	min-height: 150px;
	padding: 22px 26px;
	border: 1px solid var(--dr-line);
	border-radius: 4px;
	background-color: #fff;
	color: var(--dr-navy);
	text-decoration: none !important;
	-webkit-transition: background-color 0.25s, border-color 0.25s, color 0.25s;
	transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}

.directions__card:hover,
.directions__card:focus {
	border-color: var(--dr-accent);
	background-color: var(--dr-accent);
	color: #fff;
}

.directions__icon {
	-webkit-flex: 0 0 auto;
	flex: 0 0 auto;
	width: 80px;
	height: 80px;
	margin-right: 24px;
}

/* В поле рубрики лежит инлайновый SVG, но может быть и картинка */
.directions__icon svg,
.directions__icon img {
	display: block;
	width: 80px;
	height: 80px;
	max-width: 80px;
	max-height: 80px;
}

/* На красном фоне иконку выбеливаем — как на старой главной */
.directions__card:hover .directions__icon svg,
.directions__card:hover .directions__icon img,
.directions__card:focus .directions__icon svg,
.directions__card:focus .directions__icon img {
	-webkit-filter: brightness(0) invert(1);
	filter: brightness(0) invert(1);
}

.directions__name {
	min-width: 0;
	font-size: 19px;
	line-height: 1.3;
	font-weight: bold;
	text-transform: uppercase;
}

/* Иконку у рубрики не заполнили — название по центру карточки */
.directions__card--noicon .directions__name {
	width: 100%;
	text-align: center;
}

@media (max-width: 1199px) {
	.directions__card {
		min-height: 140px;
		padding: 20px 22px;
	}

	.directions__icon {
		width: 72px;
		height: 72px;
		margin-right: 20px;
	}

	.directions__icon svg,
	.directions__icon img {
		width: 72px;
		height: 72px;
		max-width: 72px;
		max-height: 72px;
	}

	.directions__name {
		font-size: 17px;
	}
}

@media (max-width: 991px) {
	.directions {
		padding: 36px 0 40px;
	}

	.directions .directions__title {
		margin-bottom: 30px;
		font-size: 26px;
	}

	.directions__grid {
		gap: 20px;
	}

	.directions__card {
		min-height: 120px;
		padding: 16px 18px;
	}

	.directions__icon {
		width: 64px;
		height: 64px;
		margin-right: 16px;
	}

	.directions__icon svg,
	.directions__icon img {
		width: 64px;
		height: 64px;
		max-width: 64px;
		max-height: 64px;
	}

	.directions__name {
		font-size: 16px;
	}
}

@media (max-width: 575px) {
	.directions {
		padding: 28px 0 32px;
	}

	.directions .directions__title {
		margin-bottom: 24px;
		font-size: 22px;
	}

	.directions__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.directions__card {
		min-height: 104px;
	}

	.directions__icon {
		width: 60px;
		height: 60px;
	}

	.directions__icon svg,
	.directions__icon img {
		width: 60px;
		height: 60px;
		max-width: 60px;
		max-height: 60px;
	}
}
