@import '../../../../../static/sass/common-frontend';

.ct-trending-block {
	padding: var(--padding, 30px) 0;

	> div {
		display: grid;
		grid-template-columns: var(--grid-template-columns);
		grid-column-gap: 30px;
		grid-row-gap: 20px;
		margin-bottom: 5px;

		@include media-breakpoint-only(md) {
			--grid-template-columns: repeat(2, 1fr);
		}

		@include media-breakpoint-up(lg) {
			--grid-template-columns: repeat(4, 1fr);
		}

		&.ct-leave-active,
		&.ct-leave {
			> a {
				transition: opacity 0.3s ease, 
							transform 0.3s ease;

				&:nth-of-type(1) {
					transition-delay: 0s;
				}

				&:nth-of-type(2) {
					transition-delay: 0.15s;
				}

				&:nth-of-type(3) {
					transition-delay: 0.25s;
				}

				&:nth-of-type(4) {
					transition-delay: 0.35s;
				}
			}
		}

		&.ct-leave-active {
			> a {
				opacity: 1;
				transform: translateY(0);
			}
		}

		&.ct-leave {
			> a {
				opacity: 0;
				transform: translateY(3px);
			}
		}

		&.ct-enter-active,
		&.ct-active {
			> a {
				transition: opacity 0.3s ease, 
							transform 0.3s ease;

				&:nth-of-type(1) {
					transition-delay: 0s;
				}

				&:nth-of-type(2) {
					transition-delay: 0.15s;
				}

				&:nth-of-type(3) {
					transition-delay: 0.25s;
				}

				&:nth-of-type(4) {
					transition-delay: 0.35s;
				}
			}
		}

		&.ct-enter-active {
			> a {
				opacity: 0;
				transform: translateY(3px);
			}
		}

		&.ct-active {
			> a {
				opacity: 1;
				transform: translateY(0);
			}
		}
	}

	.ct-block-title {
		--fontSize: 15px;
		grid-column: 1/-1;
		display: flex;
		align-items: center;
		margin-bottom: 10px;
		--headings-color: var(--color);

		> svg {
			margin-top: 4px;
			margin-inline-start: 10px;
		}
	}

	a {
		display: flex;
		align-items: center;
		--linkInitialColor: var(--color);
	}

	.ct-image-container {
		flex: 0 0 60px;
		border-radius: 100%;
		margin-inline-end: 20px;
		-webkit-mask-image: -webkit-radial-gradient(white, black);
	}

	.ct-item-title {
		word-break: break-word;
	}

	// arrows
	[class*='ct-arrow'] {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 23px;
		height: 23px;
		cursor: pointer;
		background: transparent;
		border-radius: 2px;
		opacity: 0.5;
		border: 1px solid var(--color);
		transition: var(--transition);

		&:before {
			content: '';
			width: 5px;
			height: 5px;
			border: 1px solid currentColor;
			border-right: none;
			border-bottom: none;
		}

		&:hover {
			opacity: 1;
			color: #fff;
			border-color: var(--paletteColor1);
			background: var(--paletteColor1);
		}
	}

	.ct-arrow-left {
		margin-inline-start: auto;
		margin-inline-end: 8px;
		padding-left: 1px;

		&:before {
			transform: rotate(-45deg);
		}
	}

	.ct-arrow-right {
		padding-right: 1px;

		&:before {
			transform: rotate(135deg);
		}
	}

	// disable arrows
	[data-page='1'] .ct-arrow-left,
	[data-page*="last"] .ct-arrow-right {
		opacity: 0.2;
		pointer-events: none;
	}
}