/*
 * Studio Base - design style component layer (shared by every design style).
 * Visual redesign milestone: commercial conversion structure + polish.
 * Scoped to body.studio-has-design-style; tokens only (no hex).
 */

/* ---------- Knobs (overridden per style) ---------- */
body.studio-has-design-style {
	--sb-ink: var(--wp--preset--color--contrast);
	--sb-paper: var(--wp--preset--color--base);
	--sb-accent-on-dark: var(--wp--custom--style--accent-on-dark, color-mix(in srgb, var(--wp--preset--color--accent) 45%, var(--wp--preset--color--base)));
	--sb-tracking: var(--wp--custom--style--tracking, 0.12em);
	--sb-card-radius: var(--wp--custom--radius--medium);
	--sb-card-border: var(--wp--custom--border-width--thin) solid var(--wp--preset--color--border);
	--sb-card-shadow: var(--wp--preset--shadow--soft);
	--sb-card-shadow-hover: var(--wp--preset--shadow--raised);
	--sb-card-padding: var(--wp--preset--spacing--50);
	--sb-chip-radius: var(--wp--custom--radius--small);
	--sb-tap: 3rem;
	--sb-sticky-h: 0px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
body.studio-has-design-style.has-studio-sticky-bar {
	--sb-sticky-h: 4.25rem;
	padding-bottom: var(--sb-sticky-h);
}

/* ---------- Typography polish ---------- */
body.studio-has-design-style :where(h1, h2, h3, .wp-block-heading) {
	text-wrap: balance;
	overflow-wrap: break-word;
}
body.studio-has-design-style :where(p, li, blockquote) {
	text-wrap: pretty;
}
body.studio-has-design-style :where(a:not(.wp-element-button)) {
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

/* ---------- Buttons ---------- */
body.studio-has-design-style .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55em;
	min-height: var(--sb-tap);
	box-sizing: border-box;
	text-align: center;
}
body.studio-has-design-style .wp-block-button__link[href^="tel:"]::before {
	content: "";
	flex: none;
	width: 1.1em;
	height: 1.1em;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h3.2l1.7 4.3-2.1 1.5a11 11 0 0 0 7.4 7.4l1.5-2.1 4.3 1.7V19a2 2 0 0 1-2 2A16 16 0 0 1 3 5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h3.2l1.7 4.3-2.1 1.5a11 11 0 0 0 7.4 7.4l1.5-2.1 4.3 1.7V19a2 2 0 0 1-2 2A16 16 0 0 1 3 5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Header ---------- */
body.studio-has-design-style .wp-site-blocks > header.wp-block-template-part {
	background-color: var(--wp--preset--color--base);
	border-bottom: var(--wp--custom--border-width--thin) solid var(--wp--preset--color--border);
	position: sticky;
	top: 0;
	z-index: 100;
}
body.studio-has-design-style .wp-site-blocks > header.wp-block-template-part .wp-block-navigation-item__content:hover {
	text-decoration: underline;
	text-underline-offset: 0.35em;
}
body.studio-has-design-style .studio-header-actions {
	align-items: center;
	gap: var(--wp--preset--spacing--30);
}
body.studio-has-design-style .studio-header-phone {
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--wp--custom--font-weight--semibold);
	text-decoration: none;
	white-space: nowrap;
}
body.studio-has-design-style .studio-header-phone:hover {
	text-decoration: underline;
}
body.studio-has-design-style .studio-header-actions .wp-block-button__link {
	min-height: 2.75rem;
	padding-inline: var(--wp--preset--spacing--40);
}
body.studio-has-design-style .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	font-size: var(--wp--preset--font-size--large);
	gap: var(--wp--preset--spacing--40);
}
@media (max-width: 781px) {
	body.studio-has-design-style .studio-header-actions .studio-header-phone {
		display: none;
	}
}

/* ---------- Hero ---------- */
body.studio-has-design-style .alignfull:where(.studio-hero, .studio-hero-split, .wp-block-post-content > .alignfull:first-child:has(h1)) h1.has-text-align-center {
	max-width: 20ch;
}
body.studio-has-design-style .alignfull:where(.studio-hero, .studio-hero-split, .wp-block-post-content > .alignfull:first-child:has(h1)) .wp-block-column h1 {
	max-width: 18ch;
}
body.studio-has-design-style .alignfull:where(.studio-hero, .studio-hero-split, .wp-block-post-content > .alignfull:first-child:has(h1)) h1.has-text-align-center + p.has-text-align-center {
	max-width: 46ch;
}
body.studio-has-design-style .alignfull:where(.studio-hero, .studio-hero-split, .wp-block-post-content > .alignfull:first-child:has(h1)) .wp-block-column h1 + p {
	max-width: 44ch;
}
body.studio-has-design-style .alignfull:where(.studio-hero, .studio-hero-split, .wp-block-post-content > .alignfull:first-child:has(h1)) .wp-block-buttons {
	margin-block-start: var(--wp--preset--spacing--50);
	gap: var(--wp--preset--spacing--30);
}
body.studio-has-design-style .alignfull:where(.studio-hero, .studio-hero-split, .wp-block-post-content > .alignfull:first-child:has(h1)) .wp-block-column > .wp-block-image {
	position: relative;
	isolation: isolate;
}
body.studio-has-design-style .studio-eyebrow {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: var(--wp--custom--font-weight--semibold);
	letter-spacing: var(--sb-tracking);
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin-bottom: 0;
}

