/*
 * The article template (single-post.html; WO-64, rebuilt for handoff 14.4, 20 November). The Knowledge
 * hub rules left with the hub: the Insights pages are styled in page-insights.css. Loads with core/group
 * on every page (functions.php), so every rule is scoped under .fd-article-* classes. Phone first, token
 * colours only.
 */

/*
 * Article template (single-post.html, Article.png). The hero holds an 860 px column, the body a 260 px
 * contents column and an 892 px text column (48 px gap) from 1024, stacked below.
 */
.wp-block-group.fd-article-hero.is-layout-constrained {
	padding-top: 3.5rem;
	padding-bottom: 2.0625rem;
}

.wp-block-group.fd-article-hero.is-layout-constrained > * {
	max-width: 53.75rem;
	margin-inline: max(0px, calc((100% - 53.75rem) / 2)) auto !important;
}

.wp-block-group.fd-article-hero.is-layout-constrained > .wp-block-post-title {
	max-width: 44rem;
	margin-block: 0;
	/*
	 * Handoff 16.5: about 32 px on a phone, growing with the width to the drawn 46 px (set again from 1024).
	 * Words never split: core's post-title break-word is reset; the longest word (implementation, 8.05 em)
	 * is about 258 px at 32 px, well inside a 360 px screen.
	 */
	font-size: clamp(2rem, 1.2rem + 2.5vw, 2.875rem) !important;
	line-height: 1.1;
	word-break: normal;
	overflow-wrap: normal;
	hyphens: manual;
}

.fd-article-hero .wp-block-flydoo-article-meta {
	margin-block: 0;
}

.wp-block-group.fd-article-body.is-layout-constrained {
	padding-top: 3rem;
}

.fd-article-layout > *,
.fd-article-main > *,
.fd-article-aside > * {
	margin-block: 0;
}

.fd-article-layout {
	display: grid;
	gap: var(--wp--preset--spacing--32);
}

.fd-article-aside {
	display: grid;
	gap: var(--wp--preset--spacing--24);
	align-content: start;
}

.fd-article-aside .wp-block-flydoo-legal-toc {
	margin: 0;
}

/* The contents list is plain text on the page, not a tinted box. */
.fd-article-aside .fd-legal-toc {
	padding: 0;
	background: none;
}

.fd-article-aside .fd-legal-toc__label {
	margin-bottom: 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
}

/* Rows stay 44 px on touch layouts; the drawn 26 px rows start at 1024 px. */
.fd-article-aside .fd-legal-toc__list a {
	color: var(--wp--preset--color--text-primary);
	font-size: 0.875rem;
}

.fd-article-calc {
	box-sizing: border-box;
	max-width: 16.25rem;
	padding: 1.0625rem 1.25rem;
	border-radius: var(--wp--custom--radius--lg);
	background: var(--wp--preset--color--surface-inverse);
	color: var(--wp--preset--color--text-on-inverse);
}

.fd-article-calc p {
	margin: 0;
	line-height: 1.4;
}

.fd-article-calc__title {
	font-size: 0.9375rem;
}

.fd-article-calc__text {
	margin-top: 0.25rem !important;
	color: var(--wp--preset--color--text-on-inverse-muted);
	font-size: 0.8125rem;
}

.fd-article-calc__link {
	margin-top: 0.5rem !important;
	font-size: 0.875rem;
	font-weight: 700;
}

/* A 44 px hit area on touch layouts; the negative block margins keep the drawn
   line position. The drawn text-only link starts at 1024 px. */
.fd-article-calc__link a {
	display: inline-flex;
	align-items: center;
	min-block-size: 2.75rem;
	margin-block: calc((2.75rem - 1.4em) / -2);
	color: var(--wp--preset--color--cta-primary);
}

/* The article body: one rhythm for everything inside post-content. */
.fd-article-content {
	font-size: 1.0625rem;
	line-height: 1.8;
}

.fd-article-content > * {
	margin-block: 0 1.0625rem;
}

