/* Systical — Service Detail (one service, its own accordion, an image beside) */

.sys-sd {
	--sd-accent: #9afd0d;
	--sd-max: 1400px;
	--sd-gap: 80px;
	--sd-radius: 18px;
	--sd-rule: #e4e4e4;
	--sd-speed: 320ms;
	--sd-ease: cubic-bezier(0.22, 1, 0.36, 1);
	padding: 90px 40px;
	background-color: #fff;
}

.sys-sd__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: center;
	gap: var(--sd-gap);
	max-width: var(--sd-max);
	margin: 0 auto;
}

/* Order rather than direction, so the copy stays first in the document however
   the columns are arranged visually. */
.sys-sd--flip .sys-sd__copy {
	order: 2;
}

.sys-sd__copy {
	min-width: 0;
}

.sys-sd__title {
	margin: 0;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: clamp(30px, 3.4vw, 48px);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.028em;
	color: #0b0b0b;
}

.sys-sd__intro {
	max-width: 52ch;
	margin: 16px 0 0;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 16.5px;
	line-height: 1.65;
	color: #4a4a4a;
}

/* ---------- accordion ---------- */

.sys-sd__list {
	margin-top: 30px;
}

.sys-sd__item {
	border-bottom: 1px solid var(--sd-rule);
}

.sys-sd__q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	width: 100%;
	padding: 20px 0;
	border: 0;
	background: none;
	color: #0b0b0b;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	text-align: left;
	cursor: pointer;
	/* Hello Elementor's reset sets nowrap on every button, which would stop a
	   long heading wrapping and push it off a phone. */
	white-space: normal;
	-webkit-appearance: none;
	appearance: none;
}

/* Restated because that same reset paints `button:hover` pink, and the base
   rule leaves the hover background unset. */
.sys-sd__q:hover,
.sys-sd__q:focus {
	background: none;
	color: #0b0b0b;
}

.sys-sd__q:focus-visible {
	outline: 2px solid var(--sd-accent);
	outline-offset: -2px;
}

.sys-sd__q-text {
	min-width: 0;
	flex: 1 1 auto;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: -0.01em;
}

/* Circled plus, drawn rather than shipped as an icon so it inherits colour. */
.sys-sd__icon {
	position: relative;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border: 1px solid #b9b9b9;
	border-radius: 50%;
	transition: border-color var(--sd-speed) ease;
}

.sys-sd__icon::before,
.sys-sd__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 10px;
	height: 1.6px;
	border-radius: 2px;
	background-color: #0b0b0b;
	transform: translate(-50%, -50%);
	transition: transform var(--sd-speed) var(--sd-ease);
}

/* The upright bar is the one that rotates away, turning the plus into a minus. */
.sys-sd__icon::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

.sys-sd__item.is-open .sys-sd__icon {
	border-color: var(--sd-accent);
}

.sys-sd__item.is-open .sys-sd__icon::after {
	transform: translate(-50%, -50%) rotate(0deg);
}

/* Height is animated with grid-template-rows, so nothing has to be measured in
   JS and the panel can size itself to whatever copy it holds. */
.sys-sd__a {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows var(--sd-speed) var(--sd-ease);
}

.sys-sd__item.is-open .sys-sd__a {
	grid-template-rows: 1fr;
}

.sys-sd__a-in {
	overflow: hidden;
}

.sys-sd__a p {
	max-width: 56ch;
	margin: 0;
	padding: 0 0 20px;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 15.5px;
	line-height: 1.65;
	color: #5a5c60;
}

/* ---------- button ---------- */

.sys-sd__btn {
	display: inline-flex;
	align-items: center;
	margin-top: 34px;
	padding: 17px 30px;
	border-radius: 999px;
	background-color: var(--sd-accent);
	color: #070707;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 15.5px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	transition: background-color 220ms ease;
}

.sys-sd__btn:hover,
.sys-sd__btn:focus-visible {
	background-color: #0b0b0b;
	color: #fff;
}

/* ---------- media ---------- */

.sys-sd__media {
	overflow: hidden;
	border-radius: var(--sd-radius);
	background-color: #f1f1f1;
}

/* Two classes deep: Elementor's `.elementor img { height: auto }` is (0,1,1)
   and would beat a single-class rule. */
.sys-sd .sys-sd__img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 380px;
	max-height: 560px;
	object-fit: cover;
}

.sys-sd__img--empty {
	background: linear-gradient(135deg, #f4f4f4 0%, #e6e6e6 100%);
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
	.sys-sd {
		--sd-gap: 40px;
	}

	.sys-sd .sys-sd__img {
		min-height: 300px;
	}
}

@media (max-width: 767px) {
	.sys-sd {
		padding: 48px 18px;
	}

	.sys-sd__inner {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Stacked, the copy leads regardless of the desktop order. */
	.sys-sd--flip .sys-sd__copy {
		order: 0;
	}

	/* The image reads as a header for the block once stacked, so it goes on top. */
	.sys-sd__media {
		order: -1;
		margin-bottom: 26px;
	}

	.sys-sd .sys-sd__img {
		min-height: 0;
		max-height: none;
		aspect-ratio: 16 / 10;
	}

	.sys-sd__title {
		font-size: clamp(26px, 7.5vw, 34px);
	}

	.sys-sd__intro {
		font-size: 15px;
	}

	.sys-sd__q-text {
		font-size: 16px;
	}

	.sys-sd__q {
		padding: 16px 0;
	}

	.sys-sd__btn {
		margin-top: 26px;
		padding: 15px 26px;
		font-size: 15px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sys-sd__a,
	.sys-sd__icon,
	.sys-sd__icon::before,
	.sys-sd__icon::after {
		transition: none;
	}
}