/* ---------- Trust strip ---------- */
body.studio-has-design-style .studio-trust {
	border-block: var(--wp--custom--border-width--thin) solid var(--wp--preset--color--border);
}
body.studio-has-design-style .studio-trust .studio-trust-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--10);
	text-align: center;
	min-width: 7rem;
}
body.studio-has-design-style .studio-trust .studio-trust-item strong {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--wp--custom--font-weight--bold);
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--contrast);
}
body.studio-has-design-style .studio-trust .studio-trust-item span {
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--muted);
}
body.studio-has-design-style .studio-trust .studio-demo-note {
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--muted);
	text-align: center;
	margin: 0;
}

/* ---------- Section intros ---------- */
body.studio-has-design-style .wp-block-post-content > .alignfull h2.has-text-align-center + p.has-text-align-center {
	max-width: 56ch;
}

/* ---------- Cards ---------- */
body.studio-has-design-style .is-style-card {
	border: var(--sb-card-border);
	border-radius: var(--sb-card-radius);
	box-shadow: var(--sb-card-shadow);
	padding: var(--sb-card-padding);
	background-color: var(--wp--preset--color--base);
	height: 100%;
	box-sizing: border-box;
}
body.studio-has-design-style .is-style-card:has(a:not(.wp-element-button)) {
	transition: box-shadow var(--wp--custom--transition--fast), transform var(--wp--custom--transition--fast);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	body.studio-has-design-style .is-style-card:has(a:not(.wp-element-button)):hover {
		box-shadow: var(--sb-card-shadow-hover);
		transform: translateY(-2px);
	}
}

/* ---------- Services hierarchy ---------- */
body.studio-has-design-style .studio-services .is-style-card h3 {
	margin-top: 0;
}
body.studio-has-design-style .studio-services .is-style-card h3::before {
	content: "";
	display: block;
	width: 1.75rem;
	height: 3px;
	margin-bottom: var(--wp--preset--spacing--30);
	background-color: var(--wp--preset--color--primary);
	border-radius: 1px;
}

/* ---------- Trust: testimonials, stats, logos ---------- */
body.studio-has-design-style .is-style-card > .wp-block-quote {
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0;
	border: 0;
	padding: 0;
}
body.studio-has-design-style .is-style-card > .wp-block-quote::before {
	content: "\201C";
	content: "\201C" / "";
	display: block;
	height: 0.55em;
	font-family: var(--wp--preset--font-family--heading);
	margin-bottom: var(--wp--preset--spacing--20);
	font-size: 3.5em;
	line-height: 1;
	color: var(--wp--preset--color--accent);
}
body.studio-has-design-style .is-style-card > .wp-block-quote cite {
	display: block;
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--wp--custom--font-weight--semibold);
	color: var(--wp--preset--color--contrast);
}
body.studio-has-design-style .studio-rating {
	display: inline-flex;
	gap: 0.15em;
	margin-bottom: var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--accent);
	letter-spacing: 0.05em;
	font-size: var(--wp--preset--font-size--small);
}
body.studio-has-design-style :is(.studio-services, .studio-testimonials) > .alignwide.is-layout-grid {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, max(18rem, calc((100% - 2 * var(--wp--preset--spacing--40)) / 3))), 1fr));
}
body.studio-has-design-style .studio-service-area .is-layout-grid {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, max(12rem, calc((100% - 2 * var(--wp--preset--spacing--40)) / 3))), 1fr));
}
body.studio-has-design-style .studio-stats > .alignwide.is-layout-grid {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, max(9rem, calc((100% - 3 * var(--wp--preset--spacing--40)) / 4))), 1fr));
}
body.studio-has-design-style .studio-stats .has-xx-large-font-size {
	font-family: var(--wp--preset--font-family--heading);
	letter-spacing: var(--wp--custom--style--heading-tracking, 0);
}
body.studio-has-design-style .studio-logos .wp-block-image img {
	filter: grayscale(1);
	opacity: 0.8;
}

