/* SO Content Rows */

/* ---------- Tokens ---------- */
.so-rows {
	/* Match the header/footer: Bricks container width and section padding. */
	--so-width: 1300px;
	--so-gutter: var(--space-s, 1.25rem);
	/* Distance from the viewport edge to the content edge. */
	--so-edge: max(var(--so-gutter), (100cqw - var(--so-width)) / 2);
	--so-gap: var(--grid-gap, clamp(1.25rem, 0.96vw + 1.03rem, 1.875rem));
	--so-gap-l: calc(var(--so-gap) * 2);
	--so-flow: var(--content-gap, clamp(1.25rem, 0.96vw + 1.03rem, 1.875rem));
	--so-space-s: var(--section-space-s, clamp(2rem, 2vw + 1.5rem, 3.5rem));
	--so-space-m: var(--section-space-m, clamp(2.5rem, 4.8vw + 1.4rem, 5.625rem));
	--so-space-l: var(--section-space-l, clamp(2.5rem, 9.1vw + 0.44rem, 8.4375rem));
	--so-header-space: 15rem;
	--so-text: var(--text-m, clamp(1rem, 0.92vw + 0.79rem, 1.6rem));
	--so-text-l: var(--text-l, clamp(1.2rem, 1.44vw + 0.88rem, 2.13rem));
	--so-h1: min(var(--h2, 4.2rem), 12vw);
	--so-h2: min(var(--h2, 4.2rem), 10vw);
	--so-h3: clamp(1.6rem, 1rem + 1.6vw, 2.8rem);
	--so-yellow: #ffcc33;

	display: flex;
	flex-direction: column;
	width: 100%;
	container-type: inline-size;
	font-size: var(--so-text);
	font-weight: 300;
	line-height: 1.4;
}

.so-rows *,
.so-rows *::before,
.so-rows *::after {
	box-sizing: border-box;
}

