/*
 * ServiceNest section styles.
 * Loaded on the front end and inside the block editor canvas, so what you see while
 * editing is what visitors get. Every rule is scoped to a snest-* class or a core
 * block class. Colours, fonts and spacing come from theme.json tokens.
 */

/* Sections sit edge to edge with no gap between them. */
.wp-block-post-content > .alignfull,
.is-root-container > .alignfull {
	margin-block-start: 0;
	margin-block-end: 0;
}

.snest-section {
	padding-block: var(--wp--preset--spacing--60);
}

.snest-section--tight {
	padding-block: var(--wp--preset--spacing--50);
}

.snest-hero {
	padding-block: var(--wp--preset--spacing--60);
}

/* Text on dark bands. */
.has-white-color :is(h1, h2, h3, h4, h5, h6),
.has-white-color :is(p, li) {
	color: inherit;
}

.has-white-color a:where(:not(.wp-element-button)) {
	color: inherit;
}

/* Grids. */
.snest-grid {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	align-items: stretch;
}

.snest-grid > * {
	margin: 0;
}

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

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

.snest-grid--4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 960px) {
	.snest-grid--3,
	.snest-grid--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.snest-grid--2,
	.snest-grid--3,
	.snest-grid--4 {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Split layouts (text next to a picture). */
.snest-split {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--50);
	align-items: center;
}

.snest-split > * {
	margin: 0;
}

.snest-split--reverse > :first-child {
	order: 2;
}

@media (max-width: 781px) {
	.snest-split {
		grid-template-columns: minmax(0, 1fr);
	}

	.snest-split--reverse > :first-child {
		order: 0;
	}
}

.snest-split__copy > * + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

/* Section headings. */
.snest-head {
	max-width: 46rem;
	margin-inline: auto;
	margin-block-end: var(--wp--preset--spacing--50);
}

.snest-head--left {
	margin-inline: 0;
}

.snest-head > * + * {
	margin-block-start: var(--wp--preset--spacing--20);
}

.snest-eyebrow {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--clay);
}

.has-white-color .snest-eyebrow,
.has-pine-dark-background-color .snest-eyebrow {
	color: var(--wp--preset--color--brass);
}

.snest-eyebrow--small {
	margin-block: 0;
}

.snest-lead {
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.55;
}

.snest-small {
	font-size: var(--wp--preset--font-size--small);
	margin-block-start: 0;
}

/* Cards. */
.snest-card,
.is-style-svnt-card {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: var(--wp--custom--radius--card, 14px);
	padding: var(--wp--preset--spacing--40);
	box-shadow: var(--wp--preset--shadow--soft, 0 1px 2px rgba(22, 36, 31, 0.08));
}

.has-white-background-color .snest-card {
	background: var(--wp--preset--color--cream);
}

.is-style-svnt-panel {
	background: var(--wp--preset--color--sage);
	border-radius: var(--wp--custom--radius--card, 14px);
	padding: var(--wp--preset--spacing--40);
}

.snest-card > * + *,
.snest-feature > * + *,
.snest-step > * + *,
.snest-trust__item > * + * {
	margin-block-start: var(--wp--preset--spacing--20);
}

.snest-card :is(h3, h4),
.snest-feature :is(h3, h4),
.snest-step h3,
.snest-trust__item h4 {
	margin-block-end: 0;
}

.snest-more a {
	font-weight: 700;
	text-decoration: none;
}

.snest-more a::after {
	content: " \2192";
}

/* Icons, photos, avatars. */
.snest-icon {
	width: 64px;
	margin: 0;
}

.snest-icon--small {
	width: 48px;
}

.snest-icon img {
	display: block;
	width: 100%;
	height: auto;
}

.snest-photo {
	margin: 0;
}

.snest-photo img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--wp--custom--radius--card, 14px);
}

.snest-photo--wide {
	margin-block-start: var(--wp--preset--spacing--50);
}

.snest-avatar,
.is-style-svnt-arch {
	max-width: 180px;
}

