/*
Theme Name: Workflow Builders
Theme URI: https://workflowbuilders.ai
Author: Workflow Builders
Description: Block theme for Workflow Builders, an AI workflow consultancy for small and mid-size businesses.
Version: 0.1.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: workflowbuilders
*/

/* Design tokens live in theme.json. This file covers what theme.json can't
   express: font width, the flow diagram, list/grid structures, focus states. */

:root {
	--wfb-ink: var(--wp--preset--color--ink);
	--wfb-graphite: var(--wp--preset--color--graphite);
	--wfb-line: var(--wp--preset--color--line);
	--wfb-pencil: var(--wp--preset--color--pencil);
	--wfb-flow: var(--wp--preset--color--flow);
	--wfb-paper: var(--wp--preset--color--paper);
}

body {
	background: var(--wfb-paper);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* ---- Type --------------------------------------------------------------- */

/* Archivo's width axis is the headline voice: expanded like engineering
   signage for display text, normal width for reading. */
h1, h2, .wfb-wordmark {
	font-stretch: 116%;
}
h3 {
	font-stretch: 104%;
}
h1, h2, h3 {
	text-wrap: balance;
}
p, li {
	text-wrap: pretty;
}

.wfb-display {
	max-width: 15ch;
	font-size: clamp(2.375rem, 1.6rem + 3.2vw, 3.875rem);
}

/* Template parts sit flush: sections carry their own spacing. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

.wfb-lede {
	color: var(--wfb-graphite);
	max-width: 60ch;
}

.wfb-page-head .wp-block-post-title {
	max-width: 18ch;
	margin: 0 0 1rem;
}
.wfb-page-head .wfb-lede p {
	margin: 0;
}
.wfb-page-head .wp-block-post-excerpt__more-text {
	display: none;
}

/* ---- Wordmark ----------------------------------------------------------- */

/* A small node-and-edge mark drawn in CSS, so the site title stays editable. */
.wfb-wordmark a {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
}
.wfb-wordmark a::before {
	content: "";
	flex: none;
	width: 1.6em;
	height: 0.8em;
	background:
		linear-gradient(var(--wfb-pencil), var(--wfb-pencil)) right center / 0.8em 0.8em no-repeat,
		linear-gradient(var(--wfb-flow), var(--wfb-flow)) left center / 100% 2px no-repeat,
		linear-gradient(currentColor, currentColor) left center / 0.45em 0.45em no-repeat;
}
.wfb-wordmark--light a {
	color: var(--wfb-paper);
}

/* ---- Header ------------------------------------------------------------- */

.wfb-header {
	border-bottom: 1px solid var(--wfb-line);
	background: var(--wfb-paper);
}
.wfb-header .wp-block-navigation-item__content:hover {
	color: var(--wfb-flow);
}

/* ---- Buttons ------------------------------------------------------------ */

.wp-block-button.is-style-wfb-text .wp-block-button__link {
	background: transparent;
	color: var(--wfb-ink);
	padding-left: 0;
	padding-right: 0;
	text-decoration: underline;
	text-decoration-color: var(--wfb-flow);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.3em;
}
.wp-block-button.is-style-wfb-text .wp-block-button__link:hover {
	color: var(--wfb-flow);
}
.wp-block-button.is-style-wfb-dark .wp-block-button__link {
	background: var(--wfb-ink);
	color: var(--wfb-paper);
}
.wp-block-button.is-style-wfb-dark .wp-block-button__link:hover {
	background: #2A3846;
	color: var(--wfb-paper);
}

/* ---- Focus -------------------------------------------------------------- */

:where(a, button, input, select, textarea, iframe, [tabindex]):focus-visible {
	outline: 3px solid var(--wfb-flow);
	outline-offset: 3px;
	border-radius: 2px;
}
.wfb-cta :where(a, button):focus-visible,
.wfb-footer :where(a, button):focus-visible {
	outline-color: var(--wfb-ink);
}
.wfb-footer :where(a, button):focus-visible {
	outline-color: var(--wfb-pencil);
}

/* ---- Hero flow diagram -------------------------------------------------- */

.wfb-flow {
	margin: 0;
	--wfb-gap: 1.1rem;
}
.wfb-flow__lanes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(1rem, 3vw, 2rem);
}
.wfb-flow__lane {
	display: flex;
	flex-direction: column;
}
.wfb-flow__label {
	margin: 0 0 0.75rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: var(--wfb-graphite);
}
.wfb-flow__lane--auto .wfb-flow__label {
	color: var(--wfb-flow);
}
.wfb-flow__steps {
	list-style: none;
	margin: 0;
	padding: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: var(--wfb-gap);
	font-size: 0.9375rem;
	line-height: 1.35;
}
.wfb-flow__lane--auto .wfb-flow__steps {
	justify-content: space-between;
}
.wfb-flow__steps li {
	position: relative;
	padding: 0.6rem 0.75rem;
	border-radius: 4px;
}
/* Connectors between steps. */
.wfb-flow__steps li + li::before {
	content: "";
	position: absolute;
	left: 1.1rem;
	bottom: 100%;
	height: var(--wfb-gap);
	width: 0;
}

