/**
 * Front page sections (Customize → Front Page): the Starter design, drawn with the theme's colors,
 * fonts, corner radius and container width.
 */

.sg-fp {
	--sg-fp-space: clamp(64px, 9vw, 104px);
	padding-block: var(--sg-fp-space);
}

/* Two sections on the same background share their spacing. */
.sg-fp--bg-none + .sg-fp--bg-none,
.sg-fp--bg-surface + .sg-fp--bg-surface,
.sg-fp--bg-dark + .sg-fp--bg-dark,
.sg-fp--bg-brand + .sg-fp--bg-brand {
	padding-top: 0;
}

.sg-fp--bg-surface {
	background: var(--sg-color-surface);
}

.sg-fp--bg-dark {
	--sg-color-text: rgba(255, 255, 255, 0.82);
	--sg-color-heading: #fff;
	--sg-color-muted: rgba(255, 255, 255, 0.7);
	background: #12161c;
	color: var(--sg-color-text);
}

.sg-fp--bg-brand {
	--sg-color-text: rgba(255, 255, 255, 0.86);
	--sg-color-heading: #fff;
	--sg-color-muted: rgba(255, 255, 255, 0.75);
	background: var(--sg-color-primary);
	color: var(--sg-color-text);
}

/* Dark and brand backgrounds: light text on the band, the theme's own colors inside the cards that keep a
   white background (saved on the page wrapper before the bands override them). */
.sg-fp-main {
	--sg-fp-ink: var(--sg-color-heading);
	--sg-fp-ink-text: var(--sg-color-text);
	--sg-fp-ink-muted: var(--sg-color-muted);
}

:is(.sg-fp--bg-dark, .sg-fp--bg-brand) :is(.sg-fp-card, .sg-fp-quote) {
	--sg-color-heading: var(--sg-fp-ink);
	--sg-color-text: var(--sg-fp-ink-text);
	--sg-color-muted: var(--sg-fp-ink-muted);
	color: var(--sg-fp-ink-text);
}

:is(.sg-fp--bg-dark, .sg-fp--bg-brand) a:not(.button) {
	color: #fff;
}

:is(.sg-fp--bg-dark, .sg-fp--bg-brand) .sg-fp-stats__number {
	color: #fff;
}

:is(.sg-fp--bg-dark, .sg-fp--bg-brand) :is(.sg-fp-stats, .sg-fp-faq, .sg-fp-faq__item) {
	border-color: rgba(255, 255, 255, 0.2);
}

:is(.sg-fp--bg-dark, .sg-fp--bg-brand) .sg-fp-steps__item::before {
	background: #fff;
	color: var(--sg-color-primary);
}

:is(.sg-fp--bg-dark, .sg-fp--bg-brand) .sg-fp-steps__item:not(:last-child)::after {
	border-top-color: rgba(255, 255, 255, 0.25);
}

.sg-fp--bg-brand :is(.sg-fp__checks .sg-icon, .sg-fp-faq__question .sg-icon) {
	color: #fff;
}

/* Heading: line above, title, intro */
.sg-fp__head {
	max-width: 720px;
	margin: 0 auto clamp(32px, 5vw, 56px);
	text-align: center;
}

.sg-fp__head--left {
	margin-inline: 0;
	text-align: start;
}

.sg-fp__eyebrow {
	margin: 0 0 12px;
	color: var(--sg-color-accent);
	font-family: var(--sg-font-accent);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.4;
	text-transform: uppercase;
}

.sg-fp--bg-brand .sg-fp__eyebrow,
.sg-fp--bg-dark .sg-fp__eyebrow {
	color: inherit;
}

.sg-fp__title {
	margin: 0;
	color: var(--sg-color-heading);
	font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.65rem);
	line-height: 1.15;
	text-wrap: balance; /* No heading ends with one word alone on its last line. */
}

.sg-fp--hero .sg-fp__title {
	font-size: clamp(2.35rem, 1.3rem + 3.6vw, 3.5rem);
	line-height: 1.08;
}

