/* Виджет «Список документов» (inc/elementor/class-doc-list-widget.php) */
/* Селекторы с префиксом .dst-docs — иначе их перебивают .elementor-kit-6 h2/a/p */

.dst-docs {
	--dd-accent: #ff8a00;
	--dd-heading: #1c2226;
	--dd-text: #6b7378;
	--dd-item-bg: #fff;
	--dd-item-border: #dfe4e8;
	font-family: 'Raleway', sans-serif;
	font-variant-numeric: lining-nums;
}

.dst-docs .dst-docs__head {
	margin-bottom: 40px;
}

.dst-docs .dst-docs__eyebrow {
	margin-bottom: 14px;
	color: var(--dd-accent);
	font-size: 15px;
	letter-spacing: .06em;
	line-height: 1.3;
	text-transform: uppercase;
}

.dst-docs .dst-docs__title {
	margin: 0 0 22px;
	color: var(--dd-heading);
	font-family: inherit;
	font-size: 50px;
	font-weight: 700;
	line-height: 1.1;
	text-transform: uppercase;
}

.dst-docs .dst-docs__subtitle {
	margin: 0;
	color: var(--dd-text);
	font-size: 15px;
	line-height: 1.5;
}

.dst-docs .dst-docs__grid {
	display: grid;
	/* 6 дорожек: обычный пункт занимает 2 (по 3 в ряд), неполный последний ряд растягивается */
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 14px 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dst-docs .dst-docs__grid > li {
	display: flex;
	grid-column: span 2;
	margin: 0;
	padding: 0;
}

/* В последнем ряду два пункта — по 50% */
.dst-docs .dst-docs__grid > li:nth-child(3n+1):nth-last-child(2),
.dst-docs .dst-docs__grid > li:nth-child(3n+2):last-child {
	grid-column: span 3;
}

/* В последнем ряду один пункт — на всю ширину, текст по центру */
.dst-docs .dst-docs__grid > li:nth-child(3n+1):last-child {
	grid-column: 1 / -1;
}

.dst-docs .dst-docs__grid > li:nth-child(3n+1):last-child .dst-docs__item {
	justify-content: center;
}

.dst-docs .dst-docs__item {
	display: flex;
	align-items: center;
	gap: 18px;
	width: 100%;
	min-height: 78px;
	padding: 14px 24px;
	background: var(--dd-item-bg);
	border: 1px solid var(--dd-item-border);
	border-radius: 6px;
	box-sizing: border-box;
	color: var(--dd-heading);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	transition: border-color .2s, box-shadow .2s;
}

.dst-docs a.dst-docs__item:hover {
	border-color: var(--dd-accent);
	box-shadow: 0 8px 20px rgba(28, 34, 38, .07);
	color: var(--dd-heading);
	text-decoration: none;
}

.dst-docs .dst-docs__icon {
	display: flex;
	flex: 0 0 auto;
	color: var(--dd-accent);
	font-size: 22px;
	line-height: 1;
}

.dst-docs .dst-docs__icon svg {
	width: auto;
	height: 22px;
}

/* Иконки библиотеки, которые Elementor выводит как SVG; загруженные SVG не трогаем */
.dst-docs .dst-docs__icon svg.e-font-icon-svg {
	fill: currentColor;
}

.dst-docs .dst-docs__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px 40px;
	margin-top: 32px;
}

.dst-docs .dst-docs__note {
	margin: 0;
	color: var(--dd-heading);
	font-size: 16px;
	line-height: 1.55;
}

.dst-docs .dst-docs__btn {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-width: 374px;
	padding: 15px 34px;
	background: var(--dd-accent);
	border-radius: 2px;
	box-sizing: border-box;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: filter .2s;
}

.dst-docs .dst-docs__btn:hover,
.dst-docs .dst-docs__btn:focus-visible {
	color: #fff;
	filter: brightness(1.08);
	text-decoration: none;
}

.dst-docs .dst-docs__btn svg {
	transition: transform .2s;
}

.dst-docs .dst-docs__btn:hover svg {
	transform: translateX(3px);
}

@media (max-width: 1024px) {
	/* По 2 в ряд; одинокий последний пункт — на всю ширину */
	.dst-docs .dst-docs__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.dst-docs .dst-docs__grid > li,
	.dst-docs .dst-docs__grid > li:nth-child(3n+1):nth-last-child(2),
	.dst-docs .dst-docs__grid > li:nth-child(3n+2):last-child,
	.dst-docs .dst-docs__grid > li:nth-child(3n+1):last-child {
		grid-column: auto;
	}

	.dst-docs .dst-docs__grid > li:nth-child(odd):last-child {
		grid-column: 1 / -1;
	}

	.dst-docs .dst-docs__grid > li:nth-child(3n+1):last-child .dst-docs__item {
		justify-content: flex-start;
	}

	.dst-docs .dst-docs__grid > li:nth-child(odd):last-child .dst-docs__item {
		justify-content: center;
	}

	.dst-docs .dst-docs__title {
		font-size: 38px;
	}
}

@media (max-width: 767px) {
	.dst-docs .dst-docs__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.dst-docs .dst-docs__grid > li:nth-child(odd):last-child .dst-docs__item {
		justify-content: flex-start;
	}

	.dst-docs .dst-docs__head {
		margin-bottom: 28px;
	}

	.dst-docs .dst-docs__title {
		font-size: 28px;
	}

	.dst-docs .dst-docs__item {
		min-height: 64px;
		padding: 12px 18px;
	}

	/* Ручные переносы строк на телефоне только мешают */
	.dst-docs .dst-docs__item br,
	.dst-docs .dst-docs__note br {
		display: none;
	}

	.dst-docs .dst-docs__footer {
		flex-direction: column;
		align-items: stretch;
	}

	.dst-docs .dst-docs__btn {
		min-width: 0;
		width: 100%;
	}
}
