@import url(~antd/lib/list/style/index-pure.less);
@import '../../style/themes/index';
@import '../../style/mixins/index.less';

@list-box-shadow: inset 0 -1px 0 0 #e6e8eb;

.@{list-prefix-cls} {
	border-radius: @border-radius-base;
	line-height: @layout-height-2;
	padding: 0 @padding-lg;

	&-header,
	&-item:not(&-item-with-meta),
	&-footer {
		.typography-paragraph-3();
		padding: @list-item-padding;
	}

	&-footer {
		box-shadow: inset 0 1px 0 0 #e6e8eb;
	}

	&-split {
		.@{list-prefix-cls}-header,
		.@{list-prefix-cls}-item:not(:last-child) {
			border-bottom: none;
			box-shadow: @list-box-shadow;
		}

		.@{list-prefix-cls}-header,
		.@{list-prefix-cls}-item,
		.@{list-prefix-cls}-footer {
			padding: @list-item-padding;
		}

		.@{list-prefix-cls}-item-with-meta {
			padding: @list-item-meta-padding;
		}

		.@{list-prefix-cls}-item.@{list-prefix-cls}-item-with-prev-extra {
			box-shadow: none;

			.@{list-prefix-cls}-item-main {
				box-shadow: @list-box-shadow;
				margin-left: 24px;
			}

			.@{list-prefix-cls}-item-extra {
				box-shadow: @list-box-shadow;
			}
		}
	}

	&-item-with-meta &-item-meta {
		align-items: center;
	}

	&-vertical {
		padding: 0 16px;

		.@{list-prefix-cls}-items .@{list-prefix-cls}-item {
			box-shadow: none;
			padding: 0;
		}

		.@{list-prefix-cls}-item-with-meta {
			display: flex;
		}

		.@{list-prefix-cls}-item-meta {
			padding: @list-item-meta-padding;
			margin-bottom: 0;

			&-title {
				.typography-paragraph-2();
				margin-bottom: @list-item-meta-title-margin-bottom;
				font-weight: 500;
				color: @heading-color;
			}

			&-content {
				height: 100%;
				display: flex;
				flex-direction: column;
			}

			&-footnote {
				.typography-paragraph-4();
				color: @gray-40;
				margin-top: max(auto, 20px);
			}
		}

		.@{list-prefix-cls}-item-extra {
			margin-left: 0;
			margin-right: @margin-lg;
			padding: @list-item-meta-padding;
		}

		.@{list-prefix-cls}-item-main {
			display: flex;
		}

		&.@{list-prefix-cls}-split {
			.@{list-prefix-cls}-item:not(:last-child) {
				.@{list-prefix-cls}-item-with-meta.@{list-prefix-cls}-item-no-flex {
					box-shadow: @list-box-shadow;
				}

				.@{list-prefix-cls}-item-main {
					box-shadow: @list-box-shadow;
				}
			}
		}
	}

	&-item {
		&-actions {
			&-split {
				margin: 0 6px;
				color: @cloud-gray-20;
			}
		}
	}

	&-item-action,
	&-vertical .@{list-prefix-cls}-item-action {
		margin-top: 0;
		margin-left: 24px;
		align-self: center;
		margin-right: 19px;

		& > li {
			padding: 0;
			display: inline-flex;
			align-items: center;
		}
	}

	&-item-meta-content {
		max-width: 540px;
	}

	&-item-meta-title {
		.typography-paragraph-4();
		font-weight: 500;
		&,
		& > a {
			color: @heading-color; // @text-color;
		}
		margin-bottom: 3px;
	}

	&-item-meta-description {
		.typography-paragraph-4();
		color: @cloud-gray-70; // @text-color-secondary;
	}

	&-item-meta-footnote {
		color: @gray-40;
	}

	// Overwrite Antd style.
	&-split&-something-after-last-item .@{ant-prefix}-spin-container > &-items > &-item:last-child {
		border-bottom: none;
	}

	//带头像标题样式
	&-item-meta-avatar .@{ant-prefix}-avatar {
		width: @avatar-size-base + 4px;
		height: @avatar-size-base + 4px;
	}

	&-item-meta-avatar + &-item-meta-content {
		.@{list-prefix-cls}-item-meta-title {
			.typography-subtitle-2();
			font-weight: 500;
			margin-bottom: 4px;
		}
	}

	&-lg {
		.@{list-prefix-cls}-header,
		.@{list-prefix-cls}-item:not(.@{list-prefix-cls}-item-with-meta),
		.@{list-prefix-cls}-footer {
			.typography-paragraph-2();
			color: @cloud-gray-70;
			padding: @list-item-padding-lg;
		}
	}

	&-sm {
		.@{list-prefix-cls}-header,
		.@{list-prefix-cls}-item:not(.@{list-prefix-cls}-item-with-meta),
		.@{list-prefix-cls}-footer {
			.typography-paragraph-4();
			color: @cloud-gray-70;
			padding: @list-item-padding-sm;
		}
	}
}