.snest-avatar img,
.is-style-svnt-arch img {
	border-radius: 999px 999px 14px 14px;
}

.snest-person-card {
	text-align: center;
}

.snest-person-card .snest-avatar {
	margin-inline: auto;
}

.snest-person-card > * + * {
	margin-block-start: var(--wp--preset--spacing--20);
}

.snest-provider .snest-avatar {
	margin-block-end: var(--wp--preset--spacing--30);
}

/* Steps and stats. */
.snest-step-number {
	width: 3rem;
	height: 3rem;
	line-height: 3rem;
	border-radius: 50%;
	text-align: center;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800;
	background: var(--wp--preset--color--brass);
	color: var(--wp--preset--color--ink);
}

.snest-stat {
	text-align: center;
}

.snest-stat > * {
	margin: 0;
}

.snest-stat__num {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800;
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1.1;
	color: var(--wp--preset--color--brass);
}

.has-white-color .snest-stat__label {
	color: inherit;
}

.snest-trust__item {
	text-align: center;
}

.snest-trust__item .snest-icon {
	margin-inline: auto;
}

/* Pricing. */
.snest-plan {
	display: flex;
	flex-direction: column;
}

.snest-plan .wp-block-list {
	margin: 0;
	padding-left: 1.25rem;
}

.snest-plan .wp-block-buttons {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--30);
}

.snest-plan--feature {
	border-color: var(--wp--preset--color--brass);
	border-width: 2px;
	box-shadow: var(--wp--preset--shadow--lift, 0 8px 24px rgba(22, 36, 31, 0.12));
}

.snest-price {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800;
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1.1;
	margin-block: 0;
}

/* Chips. */
.snest-chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--wp--preset--spacing--20);
}

.snest-chips > * {
	margin: 0;
}

.snest-chip {
	padding: 0.45em 1em;
	border-radius: 999px;
	background: var(--wp--preset--color--sage);
	color: var(--wp--preset--color--pine-dark);
	font-weight: 600;
}

/* Before and after. */
.snest-ba__item {
	position: relative;
}

.snest-caption {
	margin-block: var(--wp--preset--spacing--20) 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	text-align: center;
}

/* Quotes. */
.snest-quote {
	font-size: var(--wp--preset--font-size--medium);
	font-style: italic;
	margin-block: 0;
}

.snest-person {
	font-weight: 700;
	margin-block: 0;
}

/* FAQ. */
.snest-faq > * + * {
	margin-block-start: var(--wp--preset--spacing--20);
}

.wp-block-details summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
}

.wp-block-details[open] summary {
	margin-block-end: var(--wp--preset--spacing--20);
}

/* Call to action band. */
.snest-cta > * + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

.snest-btn-light .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--white);
	border-color: var(--wp--preset--color--white);
}

.snest-btn-light .wp-block-button__link:hover,
.snest-btn-light .wp-block-button__link:focus {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--pine-dark);
}

/* Hero search. */
.snest-search {
	max-width: 36rem;
}

.snest-search .wp-block-search__input {
	border-radius: 999px;
	padding: 0.8em 1.2em;
}

.snest-search .wp-block-search__button {
	border-radius: 999px;
}

/* Project cards. */
.snest-project > * + * {
	margin-block-start: var(--wp--preset--spacing--20);
}

/* Template layout helpers used by templates and template parts. */
.snest-cards {
	margin: 0;
}

.snest-tags,
.snest-post-meta {
	font-size: var(--wp--preset--font-size--small);
}

.snest-header {
	border-bottom: 1px solid var(--wp--preset--color--stone);
	background: var(--wp--preset--color--white);
}

/*
 * Header row: logo and title on the left take the free space and shrink first (the title ends
 * with "..." instead of wrapping); menu button, account icon (added by WooCommerce when it is
 * active) and the call-to-action button sit together on the right and never wrap.
 */
.snest-header > .alignwide {
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	justify-content: flex-start;
	min-width: 0;
}