/* Manual lane: dashed, grey, a little crooked. */
.wfb-flow__lane--manual li {
	border: 1px dashed var(--wfb-graphite);
	color: var(--wfb-graphite);
}
.wfb-flow__lane--manual li:nth-child(even) {
	margin-left: 0.9rem;
}
.wfb-flow__lane--manual li:nth-child(4) {
	border-color: #B4544A;
	color: #8C3A31;
}
.wfb-flow__lane--manual li + li::before {
	border-left: 1px dashed var(--wfb-graphite);
}

/* Automated lane: solid, direct, drawn once on load. */
.wfb-flow__lane--auto li {
	background: #fff;
	border: 1.5px solid var(--wfb-ink);
	font-weight: 600;
}
.wfb-flow__lane--auto li.is-agent {
	background: var(--wfb-pencil);
	border-color: var(--wfb-pencil);
}
.wfb-flow__lane--auto .wfb-flow__steps {
	position: relative;
}
.wfb-flow__lane--auto li {
	z-index: 1;
}
/* One continuous line behind the steps: always the right length. */
.wfb-flow__lane--auto .wfb-flow__steps::before {
	content: "";
	position: absolute;
	left: calc(1.1rem - 1px);
	top: 1rem;
	bottom: 1rem;
	width: 3px;
	background: var(--wfb-flow);
	transform-origin: top;
}
.wfb-flow__caption {
	margin-top: 1rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--wfb-line);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wfb-graphite);
}

@media (prefers-reduced-motion: no-preference) {
	.wfb-flow__lane--auto li {
		animation: wfb-step-in 0.45s ease-out both;
	}
	.wfb-flow__lane--auto .wfb-flow__steps::before {
		animation: wfb-draw 1.5s 0.5s ease-in-out both;
	}
	.wfb-flow__lane--auto li:nth-child(1) { animation-delay: 0.3s; }
	.wfb-flow__lane--auto li:nth-child(2) { animation-delay: 1.05s; }
	.wfb-flow__lane--auto li:nth-child(3) { animation-delay: 1.85s; }
}
@keyframes wfb-draw {
	from { transform: scaleY(0); }
	to { transform: scaleY(1); }
}
@keyframes wfb-step-in {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: none; }
}

/* ---- Sections ----------------------------------------------------------- */

.wfb-section__head {
	margin-bottom: var(--wp--preset--spacing--40);
}
.wfb-section__head > * + * {
	margin-top: 1rem;
}
.wfb-more {
	margin-top: var(--wp--preset--spacing--40);
	font-weight: 600;
}