.sg-fp__accent {
	color: var(--sg-color-accent);
}

.sg-fp--bg-brand .sg-fp__accent {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.12em;
}

.sg-fp__intro {
	margin: 16px 0 0;
	color: var(--sg-color-muted);
	font-size: 1.1rem;
	line-height: 1.65;
	text-wrap: pretty;
}

.sg-fp--hero .sg-fp__intro {
	font-size: 1.2rem;
}

/* Buttons */
.sg-fp__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 32px;
}

.sg-fp__buttons--center {
	justify-content: center;
	margin-top: 40px;
}

body a.sg-fp__button--outline,
body a.sg-fp__button--outline:focus {
	box-shadow: inset 0 0 0 2px currentColor;
	background: transparent;
	color: var(--sg-color-primary);
}

body a.sg-fp__button--outline:hover {
	background: var(--sg-color-primary);
	color: #fff;
	box-shadow: inset 0 0 0 2px var(--sg-color-primary);
}

.sg-fp--bg-brand a.sg-fp__button,
.sg-fp--bg-dark a.sg-fp__button {
	background: #fff;
	color: var(--sg-color-primary);
}

.sg-fp--bg-brand a.sg-fp__button:hover,
.sg-fp--bg-dark a.sg-fp__button:hover {
	background: var(--sg-color-accent);
	color: #fff;
}

.sg-fp--bg-brand a.sg-fp__button--outline,
.sg-fp--bg-dark a.sg-fp__button--outline,
.sg-fp--bg-brand a.sg-fp__button--outline:focus,
.sg-fp--bg-dark a.sg-fp__button--outline:focus {
	background: transparent;
	color: #fff;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.sg-fp--bg-brand a.sg-fp__button--outline:hover,
.sg-fp--bg-dark a.sg-fp__button--outline:hover {
	background: #fff;
	color: var(--sg-color-primary);
	box-shadow: inset 0 0 0 2px #fff;
}

/* Checklist */
.sg-fp__checks {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 24px;
	margin: 28px 0 0;
	padding: 0;
	list-style: none;
}

.sg-fp--about .sg-fp__checks {
	flex-direction: column;
}

.sg-fp__checks li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	color: var(--sg-color-heading);
	font-weight: 500;
}

.sg-fp__checks .sg-icon {
	flex: none;
	margin-top: 0.2em;
	color: var(--sg-color-accent);
}

/* Images: rounded rectangles */
.sg-fp__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: calc(var(--sg-radius) * 2);
	object-fit: cover;
}

/* Hero */
.sg-fp-hero {
	display: grid;
	grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
	gap: clamp(32px, 6vw, 72px);
	align-items: center;
}

.sg-fp-hero--left .sg-fp-hero__media {
	order: -1;
}

.sg-fp-hero--center {
	grid-template-columns: minmax(0, 1fr);
	max-width: 820px;
	margin-inline: auto;
	text-align: center;
}

.sg-fp-hero--center .sg-fp__buttons,
.sg-fp-hero--center .sg-fp__checks {
	justify-content: center;
}

.sg-fp-hero .sg-fp__head {
	margin: 0;
	max-width: none;
}

.sg-fp-hero__image {
	aspect-ratio: 9 / 8;
}