/* ---------- Row wrapper ---------- */
.so-rows > .so-row {
	--so-pt: var(--so-space-m);
	--so-pb: var(--so-space-m);
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	padding: var(--so-pt) 0 var(--so-pb);
	background-color: var(--so-bg, #fff);
	color: var(--so-ink, #000);
	isolation: isolate;
}

.so-rows .so-pt-none { --so-pt: 0px; }
.so-rows .so-pt-s { --so-pt: var(--so-space-s); }
.so-rows .so-pt-m { --so-pt: var(--so-space-m); }
.so-rows .so-pt-l { --so-pt: var(--so-space-l); }
.so-rows .so-pb-none { --so-pb: 0px; }
.so-rows .so-pb-s { --so-pb: var(--so-space-s); }
.so-rows .so-pb-m { --so-pb: var(--so-space-m); }
.so-rows .so-pb-l { --so-pb: var(--so-space-l); }

/* Undo AutomaticCSS's flex defaults on sections and their child divs. */
.so-rows > .so-row {
	gap: 0;
}

.so-rows img {
	border-radius: 0;
}

/* Clear the overlaid site header. */
.so-rows > .so-row:first-child {
	padding-top: max(var(--so-pt), var(--so-header-space));
}

.so-rows .so-container,
.so-rows .so-stats-wrap {
	display: block;
	width: 100%;
	max-width: calc(var(--so-width) + var(--so-gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--so-gutter);
}

.so-rows .so-stats-wrap {
	max-width: none;
	padding-inline: 0;
}

/* Background image */
.so-rows .so-row__bg,
.so-rows .so-row__overlay {
	display: block;
	position: absolute;
	inset: 0;
	z-index: -1;
}

.so-row__bg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.so-rows .so-row__overlay {
	background-color: var(--so-bg, #000);
	opacity: var(--so-overlay, 0.7);
}

/* ---------- Colours ---------- */
.so-rows .so-bg-white { --so-bg: #ffffff; }
.so-rows .so-bg-light-grey { --so-bg: #e5e6e8; }
.so-rows .so-bg-grey { --so-bg: #d4d4d4; }
.so-rows .so-bg-light-yellow { --so-bg: #ffd966; }
.so-rows .so-bg-yellow { --so-bg: #ffcc33; }
.so-rows .so-bg-light-blue { --so-bg: #66ccff; }
.so-rows .so-bg-blue { --so-bg: #00a5ce; }
.so-rows .so-bg-dark-blue { --so-bg: #250188; }
.so-rows .so-bg-light-purple { --so-bg: #9397cb; }
.so-rows .so-bg-purple { --so-bg: #46166b; }
.so-rows .so-bg-red { --so-bg: #ee2e24; }
.so-rows .so-bg-green { --so-bg: #7ac24e; }
.so-rows .so-bg-charcoal { --so-bg: #383838; }
.so-rows .so-bg-black { --so-bg: #000000; }

.so-rows .so-text-dark { --so-ink: #000; }
.so-rows .so-text-light { --so-ink: #fff; }

/* ---------- Type ---------- */
.so-rows .so-title {
	margin: 0;
	max-width: none;
	color: inherit;
	font-family: inherit;
	font-weight: 700;
	letter-spacing: -0.05em;
	line-height: 0.95;
	text-wrap: balance;
}

.so-rows h1.so-title { font-size: var(--so-h1); }
.so-rows h2.so-title { font-size: var(--so-h2); }
.so-rows h3.so-title { font-size: var(--so-h3); }

.so-rows .so-title strong,
.so-rows .so-title b {
	font-weight: 700;
	color: var(--so-yellow);
}

.so-rows .so-bg-yellow .so-title strong,
.so-rows .so-bg-light-yellow .so-title strong {
	color: #fff;
}

.so-rows p,
.so-rows .so-text,
.so-rows .so-text li {
	max-width: none;
	color: inherit;
	font-size: inherit;
}

.so-rows .so-text > * {
	margin: 0;
}

.so-rows .so-text > * + * {
	margin-top: 0.9em;
}

.so-rows .so-text strong,
.so-rows .so-text b {
	font-weight: 600;
}

.so-rows .so-text a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.so-rows .so-text a:hover {
	text-decoration-thickness: 2px;
}

.so-rows .so-text ul,
.so-rows .so-text ol {
	padding-left: 1.2em;
}

.so-rows .so-text li + li {
	margin-top: 0.35em;
}

.so-rows .so-text h2,
.so-rows .so-text h3,
.so-rows .so-text h4 {
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.05;
	color: inherit;
}

.so-rows .so-text h2 { font-size: 1.6em; }
.so-rows .so-text h3 { font-size: 1.3em; }
.so-rows .so-text h4 { font-size: 1.1em; }

/* Tag */
.so-rows .so-tag {
	display: inline-block;
	align-self: flex-start;
	/* 1px less on the right offsets the trailing letter-spacing. */
	padding: 0.62em calc(0.75rem - 1px) 0.38em 0.75rem;
	background: var(--so-tag-bg, #ee2e24);
	color: var(--so-tag-ink, #000);
	font-size: 0.8rem;
	font-weight: 400;
	letter-spacing: 1px;
	line-height: 1;
	text-transform: uppercase;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Trim to cap height so the text centres exactly. */
@supports (text-box: trim-both cap alphabetic) {
	.so-rows .so-tag {
		padding-block: 0.5em;
		text-box: trim-both cap alphabetic;
	}
}

.so-rows .so-tag--c-white { --so-tag-bg: #ffffff; --so-tag-ink: #000; }
.so-rows .so-tag--c-light-grey { --so-tag-bg: #e5e6e8; --so-tag-ink: #000; }
.so-rows .so-tag--c-grey { --so-tag-bg: #d4d4d4; --so-tag-ink: #000; }
.so-rows .so-tag--c-light-yellow { --so-tag-bg: #ffd966; --so-tag-ink: #000; }
.so-rows .so-tag--c-yellow { --so-tag-bg: #ffcc33; --so-tag-ink: #000; }
.so-rows .so-tag--c-light-blue { --so-tag-bg: #66ccff; --so-tag-ink: #000; }
.so-rows .so-tag--c-blue { --so-tag-bg: #00a5ce; --so-tag-ink: #fff; }
.so-rows .so-tag--c-dark-blue { --so-tag-bg: #250188; --so-tag-ink: #fff; }
.so-rows .so-tag--c-light-purple { --so-tag-bg: #9397cb; --so-tag-ink: #fff; }
.so-rows .so-tag--c-purple { --so-tag-bg: #46166b; --so-tag-ink: #fff; }
.so-rows .so-tag--c-red { --so-tag-bg: #ee2e24; --so-tag-ink: #000; }
.so-rows .so-tag--c-green { --so-tag-bg: #7ac24e; --so-tag-ink: #fff; }
.so-rows .so-tag--c-charcoal { --so-tag-bg: #383838; --so-tag-ink: #fff; }
.so-rows .so-tag--c-black { --so-tag-bg: #000000; --so-tag-ink: #fff; }
.so-rows .so-tag--branding { --so-tag-bg: #66ccff; }

/* Red tags on red get swapped to black. */
.so-rows .so-bg-red .so-tag--c-red,
.so-rows .so-bg-red .so-tag:not([class*="so-tag--c-"]) {
	--so-tag-bg: #000;
	--so-tag-ink: #fff;
}

/* ---------- Buttons ---------- */
.so-rows .so-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.so-rows .so-btn {
	display: inline-block;
	padding: 0.3em 0.8em 0.25em;
	border: 2px solid #000;
	border-radius: 0;
	background: #000;
	color: #fff;
	font-family: inherit;
	font-size: var(--so-text-l);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.15;
	text-decoration: none;
	transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.so-rows .so-btn:hover,
.so-rows .so-btn:focus-visible,
.so-rows .so-panel--link:hover .so-btn {
	background: var(--so-yellow);
	border-color: var(--so-yellow);
	color: #000;
}

.so-rows .so-text-light .so-btn {
	background: #fff;
	border-color: #fff;
	color: #000;
}

.so-rows .so-btn--outline,
.so-rows .so-text-light .so-btn--outline {
	background: transparent;
	border-color: currentColor;
	color: inherit;
}

.so-rows .so-text-dark .so-btn--outline:hover,
.so-rows .so-text-dark .so-btn--outline:focus-visible,
.so-rows .so-text-dark.so-panel--link:hover .so-btn--outline {
	background: #000;
	border-color: #000;
	color: #fff;
}

.so-rows .so-text-light .so-btn:hover,
.so-rows .so-text-light .so-btn:focus-visible,
.so-rows .so-text-light.so-panel--link:hover .so-btn {
	background: var(--so-yellow);
	border-color: var(--so-yellow);
	color: #000;
}

/* Yellow hover would vanish on yellow rows. */
.so-rows .so-bg-yellow .so-btn:not(.so-btn--outline):hover,
.so-rows .so-bg-yellow .so-btn:not(.so-btn--outline):focus-visible,
.so-rows .so-bg-light-yellow .so-btn:not(.so-btn--outline):hover,
.so-rows .so-bg-light-yellow .so-btn:not(.so-btn--outline):focus-visible {
	background: #fff;
	border-color: #fff;
	color: #000;
}

.so-rows a:focus-visible {
	outline: 3px solid var(--so-yellow);
	outline-offset: 3px;
}

.so-rows .so-bg-yellow a:focus-visible,
.so-rows .so-bg-light-yellow a:focus-visible {
	outline-color: #000;
}

/* ---------- Row heading ---------- */
.so-row__head {
	display: flex;
	flex-direction: column;
	gap: var(--so-flow);
	margin-bottom: var(--so-gap-l);
}

/* Flush rows still need space above a heading. */
.so-rows > .so-pt-none > .so-container:first-child > .so-row__head {
	padding-top: var(--so-space-m);
}

.so-row__head--center {
	align-items: center;
	text-align: center;
}

.so-row__head--split {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
}

.so-row__head-text {
	display: flex;
	flex-direction: column;
	gap: var(--so-flow);
}

.so-rows .so-row__intro {
	margin: 0;
	max-width: 40em;
}

/* ---------- Content ---------- */
.so-content {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--so-gap-l);
}

.so-content__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--so-flow);
	min-width: 0;
}

.so-content__cols {
	display: grid;
	gap: var(--so-flow) var(--so-gap-l);
	width: 100%;
}

.so-content--cols-1:not(.so-content--media-left):not(.so-content--media-right) .so-content__text {
	max-width: 50rem;
}

.so-content--center .so-content__text {
	align-items: center;
	margin-inline: auto;
	text-align: center;
}

.so-content--center .so-tag {
	align-self: center;
}

.so-content--center .so-btns {
	justify-content: center;
}

.so-content--media-above .so-media,
.so-content--media-left .so-media,
.so-content--media-right .so-media {
	order: -1;
}

.so-media {
	margin: 0;
	min-width: 0;
}

.so-media img {
	display: block;
	width: 100%;
	height: auto;
}

.so-media--square img { aspect-ratio: 1 / 1; }
.so-media--landscape img { aspect-ratio: 3 / 2; }
.so-content--media-above .so-media--landscape img,
.so-content--media-below .so-media--landscape img { aspect-ratio: 21 / 9; }

/* Full width: media above/below runs to the viewport edges. */
.so-row--full .so-content--media-above .so-media,
.so-row--full .so-content--media-below .so-media {
	margin-inline: calc(var(--so-edge) * -1);
}

/* Full-width box reserves space before load; the image sits inside it. */
.so-content--media-above .so-media--auto img,
.so-content--media-below .so-media--auto img {
	width: 100%;
	height: auto;
	max-height: 32rem;
}

.so-content--left.so-content--media-above .so-media--contain img,
.so-content--left.so-content--media-below .so-media--contain img {
	object-position: left center;
}
.so-media--portrait img { aspect-ratio: 4 / 5; }
.so-media--cover img { object-fit: cover; }
.so-media--contain img { object-fit: contain; }

.so-media--video {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
}

.so-media--video iframe,
.so-media--video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

@media (min-width: 768px) {
	.so-content--cols-2:not(.so-content--media-left):not(.so-content--media-right) .so-content__cols {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.so-content--media-left,
	.so-content--media-right {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: calc(var(--so-gap) * 2.5);
	}

	.so-content--media-right .so-media {
		order: 1;
	}

	.so-content--valign-middle {
		align-items: center;
	}

	.so-content--valign-top {
		align-items: start;
	}

	/* Full width with side media: media bleeds to the edge. */
	.so-row--full.so-row--split {
		padding-block: 0;
	}

	.so-rows .so-row--full.so-row--split > .so-container {
		max-width: none;
		padding-inline: 0;
	}

	.so-row--full .so-content--media-left,
	.so-row--full .so-content--media-right {
		column-gap: 0;
		align-items: stretch;
	}

	.so-row--full .so-content--media-left .so-content__text,
	.so-row--full .so-content--media-right .so-content__text {
		justify-content: center;
		padding-block: var(--so-pt) var(--so-pb);
	}

	.so-row--full .so-content--media-left .so-content__text {
		padding-inline: calc(var(--so-gap) * 2.5) var(--so-edge);
	}

	.so-row--full .so-content--media-right .so-content__text {
		padding-inline: var(--so-edge) calc(var(--so-gap) * 2.5);
	}

	.so-row--full .so-content--valign-top .so-content__text {
		justify-content: flex-start;
	}

	.so-rows > .so-row--full.so-row--split:first-child {
		padding-top: 0;
	}

	.so-rows > .so-row--full.so-row--split:first-child .so-content__text {
		padding-top: max(var(--so-pt), var(--so-header-space));
	}

	.so-row--full .so-content--media-left .so-media--image,
	.so-row--full .so-content--media-right .so-media--image {
		min-height: 24rem;
	}

	.so-row--full .so-content--media-left .so-media--image img,
	.so-row--full .so-content--media-right .so-media--image img {
		height: 100%;
		aspect-ratio: auto;
	}

	.so-row--full .so-content--media-left .so-media--video,
	.so-row--full .so-content--media-right .so-media--video {
		align-self: center;
	}
}

/* ---------- Call-out ---------- */
.so-callout {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--so-flow) var(--so-gap-l);
}

.so-callout--stacked {
	flex-direction: column;
	align-items: flex-start;
}

.so-callout--center {
	justify-content: center;
	text-align: center;
}

.so-callout--stacked.so-callout--center {
	align-items: center;
}

.so-callout--center .so-btns {
	justify-content: center;
}

.so-callout--inline .so-callout__text {
	flex: 1 1 18em;
}

.so-callout--inline .so-btns {
	flex-shrink: 0;
}

.so-rows .so-callout__text {
	margin: 0;
	max-width: 28em;
	font-size: var(--so-text-l);
	font-weight: 300;
	line-height: 1.25;
}

.so-callout__text strong {
	font-weight: 700;
	letter-spacing: -0.03em;
}

/* ---------- Panels ---------- */
.so-rows .so-panels {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: stretch;
	gap: 0;
}

.so-rows .so-panels--gap-spaced {
	gap: var(--so-gap);
}

.so-panel {
	position: relative;
	display: grid;
	grid-template: minmax(0, 1fr) / minmax(0, 1fr);
	min-width: 0;
	min-height: 16rem;
	padding: clamp(1.75rem, 1rem + 2.5vw, 3.5rem);
	background-color: var(--so-bg);
	color: var(--so-ink);
	text-decoration: none;
	isolation: isolate;
}


.so-panel__inner {
	position: relative;
	grid-area: 1 / 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--so-flow);
}

.so-panels--v-top .so-panel__inner .so-btns { margin-top: auto; padding-top: 0.5rem; }
.so-panels--v-middle .so-panel__inner { justify-content: center; }
.so-panels--v-bottom .so-panel__inner { justify-content: flex-end; }

.so-rows .so-panel .so-btn {
	font-size: max(1.1rem, var(--so-text));
}

.so-rows .so-panel__text {
	margin: 0;
}

.so-panel__icon img {
	display: block;
	width: auto;
	max-width: 10rem;
	height: auto;
	max-height: 4rem;
}

.so-panel__bg {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
}

.so-panel__bg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s;
}

.so-panel__bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.5));
}

.so-panel--link:hover .so-panel__bg img {
	transform: scale(1.05);
}

@media (min-width: 600px) {
	/* Spacer sets the minimum shape so panels in a row still stretch to match. */
	.so-panels--h-square .so-panel::before,
	.so-panels--h-tall .so-panel::before {
		content: "";
		grid-area: 1 / 1;
		aspect-ratio: 1 / 1;
	}

	.so-panels--h-tall .so-panel::before {
		aspect-ratio: 3 / 4;
	}

	.so-rows .so-panels--cols-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 768px) {
	.so-rows .so-panels {
		grid-template-columns: repeat(var(--so-cols, 3), minmax(0, 1fr));
	}

	.so-rows .so-panels--cols-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ---------- Tile grid ---------- */
.so-rows .so-tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-items: stretch;
	gap: 0;
}

.so-rows .so-tiles--gap-spaced {
	gap: var(--so-gap);
}

.so-tile {
	position: relative;
	display: grid;
	place-items: center;
	/* Safari won't stretch aspect-ratio grid items by default. */
	justify-self: stretch;
	width: 100%;
	min-width: 0;
	aspect-ratio: 1 / 1;
	padding: 8%;
	overflow: hidden;
	background-color: var(--so-bg);
	color: var(--so-ink);
	text-align: center;
	text-decoration: none;
	container-type: inline-size;
}

.so-tiles--landscape .so-tile {
	aspect-ratio: 4 / 3;
}

.so-rows .so-tile .so-title {
	font-size: clamp(1.2rem, 19cqi, 4rem);
}

.so-tile--fill img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s;
}

.so-tile--fit {
	padding: 6%;
}

.so-tile--fit img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform 0.6s;
}

.so-tile--logo img {
	width: auto;
	max-width: 72%;
	height: auto;
	max-height: 55%;
	object-fit: contain;
}

a.so-tile--fill:hover img,
a.so-tile--fit:hover img {
	transform: scale(1.05);
}

a.so-tile--heading,
a.so-tile--logo {
	transition: filter 0.3s;
}

a.so-tile--heading:hover,
a.so-tile--logo:hover {
	filter: brightness(1.12);
}

@media (min-width: 768px) {
	.so-rows .so-tiles {
		grid-template-columns: repeat(var(--so-cols, 4), minmax(0, 1fr));
	}

	.so-rows .so-tiles--cols-6 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.so-rows .so-tiles--cols-6 {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

/* ---------- Counter stats ---------- */
.so-rows .so-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--so-gap-l) var(--so-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.so-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	text-align: center;
}

.so-stat__num {
	/* Scaled down in PHP when a row has long figures. */
	min-height: 0.9em;
	font-size: calc(clamp(2.8rem, 1.6rem + 4vw, 5.6rem) * var(--so-stat-scale, 1));
	font-weight: 700;
	letter-spacing: -0.05em;
	line-height: 0.9;
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

.so-stat__label {
	max-width: 16em;
}

.so-rows .so-stats--tiles {
	gap: 0;
}

.so-stats--tiles .so-stat {
	justify-content: center;
	justify-self: stretch;
	width: 100%;
	min-width: 0;
	aspect-ratio: 1 / 1;
	padding: 1rem;
	background-color: var(--so-bg);
	color: var(--so-ink);
	container-type: inline-size;
}

.so-stats--tiles .so-stat__num {
	font-size: calc(clamp(2.4rem, 22cqi, 6rem) * var(--so-stat-scale, 1));
}

@media (min-width: 768px) {
	.so-rows .so-stats {
		grid-template-columns: repeat(var(--so-cols, 4), minmax(0, 1fr));
	}
}

/* ---------- Featured case studies ---------- */
.so-cases {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--so-gap);
}

.so-rows .so-case {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	color: inherit;
	text-decoration: none;
}

.so-case__card {
	position: relative;
	display: grid;
	place-items: center;
	aspect-ratio: 13 / 12;
	overflow: hidden;
	border-radius: 20px;
	background-color: #9397cb;
}

/* Portfolio page colour rotation (shows when a project has no image). */
.so-case--1 .so-case__card { background-color: #7ac24e; }
.so-case--2 .so-case__card { background-color: #00a5ce; }
.so-case--3 .so-case__card { background-color: #250188; }
.so-case--4 .so-case__card { background-color: #ee2e24; }
.so-case--5 .so-case__card { background-color: #7ac24e; }
.so-case--6 .so-case__card { background-color: #ffcc33; }
.so-case--7 .so-case__card { background-color: #0a2434; }

.so-case__image {
	position: absolute;
	inset: 0;
	background-color: #1a1a1a;
}

.so-case__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: blur(5px);
	transform: scale(1.05);
	transition: transform 0.5s, filter 0.5s;
}

.so-case__image::after {
	content: "";
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.66);
	transition: opacity 0.5s;
}

.so-case:hover .so-case__image img,
.so-case:focus-visible .so-case__image img {
	filter: blur(1px);
	transform: scale(1.2);
}

.so-case:hover .so-case__image::after,
.so-case:focus-visible .so-case__image::after {
	opacity: 0.75;
}

.so-rows .so-case:focus-visible {
	outline-offset: 4px;
}

.so-case__brand {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	width: 45%;
	pointer-events: none;
}

.so-rows .so-case__tags {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	/* Wider than the logo area (45% of the card) so a few tags fit on one line. */
	width: max-content;
	max-width: 200%;
}

.so-case__logo {
	display: block;
	width: 100%;
	height: auto;
	max-height: 200px;
	object-fit: contain;
}

.so-case__name {
	color: #fff;
	font-size: clamp(1.4rem, 1rem + 1.2vw, 2.15rem);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1;
	text-align: center;
}

.so-case__title {
	font-size: var(--so-text);
	font-weight: 400;
	line-height: 1.3;
}

@media (min-width: 640px) {
	.so-cases {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.so-cases {
		grid-template-columns: repeat(var(--so-cols, 3), minmax(0, 1fr));
	}
}

/* ---------- Accordion ---------- */
.so-rows .so-accordion {
	--so-acc-speed: 0.45s;
	--so-acc-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

.so-rows .so-accordion__item {
	margin: 0;
	padding: 0;
	border-top: 2px solid currentColor;
}

.so-rows .so-accordion__item:last-child {
	border-bottom: 2px solid currentColor;
}

.so-rows .so-accordion__title {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1em;
	padding: 0.75em 0;
	cursor: pointer;
	list-style: none;
	font-size: 1.2em;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.15;
}

.so-rows .so-accordion__title > span {
	min-width: 0;
	overflow-wrap: anywhere;
	transition: transform var(--so-acc-speed) var(--so-acc-ease);
}

.so-rows .so-accordion__title::-webkit-details-marker {
	display: none;
}

@media (hover: hover) {
	.so-rows .so-accordion__title:hover > span {
		transform: translateX(0.5em);
	}
}

.so-rows .so-accordion__title:focus-visible > span {
	transform: translateX(0.5em);
}

.so-rows .so-accordion__title:focus-visible {
	outline: 3px solid var(--so-yellow);
	outline-offset: 3px;
}

.so-rows .so-bg-yellow .so-accordion__title:focus-visible,
.so-rows .so-bg-light-yellow .so-accordion__title:focus-visible {
	outline-color: #000;
}

/* Plus that turns into a minus. Centred on the first line of the title. */
.so-rows .so-accordion__icon {
	position: relative;
	flex: none;
	width: 0.75em;
	height: 0.75em;
	margin-top: 0.2em;
}

.so-rows .so-accordion__icon::before,
.so-rows .so-accordion__icon::after {
	content: "";
	position: absolute;
	top: calc(50% - 1.5px);
	left: 0;
	width: 100%;
	height: 3px;
	background: currentColor;
}

.so-rows .so-accordion__icon::after {
	transform: rotate(90deg);
	transition: transform var(--so-acc-speed) var(--so-acc-ease);
}

.so-rows .so-accordion__item[open]:not(.so-accordion__item--closing) .so-accordion__icon::after {
	transform: rotate(0deg);
}

.so-rows .so-accordion__content {
	display: flex;
	flex-direction: column;
	gap: var(--so-flow);
	max-width: 50rem;
	padding-bottom: 1.5em;
}

/* ---------- Forms (Fluent Forms shortcodes in rich text) ---------- */
/* The child theme styles forms for light backgrounds; adjust for the row colour. */
.so-rows .so-text-light .fluentform .ff-el-input--label label,
.so-rows .so-text-light .fluentform .ff-el-form-check-label,
.so-rows .so-text-light .fluentform .ff-el-help-message {
	color: inherit;
}

.so-rows .so-text-light .fluentform .ff-el-group .ff-btn.ff-btn-submit {
	background: #fff;
	color: #000;
}

.so-rows .so-text-light .fluentform .ff-el-group .ff-btn.ff-btn-submit:hover {
	background: var(--so-yellow);
	color: #000;
}

.so-rows .so-bg-yellow .fluentform .ff-el-group .ff-btn.ff-btn-submit:hover,
.so-rows .so-bg-light-yellow .fluentform .ff-el-group .ff-btn.ff-btn-submit:hover {
	background: #fff;
	color: #000;
}

/* ---------- Smooth scrolling to anchors (this stylesheet only loads on SO Content Rows pages) ---------- */
@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* ---------- Site header over a dark first row ---------- */
body.so-rows-light-header #brx-header .header-logo,
body.so-rows-light-header #brx-header .header-logo img {
	filter: brightness(1);
}

body.so-rows-light-header #brx-header .header-logo img:hover {
	filter: brightness(1) invert(31%) sepia(100%) saturate(530%) hue-rotate(0deg) contrast(101%);
}

body.so-rows-light-header #brx-header .logo-text {
	color: #fff;
}

body.so-rows-light-header #brx-header .bricks-mobile-menu-toggle .bar-top,
body.so-rows-light-header #brx-header .bricks-mobile-menu-toggle .bar-center,
body.so-rows-light-header #brx-header .bricks-mobile-menu-toggle .bar-bottom {
	background-color: #fff;
}

/* ---------- Password-protected page form ---------- */
.so-rows .post-password-form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	max-width: 32rem;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.so-rows *,
	.so-rows *::after {
		transition: none !important;
	}
}