/* "Where the hours go": label column + description column, hairline rows. */
.wfb-rows {
	border-top: 1.5px solid var(--wfb-ink);
}
.wfb-rows > .wfb-row {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 0.5rem 2rem;
	padding: 1.4rem 0;
	margin: 0;
	border-bottom: 1px solid var(--wfb-line);
}
.wfb-row > h3,
.wfb-row > p {
	margin: 0;
}
.wfb-row > p {
	color: var(--wfb-graphite);
	max-width: 60ch;
}

/* Services: 2x2 grid with a rule above each item, no boxes. */
.wfb-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40) clamp(2rem, 5vw, 4rem);
}
.wfb-grid > .wfb-grid__item {
	margin: 0;
	padding-top: 1.25rem;
	border-top: 1.5px solid var(--wfb-ink);
}
.wfb-grid__item > h3 {
	margin: 0 0 0.6rem;
}
.wfb-grid__item > p {
	margin: 0;
	color: var(--wfb-graphite);
	max-width: 52ch;
}

/* Process: a real sequence, so it gets numbers and a connecting line. */
.wfb-steps {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 2rem clamp(1.25rem, 3vw, 2.5rem);
	counter-reset: wfb-step;
}
.wfb-steps > .wfb-step {
	position: relative;
	margin: 0;
	padding-top: 4.25rem;
	counter-increment: wfb-step;
}
.wfb-step::before {
	content: counter(wfb-step);
	position: absolute;
	top: 0;
	left: 0;
	width: 2.75rem;
	height: 2.75rem;
	display: grid;
	place-items: center;
	border: 1.5px solid var(--wfb-ink);
	border-radius: 50%;
	background: var(--wfb-paper);
	font-weight: 800;
	font-stretch: 116%;
	font-size: 1.125rem;
	z-index: 1;
}
.wfb-step:first-child::before {
	background: var(--wfb-pencil);
	border-color: var(--wfb-pencil);
}
.wfb-step:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 1.375rem;
	left: 2.75rem;
	right: calc(-1 * clamp(1.25rem, 3vw, 2.5rem));
	height: 0;
	border-top: 2px solid var(--wfb-flow);
}
.wfb-step > h3 {
	margin: 0 0 0.6rem;
}
.wfb-step > p {
	margin: 0;
	color: var(--wfb-graphite);
}

/* Principles: two columns of short statements. */
.wfb-pairs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40) clamp(2rem, 5vw, 4rem);
}
.wfb-pairs > .wfb-pairs__item {
	margin: 0;
}
.wfb-pairs__item > h3 {
	margin: 0 0 0.5rem;
}
.wfb-pairs__item > h3::before {
	content: "";
	display: block;
	width: 2rem;
	height: 3px;
	margin-bottom: 0.9rem;
	background: var(--wfb-flow);
}
.wfb-pairs__item > p {
	margin: 0;
	color: var(--wfb-graphite);
	max-width: 52ch;
}

/* Yellow call-to-action band. */
.wfb-cta__text {
	max-width: 38rem;
}
.wfb-cta__text > h2 {
	margin: 0 0 0.75rem;
	font-size: var(--wp--preset--font-size--large);
}
.wfb-cta__text > p {
	margin: 0;
}

/* ---- Inner pages -------------------------------------------------------- */

.wfb-page-head {
	border-bottom: 1px solid var(--wfb-line);
}
.wfb-page-content {
	padding-top: var(--wp--preset--spacing--50);
}
.wfb-page-content > .alignfull:last-child {
	margin-bottom: 0;
}

/* Services page: name in the left column, details on the right. */
.wfb-service {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 1rem 3rem;
	padding: var(--wp--preset--spacing--40) 0;
	border-top: 1.5px solid var(--wfb-ink);
	scroll-margin-top: 2rem;
}
.wfb-service:first-child {
	padding-top: 1.5rem;
}
.wfb-service > h2 {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}
.wfb-service__body > :first-child {
	margin-top: 0;
}
.wfb-service__body > h3 {
	margin-top: 1.75rem;
	font-size: var(--wp--preset--font-size--base);
}