/* Service cards */
.sg-fp-cards {
	display: grid;
	grid-template-columns: repeat(var(--sg-fp-cols, 3), minmax(0, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sg-fp-card {
	margin: 0;
	padding: 32px;
	border: 1px solid var(--sg-color-line);
	border-radius: calc(var(--sg-radius) * 1.5);
	background: var(--sg-color-bg);
}

.sg-fp-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-bottom: 20px;
	border-radius: var(--sg-radius);
	background: color-mix(in srgb, var(--sg-color-primary) 9%, transparent);
	color: var(--sg-color-primary);
}

.sg-fp-card__title {
	margin: 0 0 8px;
	font-size: 1.25rem;
}

.sg-fp-card__text {
	margin: 0;
	color: var(--sg-color-muted);
}

/* About: image and text */
.sg-fp-split {
	display: grid;
	grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
	gap: clamp(32px, 6vw, 80px);
	align-items: center;
}

/* No image: the full page width, centred like the other sections; the heading and intro use it too. */
.sg-fp-split--text {
	grid-template-columns: minmax(0, 1fr);
	text-align: center;
}

.sg-fp-split .sg-fp__head {
	margin-bottom: 0;
}

.sg-fp-split--text .sg-fp__head {
	max-width: none;
	margin-inline: auto;
	text-align: center;
}

/* The checklist points side by side in a centred row (a list again on phones). */
.sg-fp--about .sg-fp-split--text .sg-fp__checks {
	flex-direction: row;
	justify-content: center;
	gap: 12px 40px;
	text-align: start;
}

/* The numbers share the full width; one left over on a narrow screen sits centred. */
.sg-fp-split--text .sg-fp-stats {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.sg-fp-split--text .sg-fp-stats__item {
	flex: 1 1 120px;
	align-items: center;
}

.sg-fp-split__media .sg-fp__image {
	aspect-ratio: 4 / 5;
}

.sg-fp-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 24px;
	margin: 36px 0 0;
	padding-top: 28px;
	border-top: 1px solid var(--sg-color-line);
}

.sg-fp-stats__item {
	display: flex;
	flex-direction: column-reverse;
}

.sg-fp-stats__number {
	margin: 0;
	color: var(--sg-color-primary);
	font-family: var(--sg-font-heading);
	font-size: clamp(2rem, 1.4rem + 1.8vw, 2.75rem);
	font-weight: var(--sg-font-heading-weight, 700);
	line-height: 1.1;
}

.sg-fp-stats__label {
	margin-top: 4px;
	color: var(--sg-color-muted);
	font-size: 0.95rem;
}

/* Process steps */
.sg-fp-steps {
	display: grid;
	grid-template-columns: repeat(var(--sg-fp-cols, 3), minmax(0, 1fr));
	gap: 32px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: sg-fp-step;
}

/* Each step is centred: number on top, title and text under it. */
.sg-fp-steps__item {
	position: relative;
	margin: 0;
	padding-top: 72px;
	counter-increment: sg-fp-step;
	text-align: center;
}

.sg-fp-steps__item::before {
	content: counter(sg-fp-step, decimal-leading-zero);
	position: absolute;
	top: 0;
	left: calc(50% - 26px);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--sg-color-primary);
	color: #fff;
	font-family: var(--sg-font-accent);
	font-weight: 700;
}

/* Dashed line from this number to the next one, 12px clear of each circle (the gap between steps is
   32px, the circles 52px). */
.sg-fp-steps__item:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 26px;
	left: calc(50% + 38px);
	right: calc(6px - 50%);
	border-top: 2px dashed var(--sg-color-line);
}

/* Right-to-left languages: the next step is on the left. */
[dir="rtl"] .sg-fp-steps__item:not(:last-child)::after {
	right: calc(50% + 38px);
	left: calc(6px - 50%);
}

.sg-fp-steps__title {
	margin: 0 0 8px;
	font-size: 1.25rem;
}

.sg-fp-steps__text {
	max-width: 36ch;
	margin: 0 auto;
	color: var(--sg-color-muted);
}

/* Testimonials */
.sg-fp-quotes {
	display: grid;
	grid-template-columns: repeat(var(--sg-fp-cols, 3), minmax(0, 1fr));
	gap: 24px;
}

.sg-fp-quote {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 32px;
	border-radius: calc(var(--sg-radius) * 1.5);
	background: var(--sg-color-bg);
	box-shadow: 0 1px 2px rgba(18, 22, 28, 0.06);
}

.sg-fp-quote__mark {
	color: var(--sg-color-accent);
}