/* ---------- FAQ ---------- */
body.studio-has-design-style .wp-block-details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--40);
	min-height: var(--sb-tap);
	list-style: none;
	cursor: pointer;
}
body.studio-has-design-style .wp-block-details > summary::-webkit-details-marker {
	display: none;
}
body.studio-has-design-style .wp-block-details > summary::after {
	content: "";
	flex: none;
	width: 1rem;
	height: 1rem;
	background:
		linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
		linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
	transition: transform var(--wp--custom--transition--fast);
}
body.studio-has-design-style .wp-block-details[open] > summary::after {
	transform: rotate(45deg);
}
body.studio-has-design-style .wp-block-details > :not(summary) {
	max-width: 65ch;
	color: var(--wp--preset--color--muted);
}

/* ---------- Gallery / before-after ---------- */
body.studio-has-design-style .wp-block-gallery.has-nested-images figure.wp-block-image {
	overflow: hidden;
	border-radius: var(--wp--custom--radius--small);
}
body.studio-has-design-style .studio-gallery .wp-block-gallery.has-nested-images figure.wp-block-image img {
	transition: transform var(--wp--custom--transition--fast);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	body.studio-has-design-style .studio-gallery .wp-block-gallery.has-nested-images figure.wp-block-image:hover img {
		transform: scale(1.03);
	}
}
body.studio-has-design-style .studio-before-after > .alignwide > :is(h3, .wp-block-columns) {
	max-width: none;
}
body.studio-has-design-style .studio-before-after .wp-block-column > .wp-block-group {
	position: relative;
}
body.studio-has-design-style .studio-before-after .wp-block-column > .wp-block-group > p:first-child {
	position: absolute;
	z-index: 1;
	top: var(--wp--preset--spacing--30);
	left: var(--wp--preset--spacing--30);
	margin: 0;
	padding: 0.35em 0.8em;
	border-radius: var(--sb-chip-radius);
	background-color: var(--wp--preset--color--base);
	box-shadow: var(--wp--preset--shadow--soft);
	letter-spacing: var(--sb-tracking);
}
body.studio-has-design-style .studio-before-after .wp-block-column > .wp-block-group > p:first-child + .wp-block-image {
	margin-block-start: 0;
}

/* ---------- Contact / quote ---------- */
body.studio-has-design-style .studio-contact .is-style-card {
	padding: var(--sb-card-padding);
	box-shadow: var(--sb-card-shadow-hover);
}
body.studio-has-design-style .studio-contact .wp-block-column > .wp-block-group h3 {
	font-family: var(--wp--preset--font-family--body);
	letter-spacing: var(--sb-tracking);
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}
body.studio-has-design-style .studio-lead-form__actions .wp-element-button {
	min-height: var(--sb-tap);
}

/* ---------- Footer commercial ---------- */
body.studio-has-design-style .wp-site-blocks > footer.wp-block-template-part .studio-footer-cta .wp-block-button__link {
	min-height: var(--sb-tap);
}

/* ---------- Dark backgrounds ---------- */
body.studio-has-design-style :where(.has-contrast-background-color, .is-style-section-contrast) .has-accent-color:not(.has-background) {
	color: var(--sb-accent-on-dark) !important;
}