.fd-article-content > h2,
.fd-article-content > .wp-block-flydoo-faq > .fd-section-intro .fd-section-intro__heading {
	margin-top: 1.375rem;
}

.fd-article-content h2 {
	margin-block-end: 0.8rem;
	font-size: 1.8rem;
	line-height: 1.7;
}

/* QA audit 2 re-measure (Article.png at 1440): heading to text 35 px and text to the next heading 47 px. */
@media (min-width: 768px) {

	.fd-article-content h2 {
		margin-block-end: 1.125rem;
		line-height: 1.2;
	}

	.fd-article-content > h2,
	.fd-article-content > .wp-block-flydoo-faq > .fd-section-intro .fd-section-intro__heading {
		margin-top: 2.125rem;
	}
}

.fd-article-answer {
	margin-bottom: 0 !important;
	padding: 1.5rem;
	border-radius: var(--wp--custom--radius--lg);
	background: var(--wp--preset--color--brand-soft);
}

.fd-article-answer h2 {
	margin: 0 0 0.75rem !important;
	font-size: 1.0625rem;
	line-height: 1.3;
}

.fd-article-answer p {
	margin: 0;
	line-height: 1.8;
}

@media (min-width: 768px) {

	.fd-article-answer p {
		line-height: 1.85;
	}
}

.wp-block-table.fd-article-table {
	overflow-x: auto;
	border: 1px solid var(--wp--preset--color--line-default);
	border-radius: var(--wp--custom--radius--lg);
}

.wp-block-table.fd-article-table thead {
	border-bottom: 0;
}

.wp-block-table.fd-article-table table {
	width: 100%;
	table-layout: auto !important;
	margin: 0;
	border-collapse: collapse;
	font-size: 0.9375rem;
	line-height: 1.7;
}

.wp-block-table.fd-article-table th,
.wp-block-table.fd-article-table td {
	padding: 0.8rem 0.5rem 0.8rem 0;
	border: 0;
	border-top: 1px solid var(--wp--preset--color--line-default);
	text-align: left;
}

.wp-block-table.fd-article-table th:first-child,
.wp-block-table.fd-article-table td:first-child {
	width: 42%;
	padding-inline: 1rem 0;
}

.wp-block-table.fd-article-table th:last-child,
.wp-block-table.fd-article-table td:last-child {
	padding-right: 1rem;
}

.wp-block-table.fd-article-table thead th {
	border-top: 0;
	background: var(--wp--preset--color--surface-sunken);
	font-size: 0.875rem;
	font-weight: 700;
}

.wp-block-group.fd-article-body.is-layout-constrained {
	padding-bottom: 5rem;
}

/* The closing band: heading and two buttons, centred. */
.wp-block-group.fd-article-cta {
	padding-block: 4.25rem;
}

.fd-article-cta h2.wp-block-heading {
	font-size: 2.375rem;
	line-height: 1.1;
}

.fd-article-cta .wp-block-buttons {
	gap: 0.875rem;
	margin-top: 1.5rem;
}

.fd-article-cta .wp-block-button__link {
	min-height: 3.25rem;
	/* QA audit 2: the body face, bold, as on the other inner pages (audit 1 S8). */
	font-family: var(--wp--preset--font-family--body);
	font-weight: 700;
}

/* QA audit 2: the article text is the body grey (text-body), headings stay navy. */
.fd-article-content :is(p, li, td, th),
.fd-article-answer p {
	color: var(--wp--preset--color--text-body);
}

@media (min-width: 768px) {

	.wp-block-table.fd-article-table th,
	.wp-block-table.fd-article-table td {
		padding-inline: 1.25rem;
	}

	.wp-block-table.fd-article-table th:first-child,
	.wp-block-table.fd-article-table td:first-child {
		width: auto;
	}
}

