/*
	----------------
	- Truncate
	----------------
*/

[class*="ipsTruncate_"]{
	--i-outline-offset: 0px;
	display: -webkit-box;
	-webkit-line-clamp: var(--line-clamp, 2);
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	/*
		Ensure that paragraphs are clamped in certain situations (if images exist, etc)
		The + 1lh at the end caters for the margin caused by paragraphs. A magic number unfortunately.
	*/
	max-height: calc(var(--line-clamp, 2) * 1lh + 2lh);
}

/* Force the ellipsis truncation to be used. Without this, a max-height is used which can sometimes prematurely clip content if paragraphs or images exist */
.ipsTruncate--ellipsis{
	max-height: none;
}
	.ipsTruncate--ellipsis img{
		display: none;
	}

.ipsTruncate_1{
	display: block;
	white-space: nowrap;
	max-width: 100%; /* Needed in certain scenarios, such as Embedded titles */
}

.ipsTruncate_1{ --line-clamp: 1; }
.ipsTruncate_2{ --line-clamp: 2; }
.ipsTruncate_3{ --line-clamp: 3; }
.ipsTruncate_4{ --line-clamp: 4; }
.ipsTruncate_5{ --line-clamp: 5; }
.ipsTruncate_6{ --line-clamp: 6; }
.ipsTruncate_7{ --line-clamp: 7; }
.ipsTruncate_8{ --line-clamp: 8; }
.ipsTruncate_9{ --line-clamp: 9; }

:where(.ipsQuote_contents, [data-ipstruncate]):not([data-truncate-expanded],[data-ipstruncate-deferred]){
	max-height: 15em;
	max-height: 15lh;
	overflow: auto;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

:where(.ipsQuote_contents, [data-ipstruncate]):not([data-truncate-expanded], [data-ipstruncate-deferred])::-webkit-scrollbar {
    display: none;
}

:where(.ipsQuote_contents, [data-ipstruncate])[data-truncated="true"]:not([data-truncate-expanded]){
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to top, hsl(0 0% 0% / 0) 1.4em, hsl(0 0% 0% / 1) 50%);
	mask-image: linear-gradient(to top, hsl(0 0% 0% / 0) 1.4em, hsl(0 0% 0% / 1) 50%);
}

/* This selector needs html due to :is(.ipsRichText, .ipsRichText) * */
html .ipsTruncate_more{
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: .5em;
	height: 3em;
	margin-top: -3em;
	text-decoration: none !important;
	font-size: .9em;
	font-weight: 500;
	cursor: pointer;
	width: 100%;
	padding: 0;
}

	.ipsQuote .ipsTruncate_more{
		color: var(--i-color_root);
		margin: 0;
		position: absolute;
		bottom: 0;
		left: 0;
	}