.snest-header > .alignwide > .wp-block-group:first-child {
	flex: 1 1 auto;
	min-width: 0;
	margin-inline-end: auto;
}

.snest-header > .alignwide > *:not(:first-child) {
	flex: 0 0 auto;
}

.snest-header .wp-block-site-title {
	min-width: 0;
	flex: 0 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.2;
}

.snest-header .wp-block-site-logo {
	flex: 0 0 auto;
}

.snest-header__cta,
.snest-header__cta .wp-block-button {
	flex-wrap: nowrap;
	margin: 0;
}

.snest-header__cta .wp-block-button__link {
	white-space: nowrap;
}

/* Menu button: a 40 px tap target around the 24 px icon (only where core shows the button). */
.snest-header .wp-block-navigation__responsive-container-open {
	min-width: 40px;
	min-height: 40px;
	padding: 8px;
	margin: -8px 0;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
}

.snest-header .wp-block-navigation__responsive-container-open.always-shown {
	display: inline-flex;
}

@media (max-width: 599.98px) {
	.snest-header .wp-block-navigation__responsive-container-open {
		display: inline-flex;
	}
}

/* WooCommerce account icon and mini cart, when WooCommerce adds them to the header. */
.snest-header .wp-block-woocommerce-customer-account,
.snest-header .wp-block-woocommerce-mini-cart {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

.snest-header .wp-block-woocommerce-customer-account a,
.snest-header .wc-block-mini-cart__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	padding: 0;
	border-radius: 8px;
	color: var(--wp--preset--color--pine);
}

.snest-header .wp-block-woocommerce-customer-account svg {
	width: 22px;
	height: 22px;
}

@media (max-width: 600px) {
	.snest-header > .alignwide {
		gap: var(--wp--preset--spacing--20);
	}

	.snest-header .wp-block-site-title {
		font-size: 1.0625rem;
	}

	.snest-header .wp-block-site-logo img {
		max-width: 36px;
		height: auto;
	}

	.snest-header__cta .wp-block-button__link {
		padding: 0.6em 1em;
		font-size: 0.875rem;
		line-height: 1.2;
		min-height: 40px;
		display: inline-flex;
		align-items: center;
	}

	/* On phones the account link shows the icon only. */
	.snest-header .wc-block-customer-account__account-label,
	.snest-header .wp-block-woocommerce-customer-account .label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
}

/*
 * Small phones: the menu button, account icon and mini cart keep their 40 px tap targets but sit
 * side by side with only a hairline gap, so a short site title still shows in full.
 */
@media (max-width: 420px) {
	.snest-header > .alignwide {
		column-gap: 2px;
	}

	.snest-header > .alignwide > .wp-block-group:first-child {
		padding-inline-end: 6px;
	}
}

@media (max-width: 359px) {
	.snest-header > .alignwide {
		column-gap: 0;
	}

	.snest-header > .alignwide > .wp-block-group:first-child {
		padding-inline-end: 4px;
	}

	.snest-header .wp-block-site-title {
		font-size: 0.9375rem;
	}

	.snest-header__cta .wp-block-button__link {
		padding: 0.6em 0.65em;
		font-size: 0.8125rem;
	}
}

/* Centered header: everything is centered and the title may use two lines only on wide screens. */
.snest-header--centered > .alignwide > .wp-block-site-title {
	max-width: 100%;
}

/* On phones the menu button sits next to any icons WooCommerce adds (account, cart), on one row. */
@media (max-width: 599.98px) {
	.snest-header--centered > .alignwide {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
		align-items: center;
		column-gap: 0.5rem;
	}

	.snest-header--centered > .alignwide > .wp-block-site-logo,
	.snest-header--centered > .alignwide > .wp-block-site-title {
		display: flex;
		flex-basis: 100%;
		justify-content: center;
	}
}

.snest-footer {
	margin-block-start: 0;
}

/*
 * ServiceNest Marketplace blocks (Phase 2): theme colours and shapes on top of the plugin's
 * neutral styles. Only applies when the blocks are on the page.
 */
