/* Homepage — blog-section: горизонтальная лента статей (template v44) */

.blog-section {
	--hp-blog-shell: min(1340px, calc(100vw - 64px));
	--hp-blog-line: var(--hp-line, #dce4de);
	--hp-blog-muted: var(--hp-muted, #65716a);
	--hp-blog-pine: var(--v21-forest, #06652e);
	--hp-blog-ink: #15231b;

	/*
	 * Заголовок и лид занимают ровно по две строки: длинные обрезаются,
	 * короткие не подтягивают плашки наверх. Высоты заданы в em, поэтому
	 * пересчитываются сами при смене размера шрифта в медиазапросах.
	 */
	--hp-blog-title-lines: 2.34em; /* 2 строки × line-height 1.17 */
	--hp-blog-lead-lines: 3.04em;  /* 2 строки × line-height 1.52 */

	position: relative;
	overflow: hidden;
	padding: 92px 0 82px;
	border-top: 1px solid var(--hp-blog-line);
	background: #fff;
}

.blog-section .section-shell {
	width: var(--hp-blog-shell);
	margin: 0 auto;
}

.blog-section .blog-heading {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: 36px;
	margin-bottom: 27px;
}

.blog-section .blog-heading-copy {
	max-width: 820px;
}

.blog-section .blog-heading h2 {
	margin: 0;
	color: var(--hp-blog-ink);
	font-size: clamp(30px, 3.2vw, 44px);
	font-weight: 650;
	line-height: 1.03;
	letter-spacing: -0.035em;
}

.blog-section .blog-heading .section-subtitle {
	max-width: 690px;
	margin: 17px 0 0;
	color: var(--hp-blog-muted);
	font-size: 16px;
	line-height: 1.55;
}

.blog-section .blog-heading-actions {
	display: flex;
	align-items: center;
	gap: 11px;
}

.blog-section .blog-all-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 13px;
	min-height: 46px;
	padding: 0 17px;
	border: 1px solid var(--hp-blog-line);
	border-radius: 12px;
	background: #fff;
	color: var(--hp-blog-pine);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.blog-section .blog-all-link:hover {
	border-color: #aac6b2;
	background: #f3f8f3;
	transform: translateY(-2px);
}

.blog-section .blog-scroll-buttons {
	display: flex;
	gap: 7px;
}

.blog-section .blog-scroll-btn {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border: 1px solid var(--hp-blog-line);
	border-radius: 12px;
	background: #fff;
	color: var(--hp-blog-pine);
	font-size: 19px;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s, opacity 0.2s;
}

.blog-section .blog-scroll-btn:hover:not(:disabled) {
	border-color: var(--hp-blog-pine);
	background: var(--hp-blog-pine);
	color: #fff;
	transform: translateY(-2px);
}

.blog-section .blog-scroll-btn:disabled {
	opacity: 0.32;
	cursor: default;
}

.blog-section .blog-rail-wrap {
	position: relative;
}

.blog-section .blog-grid {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 32px) / 3.15);
	gap: 16px;
	padding: 4px 2px 18px;
	overflow-x: auto;
	overscroll-behavior-inline: contain;
	scroll-behavior: smooth;
	scroll-padding-left: 2px;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.blog-section .blog-grid::-webkit-scrollbar {
	display: none;
}

.blog-section .blog-card {
	display: grid;
	grid-template-rows: 235px auto;
	min-width: 0;
	overflow: hidden;
	border: 1px solid rgba(8, 107, 63, 0.14);
	border-radius: 22px;
	background: #fff;
	box-shadow: 0 12px 34px rgba(10, 50, 31, 0.07);
	color: var(--hp-blog-ink);
	scroll-snap-align: start;
	text-decoration: none;
	transition: border-color 0.24s, box-shadow 0.24s, transform 0.24s;
}

.blog-section .blog-card:hover {
	border-color: rgba(8, 107, 63, 0.34);
	box-shadow: 0 19px 46px rgba(10, 50, 31, 0.12);
	transform: translateY(-4px);
}

.blog-section .blog-media {
	position: relative;
	overflow: hidden;
	background: #dce9df;
}

.blog-section .blog-media:after {
	content: "";
	position: absolute;
	inset: 54% 0 0;
	background: linear-gradient(180deg, transparent, rgba(3, 42, 24, 0.31));
}

.blog-section .blog-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.55s ease;
}

.blog-section .blog-card:hover .blog-media img {
	transform: scale(1.035);
}

.blog-section .blog-content {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 22px 22px 19px;
}

.blog-section .blog-content h3 {
	display: -webkit-box;
	height: var(--hp-blog-title-lines);
	margin: 0;
	overflow: hidden;
	font-size: 21px;
	font-weight: 650;
	line-height: 1.17;
	letter-spacing: -0.025em;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.blog-section .blog-content > p {
	display: -webkit-box;
	height: var(--hp-blog-lead-lines);
	margin: 12px 0 0;
	overflow: hidden;
	color: var(--hp-blog-muted);
	font-size: 14px;
	line-height: 1.52;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.blog-section .blog-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	/* Строка резервируется даже без плашек — карточки держат общую высоту */
	min-height: 31px;
	margin-top: 18px;
}

.blog-section .blog-facts span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 31px;
	padding: 0 10px;
	border: 1px solid #d5e8d9;
	border-radius: 12px;
	background: #edf6ee;
	color: #0d6d34;
	font-size: 10px;
	font-weight: 650;
	line-height: 1.15;
}

/* Плашка со временем чтения — нейтральная, с иконкой часов слева */
.blog-section .blog-facts .blog-fact--clock {
	border-color: #dfe9e1;
	background: #f5f8f5;
	color: #526359;
}

.blog-section .blog-facts svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Страница всех статей: те же карточки, но обычной сеткой, а не лентой */

.blog-section.blog-archive {
	padding: 0 0 20px;
	border-top: 0;
}

.blog-archive .blog-heading {
	grid-template-columns: minmax(0, 1fr);
	margin-bottom: 24px;
}

.blog-archive .blog-heading h1 {
	margin: 0;
	color: var(--hp-blog-ink);
	font-size: clamp(30px, 3.2vw, 44px);
	font-weight: 650;
	line-height: 1.03;
	letter-spacing: -0.035em;
}

.blog-section .blog-grid--page {
	grid-auto-flow: row;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-auto-columns: auto;
	gap: 16px 16px;
	padding: 0;
	overflow: visible;
	scroll-snap-type: none;
}

@media (max-width: 1000px) {
	.blog-section .blog-grid--page {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.blog-section .blog-grid--page {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}
}

@media (max-width: 1000px) {
	.blog-section {
		padding: 72px 0 64px;
	}

	.blog-section .blog-grid {
		grid-auto-columns: calc((100% - 16px) / 2.25);
	}

	.blog-section .blog-card {
		grid-template-rows: 220px auto;
	}
}

@media (max-width: 700px) {
	.blog-section {
		--hp-blog-shell: min(calc(100vw - 32px), 1340px);
		--hp-blog-title-lines: 2.36em; /* 2 строки × line-height 1.18 */
		--hp-blog-lead-lines: 3em;     /* 2 строки × line-height 1.5 */

		padding: 50px 0 46px;
	}

	.blog-section .blog-heading {
		grid-template-columns: 1fr;
		align-items: start;
		gap: 17px;
		margin-bottom: 20px;
	}

	.blog-section .blog-heading h2 {
		font-size: 30px;
		line-height: 1.04;
	}

	.blog-section .blog-heading .section-subtitle {
		margin-top: 13px;
		font-size: 14px;
		line-height: 1.52;
	}

	.blog-section .blog-heading-actions {
		width: 100%;
		justify-content: space-between;
	}

	.blog-section .blog-all-link {
		min-height: 42px;
		padding: 0 14px;
		font-size: 12px;
	}

	.blog-section .blog-scroll-buttons {
		display: none;
	}

	.blog-section .blog-grid {
		grid-auto-columns: min(82vw, 340px);
		gap: 12px;
		padding: 2px 0 8px;
		scroll-padding-left: 0;
	}

	.blog-section .blog-card {
		grid-template-rows: 205px auto;
		border-radius: 20px;
	}

	.blog-section .blog-content {
		padding: 18px 18px 17px;
	}

	.blog-section .blog-content h3 {
		font-size: 20px;
		line-height: 1.18;
	}

	.blog-section .blog-content > p {
		margin-top: 10px;
		font-size: 14px;
		line-height: 1.5;
	}

	.blog-section .blog-facts {
		gap: 6px;
		min-height: 29px;
		margin-top: 15px;
	}

	.blog-section .blog-facts span {
		min-height: 29px;
		padding: 0 9px;
		font-size: 9px;
	}
}

@media (max-width: 380px) {
	.blog-section .blog-grid {
		grid-auto-columns: calc(100vw - 42px);
	}
}