@media (min-width: 1024px) {

	.fd-article-layout {
		grid-template-columns: 16.25rem minmax(0, 1fr);
		column-gap: 3rem;
	}

	.wp-block-group.fd-article-hero.is-layout-constrained > .wp-block-post-title {
		font-size: 2.875rem !important;
		line-height: 1.1;
	}

	.fd-article-aside {
		position: sticky;
		top: 5rem;
	}

	.fd-article-aside .fd-legal-toc__list a {
		min-block-size: 1.625rem;
	}

	.fd-article-calc__link a {
		display: inline;
		min-block-size: 0;
		margin-block: 0;
	}
}

.fd-article-content > .wp-block-flydoo-faq {
	margin-top: 1.875rem;
}

/*
 * Handoff 14.4 (board "Article template", 20 November): breadcrumb, topic label, H1 and the author line
 * on white; three columns from 1024 (sticky contents on the left, the text, related links and the
 * talk card on the right); "The short answer" as a grey box with a blue left border; the author bio
 * as a grey card at the end.
 */
.wp-block-group.fd-article-hero.is-layout-constrained {
	padding-top: 2.5rem;
	padding-bottom: 1.5rem;
}

.wp-block-group.fd-article-hero.is-layout-constrained > * {
	max-width: var(--wp--style--global--wide-size, 76rem);
	margin-inline: auto !important;
}

.wp-block-group.fd-article-hero.is-layout-constrained > .wp-block-post-title {
	max-width: var(--wp--style--global--wide-size, 76rem);
	margin-block: 0.75rem 1.5rem;
}

/*
 * Handoff 16.5 (24 November): the H1 used padding-inline-end: calc(100% - 44rem) to keep its text
 * to 44rem, but a padding percentage is taken from the section, not the title, so the title shrank
 * as the screen widened (one word per line at 1920). Now the box itself is at most 44rem, no
 * padding, and its left edge sits on the wide column like the breadcrumb and the byline.
 */
.wp-block-group.fd-article-hero.is-layout-constrained > .wp-block-post-title {
	width: 100%;
	max-width: 44rem;
	margin-inline: max(0px, calc((100% - var(--wp--style--global--wide-size, 76rem)) / 2)) auto !important;
	padding: 0;
}

.fd-article-crumb {
	font-size: var(--wp--preset--font-size--small);
}

.fd-article-crumb a {
	color: var(--wp--preset--color--brand-primary);
	text-decoration: none;
}

.fd-article-crumb a:hover {
	text-decoration: underline;
}

.fd-article-label {
	margin: 0.75rem 0 0;
	color: var(--wp--preset--color--badge-agent);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.fd-article-byline {
	display: flex;
	gap: 0.875rem;
	align-items: center;
}

.fd-article-byline__photo img,
.fd-article-byline__img {
	display: block;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	object-fit: cover;
}

.fd-article-byline__text {
	display: grid;
	gap: 0.125rem;
	margin: 0;
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.45;
}

.fd-article-byline__name {
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--body, 1rem);
}

.fd-article-byline__name a {
	color: inherit;
	text-decoration: none;
}

.fd-article-byline__name a:hover {
	text-decoration: underline;
}

.wp-block-group.fd-article-body.is-layout-constrained {
	padding-top: 1rem;
}

.wp-block-group.fd-article-body.is-layout-constrained > .fd-article-layout {
	max-width: var(--wp--style--global--wide-size, 76rem);
	margin-inline: auto !important;
}

/* The short answer: label in small capitals, the answer larger. */
.fd-article-answer {
	padding: 1.5rem 1.75rem;
	border-left: 4px solid var(--wp--preset--color--brand-primary);
	border-radius: var(--wp--custom--radius--md, 14px);
	background: var(--wp--preset--color--surface-sunken);
}