.snmk-filters__form {
	border-color: var(--wp--preset--color--stone);
	border-radius: 12px;
	box-shadow: var(--wp--preset--shadow--soft, none);
}

.snmk-filters__form select,
.snmk-filters__form input[type="text"],
.snmk-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.snmk-form select,
.snmk-form textarea {
	border-color: var(--wp--preset--color--stone);
	border-radius: 10px;
	color: var(--wp--preset--color--ink);
}

.snmk-filters__form select,
.snmk-filters__form input[type="text"] {
	box-sizing: border-box;
	min-height: 2.75rem;
}

.snmk-filters__form :is(select, input):focus-visible,
.snmk-form :is(select, input, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--pine);
	outline-offset: 1px;
}

.snmk-summary {
	color: var(--wp--preset--color--ink);
}

.snmk-summary--warn {
	color: var(--wp--preset--color--clay);
}

.snmk-badge {
	background: var(--wp--preset--color--sage);
	color: var(--wp--preset--color--pine-dark, var(--wp--preset--color--pine));
}

.snmk-chips li a,
.snmk-related__list li a {
	background: var(--wp--preset--color--sage);
	color: var(--wp--preset--color--pine-dark, var(--wp--preset--color--ink));
}

.snmk-chips li a:hover,
.snmk-chips li a:focus-visible,
.snmk-related__list li a:hover,
.snmk-related__list li a:focus-visible {
	background: var(--wp--preset--color--pine);
	color: var(--wp--preset--color--white);
}

.snmk-fact--price {
	color: var(--wp--preset--color--pine);
}

.snmk-prices,
.snmk-price {
	border-color: var(--wp--preset--color--stone);
}

.snmk-section-title {
	font-family: var(--wp--preset--font-family--display, inherit);
}

.snmk-portfolio img {
	border-radius: 12px;
}

.snmk-notice--ok,
.snmk-pill--publish {
	background: var(--wp--preset--color--sage);
	color: var(--wp--preset--color--pine-dark, var(--wp--preset--color--ink));
}

.snmk-fieldset {
	border-color: var(--wp--preset--color--stone);
}

.snest-form-panel {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: 16px;
	padding: var(--wp--preset--spacing--50);
}

@media (max-width: 600px) {
	.snest-form-panel {
		padding: var(--wp--preset--spacing--30);
	}
}

.snest-card--provider .snmk-card-meta {
	font-size: var(--wp--preset--font-size--small);
}

.snest-card--aside .snmk-profile-contact {
	margin-block-start: var(--wp--preset--spacing--30);
}

/* Job requests and quotes (0.3.0). */
.snest-request-steps {
	margin-block-start: var(--wp--preset--spacing--50);
	gap: var(--wp--preset--spacing--30);
}

.snest-request-step {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: 16px;
	padding: var(--wp--preset--spacing--30);
}

.snest-request-step h3 {
	margin-block: 0 0.4rem;
	font-size: var(--wp--preset--font-size--medium);
}

.snest-request-step p {
	margin: 0;
}

.snmk-request,
.snmk-customer-jobs .snmk-job,
.snmk-dashboard__jobs .snmk-job {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: 16px;
	padding: var(--wp--preset--spacing--40);
}

.snmk-quote,
.snmk-job-list__item {
	border-color: var(--wp--preset--color--stone);
	background: var(--wp--preset--color--white);
}

.snmk-quote--accepted {
	border-color: var(--wp--preset--color--pine, currentcolor);
}

.snmk-quote__price {
	color: var(--wp--preset--color--pine, inherit);
}

.snmk-pill--job-booked {
	background: var(--wp--preset--color--sage);
	color: var(--wp--preset--color--pine-dark, var(--wp--preset--color--ink));
}

@media (max-width: 600px) {
	.snmk-request,
	.snmk-customer-jobs .snmk-job,
	.snmk-dashboard__jobs .snmk-job {
		padding: var(--wp--preset--spacing--30);
	}
}