.sg-fp-quote__text {
	flex: 1;
	margin: 16px 0 24px;
	padding: 0;
	border: 0;
	color: var(--sg-color-heading);
	font-size: 1.05rem;
	line-height: 1.65;
}

.sg-fp-quote__text p {
	margin: 0;
}

.sg-fp-quote__by {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.sg-fp-quote__by strong {
	color: var(--sg-color-heading);
}

.sg-fp-quote__by span {
	color: var(--sg-color-muted);
	font-size: 0.92rem;
}

/* Latest posts: centred heading, the cards, then the link to every article centred under them. */
.sg-fp-posts__more {
	margin-top: clamp(32px, 5vw, 48px);
	text-align: center;
}

/* Questions */
.sg-fp-faq {
	max-width: 820px;
	margin-inline: auto;
	border-top: 1px solid var(--sg-color-line);
}

.sg-fp-faq__item {
	border-bottom: 1px solid var(--sg-color-line);
}

.sg-fp-faq__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 0;
	color: var(--sg-color-heading);
	font-family: var(--sg-font-heading);
	font-size: 1.15rem;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}

.sg-fp-faq__question::-webkit-details-marker {
	display: none;
}

.sg-fp-faq__question .sg-icon {
	flex: none;
	color: var(--sg-color-accent);
	transition: transform 0.2s;
}

.sg-fp-faq__item[open] .sg-fp-faq__question .sg-icon {
	transform: rotate(45deg);
}

.sg-fp-faq__answer {
	padding-bottom: 20px;
	color: var(--sg-color-muted);
}

.sg-fp-faq__answer > :last-child {
	margin-bottom: 0;
}

/* Contact: heading, the contact details in a centred row, then the button, all in the middle. */
.sg-fp-contact {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
	text-align: center;
}

.sg-fp-contact .sg-fp__head {
	margin-bottom: 0;
}

.sg-fp-contact__details {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
}

.sg-fp-contact__details .sg-contact {
	justify-content: center;
	gap: 8px 32px;
	font-size: 1.05rem;
}

/* Each detail stays whole: the row wraps between items, not inside one. */
.sg-fp-contact__details .sg-contact__item {
	flex: 0 0 auto;
	max-width: 100%;
}

/* Call to action: title, text and button stacked in the middle. */
.sg-fp-cta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
	text-align: center;
}

.sg-fp-cta__text {
	max-width: 720px;
}

.sg-fp-cta .sg-fp__title {
	font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.4rem);
}

.sg-fp-cta .sg-fp__intro {
	margin-top: 12px;
}

/* Page content between sections */
.sg-fp--content {
	padding-block: var(--sg-fp-space);
}

@media (max-width: 1023px) {
	.sg-fp-cards,
	.sg-fp-quotes {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* One step under another, still centred. */
	.sg-fp-steps {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
	}

	.sg-fp-steps__item:not(:last-child)::after {
		display: none;
	}
}

/* Two columns: a card left over at the end sits centred under the others, not alone on the left. */
@media (min-width: 768px) and (max-width: 1023px) {
	.sg-fp-cards > :last-child:nth-child(odd),
	.sg-fp-quotes > :last-child:nth-child(odd) {
		grid-column: 1 / -1;
		justify-self: center;
		width: calc((100% - 24px) / 2);
	}
}

@media (max-width: 767px) {
	.sg-fp-hero,
	.sg-fp-split,
	.sg-fp-cards,
	.sg-fp-quotes {
		grid-template-columns: minmax(0, 1fr);
	}

	.sg-fp-hero--left .sg-fp-hero__media {
		order: 0;
	}

	/* Centred checklists (About without an image, the centred hero): a centred list, ticks lined up. */
	.sg-fp--about .sg-fp-split--text .sg-fp__checks,
	.sg-fp-hero--center .sg-fp__checks {
		flex-direction: column;
		width: fit-content;
		max-width: 100%;
		margin-inline: auto;
		text-align: start;
	}

	.sg-fp-card,
	.sg-fp-quote {
		padding: 24px;
	}
}