.wfb-checklist {
	list-style: none;
	padding-left: 0;
}
.wfb-checklist > li {
	position: relative;
	padding-left: 1.6rem;
	margin-bottom: 0.55rem;
}
.wfb-checklist > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.62em;
	width: 0.7rem;
	height: 0.35rem;
	border-left: 2px solid var(--wfb-flow);
	border-bottom: 2px solid var(--wfb-flow);
	transform: translateY(-50%) rotate(-45deg);
}

.wfb-about .wp-block-column > h2:not(:first-child) {
	margin-top: var(--wp--preset--spacing--40);
}
.wfb-about__aside {
	padding: 1.5rem;
	background: #fff;
	border-top: 3px solid var(--wfb-pencil);
	align-self: flex-start;
}
.wfb-about__aside > h3 {
	margin-top: 0;
}

/* Booking embed. */
.wfb-booking__frame {
	display: block;
	width: 100%;
	min-height: 720px;
	border: 1px solid var(--wfb-line);
	border-radius: 4px;
	background: #fff;
}
.wfb-booking__fallback {
	font-size: var(--wp--preset--font-size--small);
}
.wfb-booking--empty {
	padding: 2rem;
	background: #fff;
	border: 1.5px dashed var(--wfb-graphite);
	border-radius: 4px;
}
.wfb-booking--empty p:first-child {
	margin-top: 0;
}
.wfb-booking__mail {
	font-weight: 700;
	font-size: var(--wp--preset--font-size--medium);
}

/* ---- Footer ------------------------------------------------------------- */

.wfb-footer a {
	text-decoration-color: rgba(246, 247, 244, 0.4);
}
.wfb-footer a:hover {
	color: var(--wfb-pencil);
}
.wfb-footer__line {
	max-width: 32ch;
	color: #C3CAD1;
}
.wfb-footer__heading {
	font-size: var(--wp--preset--font-size--small);
	font-stretch: 100%;
	color: #C3CAD1;
	margin-bottom: 0.75rem;
}
.wfb-footer__links {
	list-style: none;
	padding: 0;
	margin: 0;
}
.wfb-footer__links li + li {
	margin-top: 0.35rem;
}
.wfb-footer__legal {
	margin-top: var(--wp--preset--spacing--40);
	padding-top: 1.25rem;
	border-top: 1px solid #2E3B48;
	color: #C3CAD1;
}

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 960px) {
	.wfb-steps {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.wfb-step:nth-child(2n)::after {
		display: none;
	}
}

@media (max-width: 781px) {
	.wfb-rows > .wfb-row,
	.wfb-service,
	.wfb-grid,
	.wfb-pairs {
		grid-template-columns: minmax(0, 1fr);
	}
	.wfb-display {
		max-width: none;
	}
}

@media (max-width: 600px) {
	.wfb-steps {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}
	.wfb-steps > .wfb-step {
		padding: 0 0 2rem 4rem;
	}
	.wfb-step:not(:last-child)::after,
	.wfb-step:nth-child(2n):not(:last-child)::after {
		display: block;
		top: 2.75rem;
		bottom: 0;
		left: calc(1.375rem - 1px);
		right: auto;
		height: auto;
		border-top: 0;
		border-left: 2px solid var(--wfb-flow);
	}
	.wfb-flow__steps {
		font-size: 0.8125rem;
	}
	.wfb-flow__lane--manual li:nth-child(even) {
		margin-left: 0.5rem;
	}
}

/* Full-width sections placed back to back inside page content sit flush. */
.wfb-page-content > .alignfull + .alignfull {
	margin-block-start: 0;
}
/* No "About" link when already on the About page. */
.wfb-about ~ .wfb-principles .wfb-more {
	display: none;
}