.fd-article-answer h2 {
	margin: 0 0 0.5rem !important;
	color: var(--wp--preset--color--brand-primary);
	font-family: var(--wp--preset--font-family--body, inherit);
	font-size: var(--wp--preset--font-size--caption) !important;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.fd-article-answer p {
	color: var(--wp--preset--color--text-primary);
	font-size: 1.1875rem;
	line-height: 1.6;
}

/* One call to action inside the text: a white card with a link on the right. */
.fd-article-inline-cta {
	display: grid;
	gap: 0.5rem;
	align-items: center;
	padding: 1.25rem 1.5rem;
	border: 1px solid var(--wp--preset--color--line-default);
	border-radius: var(--wp--custom--radius--md, 14px);
}

.fd-article-inline-cta > * {
	margin: 0 !important;
}

/* The related links and the talk card. */
.fd-article-rail {
	display: grid;
	gap: 1rem;
	align-content: start;
}

.fd-article-rail > * {
	margin: 0;
}

.fd-article-related__label {
	margin: 0 0 0.75rem;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.fd-article-related__list {
	display: grid;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* The rail is one column at every width (the block sheet still lays the list out in three from 768px) */
.fd-article-rail .fd-article-related__list {
	grid-template-columns: minmax(0, 1fr);
}

.fd-article-related__item {
	position: relative;
	padding: 1rem 1.125rem;
	border: 1px solid var(--wp--preset--color--line-default);
	border-radius: var(--wp--custom--radius--md, 14px);
	background: var(--wp--preset--color--surface-raised);
}

.fd-article-related__kind {
	margin: 0 0 0.25rem;
	color: var(--wp--preset--color--badge-agent);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.fd-article-related__item--case .fd-article-related__kind {
	color: var(--wp--preset--color--brand-primary);
}

.fd-article-related__item--service .fd-article-related__kind {
	color: var(--wp--preset--color--status-included);
}

.fd-article-related__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--body, 1rem);
	line-height: 1.3;
}

.fd-article-related__title a {
	color: var(--wp--preset--color--text-primary);
	text-decoration: none;
}

.fd-article-talk {
	padding: 1.25rem 1.25rem 1.375rem;
	border-radius: var(--wp--custom--radius--md, 14px);
	background: var(--wp--preset--color--surface-inverse);
	color: var(--wp--preset--color--text-on-inverse);
}

.fd-article-talk p {
	margin: 0;
}

.fd-article-talk__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
}

.fd-article-talk__link {
	margin-top: 0.5rem !important;
}

.fd-article-talk__link a {
	color: var(--wp--preset--color--cta-primary);
	font-weight: 700;
	text-decoration: none;
}

/* The author bio card at the end. */
.fd-article-author {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	margin-top: 2.5rem !important;
	padding: 1.5rem;
	border-radius: var(--wp--custom--radius--lg, 20px);
	background: var(--wp--preset--color--surface-sunken);
}

.fd-article-author__photo img,
.fd-article-author__img {
	display: block;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	object-fit: cover;
}

.fd-article-author__body p {
	margin: 0;
}

.fd-article-author__name {
	color: var(--wp--preset--color--text-primary);
	font-weight: 700;
}

.fd-article-author__text {
	margin-top: 0.25rem !important;
	color: var(--wp--preset--color--text-secondary);
	line-height: 1.55;
}

.fd-article-author__more {
	margin-top: 0.5rem !important;
}

.fd-article-author__more a {
	color: var(--wp--preset--color--brand-primary);
	font-weight: 600;
	text-decoration: none;
}

@media (min-width: 768px) {

	.fd-article-inline-cta {
		grid-template-columns: minmax(0, 1fr) auto;
	}
}

@media (min-width: 1024px) {

	.fd-article-layout {
		grid-template-columns: 13.75rem minmax(0, 1fr) 15rem;
		column-gap: 2.5rem;
	}

	.fd-article-rail {
		position: sticky;
		top: 5rem;
	}
}

/* Article diagrams (handoff 14.6): five jobs, a service request, Claude-person-Odoo, rebuilt as blocks in the site colours */
.fd-dia {
	--fd-dia-agent: var(--wp--preset--color--badge-agent);
	--fd-dia-odoo: var(--wp--preset--color--method-ochre);
	--fd-dia-person: var(--wp--preset--color--brand-primary);
	--fd-dia-automation: var(--wp--preset--color--status-included);
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
	margin-block: var(--wp--preset--spacing--32);
	padding: var(--wp--preset--spacing--24);
	border: 1px solid var(--wp--preset--color--line-default);
	border-radius: var(--wp--custom--radius--lg);
	background: var(--wp--preset--color--surface-raised);
}

.fd-dia p {
	margin: 0;
}

.fd-dia .fd-dia__title {
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}

.fd-dia .fd-dia__note {
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--caption);
}

