/* Доработки темы поверх main.css вёрстки */

/* Текстовый блок (политика конфиденциальности, согласие и т.п.) */
.text-page__inner {
	background-color: #fff;
	border-radius: 30px;
	padding: 48px;
}

.text-page__title {
	margin-bottom: 32px;
}

.text-page__content {
	max-width: 960px;
}

.text-page__content > :last-child {
	margin-bottom: 0;
}

.text-page__content ol {
	margin-bottom: 1.1em;
}

.article-detail__content .wp-block-table {
	overflow-x: auto;
}

/* Длинное название PDF не должно расширять колонку каталога. */
.acts-catalog__item,
.act-card {
	min-width: 0;
}

.act-file-card__title {
	overflow-wrap: anywhere;
}

@media (max-width: 540px) {
	.act-file-card__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.act-file-card__btn-view {
		justify-content: center;
	}
}

/* Меню с пятью и более пунктами переносится внутри шапки. */
@media (min-width: 1281px) {
	.header__inner:has(> .header__nav > .header__item:nth-child(5)) {
		gap: 12px;
	}

	.header__nav:has(> .header__item:nth-child(5)) {
		flex-wrap: wrap;
		justify-content: center;
		gap: 8px 10px;
		padding: 14px;
	}

	.header__nav:has(> .header__item:nth-child(5)) .header__link {
		font-size: 16px;
	}
}

@media (max-width: 767px) {
	.text-page__inner {
		border-radius: 20px;
		padding: 20px;
	}

	.text-page__title {
		margin-bottom: 20px;
	}
}

/* Админ-бар не должен перекрывать шапку-оверлей */
.admin-bar .header_overlay {
	top: calc(16px + 32px);
}

@media (max-width: 782px) {
	.admin-bar .header_overlay {
		top: calc(16px + 46px);
	}
}

/*
 * «Нам доверяют»: первый ряд (space-between) с отступом 37px не помещается в контейнер
 * на экранах ~1401–1500px и пятый логотип переносится. Отступ здесь — только минимум,
 * визуальное расстояние задаёт space-between, поэтому на 1920 ничего не меняется.
 */
@media (min-width: 1401px) {
	.clients__row_wide {
		column-gap: 24px;
	}
}

/* Кнопка «Наверх» (footer.php, assets/scroll-top.js): акцентный круг, как .btn_accent */
.scroll-top {
	align-items: center;
	background-color: #e4e06d;
	border: 0;
	border-radius: 50%;
	bottom: 40px;
	box-shadow: 0 20px 60px rgba(25, 25, 27, 0.35);
	color: #19191b;
	cursor: pointer;
	display: flex;
	height: 60px;
	justify-content: center;
	opacity: 0;
	padding: 0;
	position: fixed;
	right: 40px;
	transform: translateY(30px);
	transition:
		opacity 0.3s ease,
		transform 0.3s ease,
		background-color 0.3s ease,
		color 0.3s ease,
		visibility 0s linear 0.3s;
	visibility: hidden;
	width: 60px;
	z-index: 2000;
}

.scroll-top_active {
	opacity: 1;
	transform: translateY(0);
	transition:
		opacity 0.3s ease,
		transform 0.3s ease,
		background-color 0.3s ease,
		color 0.3s ease,
		visibility 0s;
	visibility: visible;
}

.scroll-top svg {
	height: 18px;
	transform: rotate(180deg);
	transition: transform 0.3s ease;
	width: 14px;
}

.scroll-top:hover {
	background-color: #c3be3b;
}

.scroll-top:hover svg {
	transform: rotate(180deg) translateY(3px);
}

.scroll-top:active {
	background-color: #fff;
}

.scroll-top:focus-visible {
	outline: 2px solid #19191b;
	outline-offset: 3px;
}

@media (max-width: 767px) {
	.scroll-top {
		bottom: 16px;
		height: 48px;
		right: 16px;
		width: 48px;
	}

	.scroll-top svg {
		height: 15px;
		width: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.scroll-top,
	.scroll-top svg {
		transition: none;
	}
}
