/*
 * Полоса рубрик статей.
 *
 * Копия переключателя видов массажа (.types_sort из style.css) со своими
 * именами классов: там это фильтр с «таблеткой», которую двигает скрипт,
 * а здесь обычные ссылки, и полоса должна просто листаться. Менять можно
 * свободно — на другие блоки сайта не влияет.
 */

.article-cats {
	position: relative;
	margin-bottom: 20px;
}

.article-cats__list {
	display: flex;
	align-items: center;
	gap: 4px;
	height: 48px;
	padding: 3px 6px;
	overflow-x: auto;
	overflow-y: hidden;
	font-size: 16px;
	line-height: 155%;
	background: rgba(247, 247, 248, 1);
	border: 1px solid #2f2f2f1a;
	border-radius: 120px;
	/* Прокрутка пальцем и трекпадом — родная, без скриптов. */
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}

.article-cats__list::-webkit-scrollbar {
	height: 0;
}

.article-cats__link {
	display: flex;
	align-items: center;
	white-space: nowrap;
	padding: 8px 16px;
	color: #2f2f2f;
	text-decoration: none;
	border-radius: 30px;
	transition: background .2s ease, color .2s ease;
}

.article-cats__link:hover {
	background: rgba(137, 150, 111, .15);
}

.article-cats__link.is-active,
.article-cats__link.is-active:hover {
	color: #fff;
	background: #89966f;
}

/* Затемнение по краям — видно, что список продолжается. */
.article-cats__fade {
	position: absolute;
	top: 0;
	z-index: 2;
	width: 60px;
	height: 100%;
	opacity: 0;
	transition: opacity .2s ease;
	pointer-events: none;
}

.article-cats__fade--left {
	left: 0;
	background: linear-gradient(to right, rgba(247, 247, 248, 1) 0, rgba(247, 247, 248, 0) 100%);
	border-radius: 120px 0 0 120px;
}

.article-cats__fade--right {
	right: 0;
	background: linear-gradient(to left, rgba(247, 247, 248, 1) 0, rgba(247, 247, 248, 0) 100%);
	border-radius: 0 120px 120px 0;
}

.article-cats.has-left .article-cats__fade--left,
.article-cats.has-right .article-cats__fade--right {
	opacity: 1;
}

/* Мышью полосу тянут как карусель. */
.article-cats__list {
	cursor: grab;
}

.article-cats__list.is-dragging {
	cursor: grabbing;
	user-select: none;
}

.article-cats__link {
	-webkit-user-drag: none;
}

@media (min-width: 768px) {
	.article-cats__list {
		height: 85px;
		padding: 12px;
	}

	.article-cats__link {
		padding: 16px 32px;
		font-size: 20px;
	}
}