.fd-dia .fd-dia__band {
	padding: 0.5rem 0.75rem;
	border-radius: var(--wp--custom--radius--sm, 8px);
	background: var(--wp--preset--color--surface-sunken);
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--caption);
	text-align: center;
}

.fd-dia-jobs__grid,
.fd-dia-loop__steps,
.fd-dia-flow__steps {
	display: grid;
	gap: 0.75rem;
}

.fd-dia-flow__steps {
	counter-reset: fd-dia-step;
}

.fd-dia-card {
	--fd-dia-role: var(--wp--preset--color--line-strong);
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	padding: 0.875rem 1rem;
	border: 1px solid var(--wp--preset--color--line-default);
	border-top: 3px solid var(--fd-dia-role);
	border-radius: var(--wp--custom--radius--md, 14px);
	background: var(--wp--preset--color--surface-page);
}

.fd-dia-card.is-agent,
.fd-dia-step.is-agent {
	--fd-dia-role: var(--fd-dia-agent);
}

.fd-dia-card.is-odoo,
.fd-dia-step.is-odoo {
	--fd-dia-role: var(--fd-dia-odoo);
}

.fd-dia-card.is-person,
.fd-dia-step.is-person {
	--fd-dia-role: var(--fd-dia-person);
}

.fd-dia-step.is-automation {
	--fd-dia-role: var(--fd-dia-automation);
}

.fd-dia .fd-dia-card__title {
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.4;
}

.fd-dia .fd-dia-card__text {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--caption);
	line-height: 1.5;
}

.fd-dia .fd-dia-card__apps {
	margin-top: auto;
	color: var(--wp--preset--color--brand-primary);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 600;
}

.fd-dia-step {
	--fd-dia-role: var(--wp--preset--color--line-strong);
	position: relative;
	display: grid;
	grid-template-columns: 7.5rem minmax(0, 1fr);
	gap: 0.75rem;
	align-items: center;
}

.fd-dia-step + .fd-dia-step::before {
	position: absolute;
	top: -0.75rem;
	left: 3.75rem;
	width: 1px;
	height: 0.75rem;
	background: var(--wp--preset--color--line-strong);
	content: "";
}

.fd-dia .fd-dia-step__who {
	padding: 0.4rem 0.5rem;
	border: 1px solid var(--fd-dia-role);
	border-radius: var(--wp--custom--radius--sm, 8px);
	background: color-mix(in srgb, var(--fd-dia-role) 12%, var(--wp--preset--color--surface-page));
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 700;
	text-align: center;
}

.fd-dia .fd-dia-step__what {
	padding: 0.55rem 0.875rem;
	border: 1px solid var(--wp--preset--color--line-default);
	border-radius: var(--wp--custom--radius--sm, 8px);
	background: var(--wp--preset--color--surface-page);
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--caption);
	line-height: 1.5;
}

.fd-dia-loop .fd-dia-card {
	border-top-width: 1px;
	border-color: var(--fd-dia-role);
	background: color-mix(in srgb, var(--fd-dia-role) 8%, var(--wp--preset--color--surface-page));
}

.fd-article-sources {
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
}

@media (min-width: 640px) {

	.fd-dia-jobs__grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.fd-dia-jobs__grid > .fd-dia-card {
		grid-column: span 2;
	}

	.fd-dia-jobs__grid > .fd-dia-card:nth-child(4) {
		grid-column: 2 / span 2;
	}

	.fd-dia-loop__steps {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1.5rem;
	}

	.fd-dia-loop .fd-dia-card + .fd-dia-card::before {
		position: absolute;
		top: 50%;
		left: -1.25rem;
		color: var(--wp--preset--color--text-muted);
		content: "→";
	}

	.fd-dia-loop .fd-dia-card {
		position: relative;
	}
}
