/* More Case Studies (patterns/case-study-related.php). Values from the old related-case-studies-section.tsx and related-case-study-card.tsx. */
.sp-case-study-related {
	padding-block: 56px;
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--black) 5%, transparent);
	background: var(--wp--preset--color--white);
}
@media (min-width: 1024px) {
	.sp-case-study-related { padding-block: 100px; }
}
.sp-case-study-related .sp-case-study-related__heading.sp-case-study-related__heading { margin-bottom: 40px; }
@media (min-width: 1024px) {
	.sp-case-study-related .sp-case-study-related__heading.sp-case-study-related__heading { margin-bottom: 64px; }
}
.sp-case-study-related .sp-case-study-related__label.sp-case-study-related__label {
	margin-bottom: 20px;
	font-size: var(--wp--preset--font-size--label);
	line-height: 1.5;
	font-weight: 600;
	letter-spacing: 2px;
	text-transform: uppercase;
	opacity: 0.6;
}
@media (min-width: 1024px) {
	.sp-case-study-related .sp-case-study-related__title { width: fit-content; }
}
.sp-case-study-related .sp-case-study-related__title {
	font-size: var(--wp--preset--font-size--heading-2);
	line-height: 1.05;
	font-weight: 600;
	letter-spacing: -0.025em;
}

/* The shapes behind the cards: shown as a row in the editor; on the site the
   script puts one in each card, in this order, and hides the row. */
.sp-case-study-related .sp-cs-shapes {
	display: flex;
	gap: 16px;
	margin-bottom: 16px;
}
.sp-case-study-related .sp-cs-shapes .sp-cs-shape { width: 120px; margin: 0; }
html.sp-js .sp-case-study-related .sp-cs-shapes { display: none; }

.sp-case-study-related .sp-case-study-related__grid {
	display: grid;
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}
@media (min-width: 1024px) {
	.sp-case-study-related .sp-case-study-related__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
	.sp-case-study-related .sp-case-study-related__grid { gap: 36px; }
}
.sp-case-study-related .sp-case-study-related__grid > li { margin: 0; }

.sp-case-study-related .sp-case-study-related__card {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: 32px 20px;
	color: var(--wp--preset--color--black);
}
@media (min-width: 1024px) {
	.sp-case-study-related .sp-case-study-related__card { padding-top: 40px; padding-bottom: 16px; }
}
@media (min-width: 1280px) {
	.sp-case-study-related .sp-case-study-related__card { padding-inline: 36px; }
}
/* Left border, fills the card on hover. */
.sp-case-study-related .sp-case-study-related__card::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	z-index: 10;
	width: 2px;
	background: var(--wp--preset--color--primary);
	transition: width 0.3s linear;
}
.sp-case-study-related .sp-case-study-related__card:hover::before { width: 100%; }
.sp-case-study-related .sp-cs-card__shape {
	position: absolute;
	inset: 0;
	z-index: 0;
	margin: 0;
	overflow: hidden;
	pointer-events: none;
}
.sp-case-study-related .sp-cs-card__shape img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	opacity: 0.1;
	filter: brightness(0) saturate(100%) invert(70%) sepia(61%) saturate(1182%) hue-rotate(1deg) brightness(107%) contrast(106%);
	transition: opacity 0.3s linear;
}
.sp-case-study-related .sp-case-study-related__card:hover .sp-cs-card__shape img { opacity: 0; }

