/*
 * Home page (Figma «Головна» 16:2903 desktop, 16:1283 mobile), pattern bti-child/home.
 * Sections: 40 px vertical padding on phones, 88 px from 1024 px; a heading is followed
 * by 20 / 32 px. Backgrounds: paper, the wizard graphite, reviews sheet.
 */

.home-section {
	padding-block: 40px;
}

:where(.home-section) h2 {
	margin: 0 0 20px;
}

:where(.home-section) p {
	margin: 0;
}

/* Sections that follow a section on the same paper start closer (as in Figma). */
.home-steps,
.home-articles {
	padding-top: var(--space-4);
}

/* ---------- Hero ---------- */
.home-hero {
	padding-top: 28px;
	padding-bottom: var(--space-6);
}

.home-hero__inner {
	display: flex;
	flex-direction: column;
	gap: var(--space-5);
}

.home-hero__text {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}

.home-hero__text > * {
	margin: 0;
}

.home-hero__title {
	margin: 0;
}

.home-hero__lead {
	color: var(--c-graphite-soft);
}

.home-stats {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3) 20px;
	padding-top: var(--space-2);
}

.home-stats__item {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.home-stats__value {
	font-family: var(--font-measure);
	word-spacing: var(--ws-measure);
	font-size: var(--fs-measure-l);
	font-weight: 500;
	line-height: var(--lh-measure-l);
}

.home-stats__label {
	color: var(--c-graphite-soft);
	font-family: var(--font-measure);
	word-spacing: var(--ws-measure);
	font-size: var(--fs-measure-s);
	line-height: var(--lh-measure-s);
}

/* ---------- Document wizard (until stage G: the order form) ---------- */
.home-wizard {
	background: var(--c-graphite);
	color: var(--c-sheet);
}

.home-wizard__inner {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.home-wizard__intro h2 {
	margin-bottom: var(--space-3);
	color: var(--c-sheet);
}

.home-wizard__intro p {
	color: var(--c-hatch);
}

.home-wizard__form {
	scroll-margin-top: var(--space-4);
	color: var(--c-graphite);
}

/* The form card takes the whole right column (Figma 676 px). */
.home-wizard__form .bti-order-form {
	max-width: none;
}

/* ---------- Services ---------- */
.home-services .bti-services-grid {
	margin: 0;
	row-gap: var(--space-3);
}

/* ---------- Steps ---------- */
.home-steps .bti-steps {
	margin: 0;
}

/* ---------- Reviews ---------- */
.home-reviews {
	background: var(--c-sheet);
}

.home-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px var(--space-5);
	margin-bottom: 20px;
}

.home-head h2 {
	margin: 0;
}

.home-reviews__rating {
	font-family: var(--font-measure);
	word-spacing: var(--ws-measure);
	font-size: var(--fs-measure-l);
	font-weight: 500;
	line-height: var(--lh-measure-l);
}

.home-reviews__list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-5);
}

.home-reviews .bti-review {
	background: var(--c-paper);
}

/* ---------- FAQ ---------- */
.home-faq__inner {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}

.home-faq__intro h2 {
	margin-bottom: var(--space-3);
}

.home-faq__note {
	color: var(--c-graphite-soft);
	font-size: var(--fs-small);
	line-height: var(--lh-small);
}

.home-faq .bti-faq {
	margin: 0;
}

/* ---------- Articles: heading, cards, «Усі статті» (below on phones, top right on desktop) ---------- */
.home-articles__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "head" "list" "all";
	gap: 20px;
}

.home-articles__inner > h2 {
	grid-area: head;
	margin: 0;
}

.home-articles__query {
	grid-area: list;
}

.home-articles__query .bti-card-grid {
	margin: 0;
}

.home-articles__all {
	grid-area: all;
	margin: 0;
}

.home-articles__all .wp-block-button {
	width: 100%;
}

.home-articles__all .wp-block-button__link {
	width: 100%;
}

/* ---------- Find us: the bti/find-us parts join the section grid next to the heading ---------- */
.home-find__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 14px;
}

.home-find__inner > h2 {
	margin: 0;
}

.home-find .bti-find-us {
	display: contents;
}

.home-find .bti-map {
	margin-top: 6px;
}

/* Phones: two reviews and two article cards, as in the mobile frame (16:1283). */
@media (max-width: 767.98px) {
	.home-reviews__list > .bti-review:nth-child(n+3),
	.home-articles__query .bti-card-grid > li:nth-child(n+3) {
		display: none;
	}
}

/* ---------- Tablet ---------- */
@media (min-width: 768px) {
	.home-services .bti-services-grid {
		row-gap: var(--space-5);
	}

	.home-reviews__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.home-articles__inner {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "head all" "list list";
		align-items: end;
		row-gap: var(--space-6);
	}

	.home-articles__all .wp-block-button,
	.home-articles__all .wp-block-button__link {
		width: auto;
	}

	/* Desktop look of the link: the Text button. */
	.home-articles__all .wp-block-button.is-style-outline > .wp-block-button__link {
		padding-inline: 0;
		border-color: transparent;
		background: transparent;
		color: var(--c-ink);
	}

	.home-articles__all .wp-block-button.is-style-outline > .wp-block-button__link:hover {
		color: var(--c-ink-hover);
		text-decoration: underline;
		text-underline-offset: 0.18em;
	}
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
	.home-section {
		padding-block: 88px;
	}

	:where(.home-section) h2 {
		margin-bottom: var(--space-6);
	}

	.home-steps,
	.home-articles {
		padding-top: var(--space-5);
	}

	.home-hero {
		padding-block: 72px;
	}

	.home-hero__inner {
		flex-direction: row;
		align-items: center;
		gap: var(--space-8);
	}

	.home-hero__text {
		flex: 0 1 560px;
		gap: var(--space-5);
	}

	.home-stats {
		column-gap: var(--space-6);
	}

	.home-hero__photo {
		flex: 1 1 576px;
		height: 520px;
	}

	.home-wizard__inner {
		flex-direction: row;
		align-items: flex-start;
		gap: var(--space-8);
	}

	.home-wizard__intro {
		flex: 0 0 460px;
	}

	.home-wizard__form {
		flex: 1 1 auto;
		min-width: 0;
	}

	.home-head {
		margin-bottom: var(--space-6);
	}

	.home-reviews__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.home-faq__inner {
		flex-direction: row;
		align-items: flex-start;
		gap: var(--space-8);
	}

	.home-faq__intro {
		flex: 0 0 380px;
	}

	.home-faq .bti-faq {
		flex: 1 1 auto;
		min-width: 0;
	}

	.home-find__inner {
		grid-template-columns: 400px minmax(0, 1fr);
		grid-template-rows: auto 1fr;
		column-gap: 48px;
	}

	.home-find__inner > h2 {
		grid-column: 1;
		grid-row: 1;
	}

	.home-find .bti-find-us__info {
		grid-column: 1;
		grid-row: 2;
	}

	.home-find .bti-map {
		grid-column: 2;
		grid-row: 1 / span 2;
		margin-top: 0;
	}
}
