/* Services Showcase
   Every rule is scoped under .spark-ss, so nothing here affects the rest of the site.
   See README.md in this folder for what each class/variable controls. */

/* ==========================================================================
   1. BASE: quick settings (colours, sizes, fonts)
   ========================================================================== */
.spark-ss {
	--ss-accent: var(--e-global-color-primary, #FFC300);
	--ss-heading: var(--e-global-color-text, #1A1919);
	--ss-text: #6B6A68;
	--ss-muted: #8C8A86;
	--ss-what: #C9891A;
	--ss-card-bg: #FFFFFF;
	--ss-card-border: #F8E7B0;
	--ss-divider: #F4EBCB;
	--ss-item-active-bg: #FEF6DF;
	--ss-item-active-border: #F5C542;
	--ss-tile-bg: #FDF4E0;
	--ss-tile-border: #F4D58A;
	--ss-tile-active-bg: #F5C542;
	--ss-icon: #D4A514;
	--ss-icon-active: #1A1919;
	--ss-rail: #ECECE9;
	--ss-button-bg: #F5C542;
	--ss-button-text: #1A1919;
	--ss-radius: 40px;
	--ss-item-h: 58px;
	--ss-item-gap: 7px;
	--ss-tile: 40px;
	--ss-main-pad: 57px;
	--ss-heading-font: var(--e-global-typography-secondary-font-family, "Cooper Light BT"), "Cooper Lt BT", Georgia, "Times New Roman", serif;
	--ss-body-font: var(--e-global-typography-text-font-family, "SF Pro Display"), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

	box-sizing: border-box;
	padding: 72px 0 80px;
	color: var(--ss-text);
	font-family: var(--ss-body-font);
}

.spark-ss *,
.spark-ss *::before,
.spark-ss *::after {
	box-sizing: border-box;
}

.spark-ss [hidden] {
	display: none !important;
}

.spark-ss .spark-ss__heading,
.spark-ss .spark-ss__sub,
.spark-ss .spark-ss__title,
.spark-ss .spark-ss__text,
.spark-ss .spark-ss__name {
	overflow-wrap: break-word;
}

/* No side padding on any device: the Elementor container around the widget provides the
   same side spacing as the site header, so the section lines up with the header. */
.spark-ss__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0;
}

/* Text that exists in a desktop and a mobile version (only when the mobile one is filled in). */
.spark-ss .spark-ss--mobile {
	display: none;
}

/* ==========================================================================
   2. HEADER
   ========================================================================== */
.spark-ss__header {
	text-align: center;
}

.spark-ss .spark-ss__label {
	display: inline-block;
	margin: 0 0 18px;
	padding: 7px 20px;
	border: 1px solid #E8E8E5;
	border-radius: 999px;
	background: #FFFFFF;
	color: var(--ss-heading);
	font-family: var(--ss-body-font);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
}

.spark-ss .spark-ss__heading {
	margin: 0;
	padding: 0;
	color: var(--ss-heading);
	font-family: var(--ss-heading-font);
	font-size: 36px;
	font-style: normal;
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: 0;
}

.spark-ss .spark-ss__sub {
	max-width: 800px;
	margin: 18px auto 0;
	padding: 0;
	color: var(--ss-text);
	font-family: var(--ss-body-font);
	font-size: 18px;
	font-weight: 400;
	line-height: 1.4;
}

/* ==========================================================================
   3. THE CARD: list on the left, the service on the right
   ========================================================================== */
.spark-ss__card {
	display: grid;
	/* 32.9% of the card, but never so narrow that a long service name has to wrap */
	grid-template-columns: max(32.9%, 400px) minmax(0, 1fr);
	margin-top: 48px;
	border: 1px solid var(--ss-card-border);
	border-radius: var(--ss-radius);
	background: var(--ss-card-bg);
	overflow: hidden;
}

/* ---- the list ---- */
.spark-ss__side {
	padding: 40px 12px 40px 40px;
	border-right: 1px solid var(--ss-divider);
}

.spark-ss .spark-ss__choose {
	margin: 0 0 16px;
	padding: 0;
	color: var(--ss-text);
	font-family: var(--ss-body-font);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.3;
}

.spark-ss__listwrap {
	position: relative;
	padding-right: 18px;
}

/* A long list scrolls inside the card; the native scrollbar is hidden, the thin rail beside it shows the position. */
.spark-ss__list {
	max-height: calc(var(--ss-visible) * var(--ss-item-h) + (var(--ss-visible) - 1) * var(--ss-item-gap));
	margin: 0;
	padding: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: none;
	list-style: none;
}

.spark-ss__list::-webkit-scrollbar {
	display: none;
}

.spark-ss__li {
	margin: 0 0 var(--ss-item-gap);
	padding: 0;
	list-style: none;
}

.spark-ss__li:last-child {
	margin-bottom: 0;
}

.spark-ss .spark-ss__item {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-height: var(--ss-item-h);
	margin: 0;
	padding: 0 16px 0 9px;
	border: 1px solid transparent;
	border-radius: 16px;
	background: transparent;
	color: var(--ss-text);
	font-family: var(--ss-body-font);
	text-align: left;
	text-transform: none;
	white-space: normal;
	cursor: pointer;
	transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.spark-ss .spark-ss__item:hover,
.spark-ss .spark-ss__item:focus {
	background: transparent;
	color: var(--ss-heading);
}

.spark-ss .spark-ss__item:focus-visible {
	outline: 2px solid var(--ss-heading);
	outline-offset: 2px;
}

.spark-ss .spark-ss__item.is-active,
.spark-ss .spark-ss__item.is-active:hover,
.spark-ss .spark-ss__item.is-active:focus {
	background: var(--ss-item-active-bg);
	border-color: var(--ss-item-active-border);
	color: var(--ss-heading);
}

/* Icon tile */
.spark-ss__tile {
	display: grid;
	flex: none;
	place-items: center;
	width: var(--ss-tile);
	height: var(--ss-tile);
	border: 1px solid var(--ss-tile-border);
	border-radius: 10px;
	background: var(--ss-tile-bg);
	color: var(--ss-icon);
	font-size: 19px;
	line-height: 1;
	transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.spark-ss__tile svg {
	display: block;
	width: 19px;
	height: 19px;
}

/* Font Awesome icons are single-colour shapes. An uploaded SVG keeps the colours it sets itself; one that
   sets no fill takes the icon colour. */
.spark-ss__tile svg.e-font-icon-svg,
.spark-ss__tile svg:not(.e-font-icon-svg):not([fill]) {
	fill: currentColor;
}

/* An uploaded SVG that already includes the rounded square is shown as it is, at the tile size, on the
   tile colour with the same corner radius as the drawing; the drawing is never clipped. */
.spark-ss__tile--own {
	width: auto;
	height: auto;
	border: 0;
	border-radius: calc(var(--ss-tile) * var(--ss-own-ratio, 0.24));
}

.spark-ss__tile--own svg {
	width: var(--ss-tile);
	height: var(--ss-tile);
	overflow: visible;
}

/* The current service: yellow tile and a dark icon. An uploaded SVG's drawing (not its tile outline)
   is switched to --ss-icon-active whatever colour the file uses. */
.spark-ss__item.is-active .spark-ss__tile {
	border-color: var(--ss-tile-active-bg);
	background: var(--ss-tile-active-bg);
	color: var(--ss-icon-active);
}

.spark-ss__item.is-active .spark-ss__tile svg:not(.e-font-icon-svg) :is(path, circle, line, polyline, polygon, ellipse)[stroke]:not([stroke="none"]) {
	stroke: var(--ss-icon-active);
}

.spark-ss__item.is-active .spark-ss__tile svg:not(.e-font-icon-svg) :is(path, circle, polyline, polygon, ellipse)[fill]:not([fill="none"]) {
	fill: var(--ss-icon-active);
}

.spark-ss .spark-ss__name {
	flex: 1 1 0;
	min-width: 0;
	white-space: normal;
	color: inherit;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.3;
}

.spark-ss .spark-ss__item.is-active .spark-ss__name {
	font-weight: 500;
}

.spark-ss .spark-ss__num {
	flex: none;
	color: var(--ss-muted);
	font-size: 13px;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.spark-ss .spark-ss__arrow {
	display: none;
	flex: none;
	width: 14px;
	height: 14px;
	color: var(--ss-heading);
}

.spark-ss .spark-ss__item.is-active .spark-ss__num {
	display: none;
}

.spark-ss .spark-ss__item.is-active .spark-ss__arrow {
	display: block;
}

/* Scroll rail (only shown when the list is longer than what is visible) */
.spark-ss__rail {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 2px;
	border-radius: 2px;
	background: var(--ss-rail);
}

.spark-ss__thumb {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 50%;
	border-radius: 2px;
	background: var(--ss-accent);
}

.spark-ss:not(.has-scroll) .spark-ss__rail {
	display: none;
}

/* ---- the service ---- */
.spark-ss__main {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	padding: 40px var(--ss-main-pad);
}

/* All services share one cell: the card keeps the height of the longest, so it never jumps. */
.spark-ss__panels {
	display: grid;
}

.spark-ss__panel {
	grid-area: 1 / 1;
	min-width: 0;
	align-self: center;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
}

.spark-ss.is-ready .spark-ss__panel {
	transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
}

.spark-ss__panel.is-active {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.spark-ss.is-ready .spark-ss__panel.is-active {
	transition: opacity 0.35s ease 0.05s, transform 0.35s ease 0.05s, visibility 0s;
}

.spark-ss__top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
}

.spark-ss .spark-ss__what {
	color: var(--ss-what);
	font-family: var(--ss-body-font);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.3;
}

.spark-ss .spark-ss__count {
	color: var(--ss-muted);
	font-family: var(--ss-body-font);
	font-size: 12px;
	font-weight: 400;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.spark-ss .spark-ss__count b {
	color: var(--ss-heading);
	font-weight: 600;
}

.spark-ss .spark-ss__title {
	margin: 20px 0 0;
	padding: 0;
	color: var(--ss-heading);
	font-family: var(--ss-heading-font);
	font-size: 32px;
	font-style: normal;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0;
}

.spark-ss__title-num::after {
	content: ". ";
}

.spark-ss .spark-ss__text {
	margin: 20px 0 0;
	padding: 0;
	color: var(--ss-text);
	font-family: var(--ss-body-font);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.62;
}

.spark-ss .spark-ss__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	margin: 28px 0 0;
	padding: 0 30px;
	border: 0;
	border-radius: 999px;
	background: var(--ss-button-bg);
	color: var(--ss-button-text);
	font-family: var(--ss-body-font);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	transition: filter 0.2s ease;
}

.spark-ss a.spark-ss__button:hover,
.spark-ss a.spark-ss__button:focus-visible {
	background: var(--ss-button-bg);
	color: var(--ss-button-text);
	filter: brightness(0.95);
}

.spark-ss a.spark-ss__button:focus-visible {
	outline: 2px solid var(--ss-button-text);
	outline-offset: 3px;
}

/* Previous / next + progress are for mobile only. */
.spark-ss__controls {
	display: none;
}

/* ==========================================================================
   4. TABLET (768px – 1024px): same layout, tighter
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
	.spark-ss {
		--ss-radius: 32px;
		--ss-main-pad: 36px;
		--ss-tile: 38px;
		--ss-item-h: 56px;
		padding: 64px 0 72px;
	}

	.spark-ss .spark-ss__heading {
		font-size: 30px;
	}

	.spark-ss .spark-ss__sub {
		font-size: 16px;
	}

	.spark-ss__card {
		grid-template-columns: 38% minmax(0, 1fr);
		margin-top: 44px;
	}

	.spark-ss__side {
		padding: 32px 8px 32px 24px;
	}

	.spark-ss .spark-ss__title {
		font-size: 26px;
	}

	.spark-ss .spark-ss__text {
		font-size: 15px;
	}

	.spark-ss .spark-ss__name {
		font-size: 14px;
	}
}

/* ==========================================================================
   5. MOBILE (767px and below): one simple card; previous / next and a progress bar under it
   ========================================================================== */
@media (max-width: 767px) {
	.spark-ss {
		--ss-radius: 28px;
		padding: 48px 0;
	}

	/* The mobile version of a text, when there is one */
	.spark-ss .spark-ss--desktop {
		display: none;
	}

	.spark-ss .spark-ss--mobile {
		display: block;
	}

	/* Header text on mobile: label 12px, heading Cooper 18px / 120%, subheading 12px / 150% */
	.spark-ss .spark-ss__label {
		margin-bottom: 14px;
		padding: 9px 18px;
		font-size: 12px;
		line-height: 1;
	}

	.spark-ss .spark-ss__heading {
		font-size: 18px;
		line-height: 1.2;
	}

	.spark-ss .spark-ss__br {
		display: none;
	}

	.spark-ss .spark-ss__sub {
		margin-top: 12px;
		font-size: 12px;
		line-height: 1.5;
	}

	/* The big card is just a wrapper now; the service panel is the card. */
	.spark-ss__card {
		display: block;
		margin-top: 28px;
		border: 0;
		border-radius: 0;
		background: transparent;
		overflow: visible;
	}

	.spark-ss__side {
		display: none;
	}

	.spark-ss__main {
		display: block;
		padding: 0;
	}

	.spark-ss__panels {
		padding: 24px 24px 28px;
		border: 1px solid var(--ss-card-border);
		border-radius: var(--ss-radius);
		background: var(--ss-card-bg);
	}

	.spark-ss .spark-ss__what {
		font-size: 14px;
	}

	.spark-ss .spark-ss__count {
		font-size: 18px;
	}

	.spark-ss .spark-ss__title {
		margin-top: 18px;
		font-size: 18px;
		line-height: 1.3;
	}

	.spark-ss__title-num::after {
		content: " \2014  ";
	}

	.spark-ss .spark-ss__text {
		margin-top: 16px;
		font-size: 14px;
		line-height: 1.55;
	}

	.spark-ss .spark-ss__button {
		min-height: 44px;
		margin-top: 22px;
		padding: 0 26px;
		font-size: 14px;
	}

	.spark-ss__controls {
		display: grid;
		justify-items: center;
		gap: 20px;
		margin-top: 28px;
	}

	.spark-ss__nav {
		display: flex;
		gap: 12px;
	}

	.spark-ss .spark-ss__btn {
		display: grid;
		place-items: center;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		border: 1px solid var(--ss-item-active-border);
		border-radius: 50%;
		background: #FFFFFF;
		color: var(--ss-heading);
		cursor: pointer;
		transition: border-color 0.2s ease, color 0.2s ease;
	}

	.spark-ss .spark-ss__btn:hover:not(:disabled),
	.spark-ss .spark-ss__btn:focus-visible {
		background: #FFFFFF;
		color: var(--ss-heading);
	}

	.spark-ss .spark-ss__btn:focus-visible {
		outline: 2px solid var(--ss-heading);
		outline-offset: 3px;
	}

	.spark-ss .spark-ss__btn:disabled {
		border-color: var(--ss-card-border);
		color: #A9A8A5;
		cursor: default;
	}

	.spark-ss__progress {
		width: 106px;
		height: 4px;
		border-radius: 999px;
		background: #E6E6E3;
		overflow: hidden;
	}

	.spark-ss__progress-fill {
		display: block;
		width: calc((var(--ss-i) + 1) / var(--ss-n) * 100%);
		height: 100%;
		border-radius: inherit;
		background: var(--ss-accent);
	}

	.spark-ss.is-ready .spark-ss__progress-fill {
		transition: width 0.4s ease;
	}
}

@media (prefers-reduced-motion: reduce) {
	.spark-ss *,
	.spark-ss.is-ready .spark-ss__panel,
	.spark-ss.is-ready .spark-ss__panel.is-active {
		transition: none !important;
	}
}