.sp-case-study-related .sp-case-study-related__content {
	position: relative;
	z-index: 20;
	display: flex;
	flex: 1;
	flex-direction: column;
	color: var(--wp--preset--color--black);
}
@media (min-width: 1024px) {
	.sp-case-study-related .sp-case-study-related__content { min-height: 360px; }
}
.sp-case-study-related .sp-case-study-related__logo.sp-case-study-related__logo { margin: 0 0 28px; }
/* The old logo kept its width="240" attribute (w-auto did not apply) and let max-width/max-height clamp it. */
.sp-case-study-related .sp-case-study-related__logo img {
	width: 100%; /* the old img stretched to its card, capped by max-width */
	height: auto;
	max-width: 180px;
	max-height: 48px;
	object-fit: contain;
	object-position: left;
	filter: brightness(0);
	transition: filter 0.3s linear;
}
.sp-cs--logo-includes-name .sp-case-study-related__logo img { max-width: 220px; max-height: 64px; }
@media (min-width: 640px) {
	.sp-cs--logo-includes-name .sp-case-study-related__logo img { max-height: 80px; }
}

/* Company name, then the case study title (one heading on the old site). */
.sp-case-study-related .sp-case-study-related__company,
.sp-case-study-related .sp-case-study-related__name {
	max-width: 75%;
	letter-spacing: -0.4px; /* tracking-tight on the old 16px heading, inherited */
}
.sp-case-study-related .sp-case-study-related__company {
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 32px;
	font-weight: 700;
}
.sp-case-study-related .sp-case-study-related__name.sp-case-study-related__name {
	margin: 8px 0;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 24px;
	font-weight: 500;
}
@media (min-width: 640px) {
	.sp-case-study-related .sp-case-study-related__company { font-size: 30px; line-height: 36px; }
	.sp-case-study-related .sp-case-study-related__name.sp-case-study-related__name { font-size: var(--wp--preset--font-size--large); line-height: 28px; }
}
@media (min-width: 1024px) {
	.sp-case-study-related .sp-case-study-related__name.sp-case-study-related__name { font-size: 20px; line-height: 28px; }
}
@media (min-width: 1536px) {
	.sp-case-study-related .sp-case-study-related__company { font-size: 36px; line-height: 40px; }
}
/* The logo already carries the name: no company line, the title takes its size. */
.sp-cs--logo-includes-name .sp-case-study-related__company { display: none; }
.sp-cs--logo-includes-name .sp-case-study-related__name.sp-case-study-related__name {
	margin-top: 0;
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 32px;
	font-weight: 700;
}
@media (min-width: 1536px) {
	.sp-cs--logo-includes-name .sp-case-study-related__name.sp-case-study-related__name { font-size: 36px; line-height: 40px; }
}

.sp-case-study-related .sp-case-study-related__excerpt { max-width: 65%; }
.sp-case-study-related .sp-case-study-related__excerpt p {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.35;
	color: var(--wp--preset--color--black);
}
@media (min-width: 1280px) {
	.sp-case-study-related .sp-case-study-related__excerpt p { font-size: 20px; }
}
.sp-case-study-related .sp-case-study-related__cta {
	display: inline-flex;
	align-items: center;
	width: fit-content;
	margin-top: 40px;
	padding: 12px 24px;
	border: 1px solid var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1;
	font-weight: 500;
	color: var(--wp--preset--color--black);
	text-decoration: none;
	transition: color 0.3s linear, border-color 0.3s linear;
}
@media (min-width: 1024px) {
	.sp-case-study-related .sp-case-study-related__cta { margin-top: auto; }
}
/* The title links to the case study and covers the whole card, as the old card link did. */
.sp-case-study-related .sp-case-study-related__name.sp-case-study-related__name { word-break: normal; overflow-wrap: normal; }
.sp-case-study-related .sp-case-study-related__name a {
	display: block;
	color: inherit;
	text-decoration: none;
}
.sp-case-study-related .sp-case-study-related__name a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 30;
}
.sp-case-study-related .sp-case-study-related__content { position: static; }
.sp-case-study-related .sp-case-study-related__content > * { position: relative; z-index: 20; }
/* z-index 21: as a flex item the title is its own layer, and its link cover must sit above the excerpt and button (20), or they swallow the click. */
.sp-case-study-related .sp-case-study-related__name.sp-case-study-related__name { position: static; z-index: 21; }