/* ---------- Sticky mobile Call + Quote bar ---------- */
body.studio-has-design-style .studio-sticky-bar {
	display: none;
}
@media (max-width: 781px) {
	body.studio-has-design-style.has-studio-sticky-bar .studio-sticky-bar {
		display: flex;
		position: fixed;
		inset: auto 0 0 0;
		z-index: 200;
		align-items: stretch;
		gap: 0;
		min-height: var(--sb-sticky-h);
		background-color: var(--wp--preset--color--contrast);
		color: var(--wp--preset--color--base);
		box-shadow: 0 -4px 24px color-mix(in srgb, var(--wp--preset--color--contrast) 28%, transparent);
		padding: env(safe-area-inset-bottom, 0) 0 0;
	}
	body.studio-has-design-style .studio-sticky-bar a {
		flex: 1;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 0.45em;
		min-height: 3.25rem;
		padding: 0.75rem 1rem;
		font-size: var(--wp--preset--font-size--small);
		font-weight: var(--wp--custom--font-weight--bold);
		text-decoration: none;
		color: inherit;
		box-sizing: border-box;
	}
	body.studio-has-design-style .studio-sticky-bar a:focus-visible {
		outline: 2px solid var(--wp--preset--color--base);
		outline-offset: -4px;
	}
	body.studio-has-design-style .studio-sticky-bar__call {
		background-color: var(--wp--preset--color--contrast);
		color: var(--wp--preset--color--base);
	}
	body.studio-has-design-style .studio-sticky-bar__quote {
		background-color: var(--wp--preset--color--primary);
		color: var(--wp--preset--color--primary-contrast);
	}
	body.studio-has-design-style .studio-sticky-bar__call::before {
		content: "";
		flex: none;
		width: 1em;
		height: 1em;
		background-color: currentColor;
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h3.2l1.7 4.3-2.1 1.5a11 11 0 0 0 7.4 7.4l1.5-2.1 4.3 1.7V19a2 2 0 0 1-2 2A16 16 0 0 1 3 5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h3.2l1.7 4.3-2.1 1.5a11 11 0 0 0 7.4 7.4l1.5-2.1 4.3 1.7V19a2 2 0 0 1-2 2A16 16 0 0 1 3 5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
	}
}
/* ---------- Final polish: photo readiness + section rhythm ---------- */
body.studio-has-design-style .wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
	background-color: var(--wp--preset--color--surface);
}
body.studio-has-design-style :is(.studio-gallery, .studio-before-after, .studio-image-text, .studio-hero-split) .wp-block-image {
	overflow: hidden;
	isolation: isolate;
}
body.studio-has-design-style .studio-before-after .wp-block-image img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}
body.studio-has-design-style .studio-before-after .alignwide + .alignwide {
	margin-block-start: var(--wp--preset--spacing--50);
}
body.studio-has-design-style .studio-features .wp-block-columns { counter-reset: studio-feat; }
body.studio-has-design-style .studio-features .wp-block-column > h3 { margin-top: 0; }
body.studio-has-design-style .studio-features .wp-block-column > h3::before {
	counter-increment: studio-feat;
	content: counter(studio-feat, decimal-leading-zero);
	display: block;
	margin-bottom: var(--wp--preset--spacing--30);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--wp--custom--font-weight--bold);
	letter-spacing: var(--sb-tracking);
	color: var(--wp--preset--color--primary);
}
body.studio-has-design-style .studio-stats {
	background-color: var(--wp--preset--color--surface);
	border-block: var(--wp--custom--border-width--thin) solid var(--wp--preset--color--border);
}
body.studio-has-design-style .studio-gallery .wp-block-gallery.has-nested-images figure.wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	aspect-ratio: 1;
	background-color: var(--wp--preset--color--surface);
}
body.studio-has-design-style .wp-site-blocks > header.wp-block-template-part .wp-block-site-title a {
	text-decoration: none;
	letter-spacing: -0.01em;
}
@media (max-width: 781px) {
	body.studio-has-design-style .studio-sticky-bar__call {
		border-right: 1px solid color-mix(in srgb, var(--wp--preset--color--base) 18%, transparent);
	}
}
@media (min-width: 600px) and (max-width: 781px) {
	body.studio-has-design-style :is(.studio-services, .studio-testimonials) > .alignwide.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	body.studio-has-design-style .studio-stats > .alignwide.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	body.studio-has-design-style .is-style-card,
	body.studio-has-design-style .studio-gallery .wp-block-gallery.has-nested-images figure.wp-block-image img,
	body.studio-has-design-style .wp-block-details > summary::after {
		transition: none !important;
	}
}

/* ---------- Mobile conversion ---------- */
@media (max-width: 599px) {
	body.studio-has-design-style .alignfull:where(.studio-hero, .studio-hero-split, .studio-cta, .studio-emergency, .wp-block-post-content > .alignfull:first-child:has(h1), .wp-block-post-content > .alignfull.has-primary-background-color) .wp-block-buttons {
		flex-direction: column;
		align-items: stretch;
	}
	body.studio-has-design-style .alignfull:where(.studio-hero, .studio-hero-split, .studio-cta, .studio-emergency, .wp-block-post-content > .alignfull:first-child:has(h1), .wp-block-post-content > .alignfull.has-primary-background-color) .wp-block-button,
	body.studio-has-design-style .alignfull:where(.studio-hero, .studio-hero-split, .studio-cta, .studio-emergency, .wp-block-post-content > .alignfull:first-child:has(h1), .wp-block-post-content > .alignfull.has-primary-background-color) .wp-block-button__link,
	body.studio-has-design-style .studio-lead-form__actions .wp-element-button {
		width: 100%;
	}
	body.studio-has-design-style .studio-emergency > .alignwide > * {
		flex-basis: 100%;
	}
	body.studio-has-design-style .alignfull:where(.studio-hero, .studio-hero-split, .wp-block-post-content > .alignfull:first-child:has(h1)) :is(h1, h1 + p).has-text-align-center {
		text-align: left;
	}
	body.studio-has-design-style .is-style-card {
		--sb-card-padding: var(--wp--preset--spacing--40);
	}
	body.studio-has-design-style .studio-header-actions .wp-block-buttons {
		display: none;
	}
}
