/*
 * Four Directions theme components.
 * Tokens come from theme.json (var(--wp--preset--*) and var(--wp--custom--*)).
 * Keep selectors flat (single class) so components don't fight each other.
 */

/* ---------- Base ---------- */

html { -webkit-text-size-adjust: 100%; }

body { font-optical-sizing: auto; text-rendering: optimizeLegibility; }

h1, h2, h3, h4,
.wp-block-site-title,
.wp-block-navigation,
.wp-block-button__link,
.fd-ui {
	font-feature-settings: "kern", "lnum";
}

h1 { font-stretch: 78%; font-weight: 760; text-wrap: balance; }
h2 { font-stretch: 88%; text-wrap: balance; }
h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

.wp-block-site-title { font-stretch: 85%; }

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

/* Body copy measure: keep reading lines under ~75 characters. */
.entry-content > p,
.entry-content > ul,
.entry-content > ol,
.entry-content > h2,
.entry-content > h3 { max-width: var(--wp--custom--measure--content); }
.wp-block-post-title { max-width: 22ch; margin-left: 0 !important; }

/*
 * Prose wrapper: every section shares the wide container's left edge, and
 * running text keeps a readable measure inside it.
 */
.fd-prose > :where(p, h2, h3, ul, ol, .wp-block-buttons, .wp-block-details) {
	max-width: var(--wp--custom--measure--content);
}
.fd-prose > :where(.fd-rows, .fd-faq) { max-width: 60rem; }
.fd-prose > :where(.is-style-fd-steps, .wp-block-table) { max-width: none; }
.fd-prose > h2 { margin-top: 0; }

/* ---------- Focus and accessibility ---------- */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: var(--wp--custom--focus--width) solid var(--wp--preset--color--brand);
	outline-offset: var(--wp--custom--focus--offset);
	box-shadow: 0 0 0 calc(var(--wp--custom--focus--offset) + var(--wp--custom--focus--width) + 2px) var(--wp--preset--color--accent);
	border-radius: 2px;
}

.fd-section--dark :where(a, button, summary):focus-visible {
	outline-color: var(--wp--preset--color--accent);
	box-shadow: none;
}

.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 650;
	padding: 0.75rem 1rem;
	z-index: 100000;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

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

.fd-header {
	position: relative;
	border-bottom: 1px solid var(--wp--preset--color--rule);
	background: var(--wp--preset--color--surface);
}
/* Signature strip: the logo's quadrant colors, clockwise from top-left (white shown as navy). */
.fd-header::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 4px;
	background: linear-gradient(90deg,
		var(--wp--preset--color--navy) 0 25%,
		var(--wp--preset--color--teal) 25% 50%,
		var(--wp--preset--color--accent) 50% 75%,
		var(--wp--preset--color--signal) 75% 100%);
}

.fd-header .wp-block-navigation a { text-decoration: none; }
.fd-header .wp-block-navigation a:hover { text-decoration: underline; text-underline-offset: 0.3em; }

.fd-header .wp-block-navigation .current-menu-item > a,
.fd-header .wp-block-navigation [aria-current="page"] {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.3em;
}

.fd-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: 1.5rem clamp(1rem, 4vw, 2.5rem);
}

.fd-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	font-size: 1.25rem;
	padding-block: 0.25rem;
}

.fd-header .wp-block-navigation__responsive-container-open,
.fd-header .wp-block-navigation__responsive-container-close {
	min-width: 44px;
	min-height: 44px;
	justify-content: center;
}

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

.wp-block-button__link { min-height: 44px; display: inline-flex; align-items: center; }

.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--brand);
	border: 2px solid currentColor;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--surface-alt);
	color: var(--wp--preset--color--navy);
}

.fd-section--dark .wp-block-button__link {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
}
.fd-section--dark .wp-block-button__link:hover {
	background: #FFE08F;
	border-color: #FFE08F;
	color: var(--wp--preset--color--ink);
}
.fd-section--dark .wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--surface);
	border-color: var(--wp--preset--color--surface);
}
.fd-section--dark .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: rgba(255, 255, 255, 0.12);
}

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

.fd-section--alt { background: var(--wp--preset--color--surface-alt); }

.fd-section--dark {
	background: var(--wp--preset--color--navy);
	color: #E9EFF5;
}
.fd-section--dark :where(h1, h2, h3, h4) { color: var(--wp--preset--color--surface); }
.fd-section--dark a:where(:not(.wp-block-button__link)) { color: #FFFFFF; }

/* ---------- Service hero + title block ---------- */

.fd-hero {
	border-bottom: 1px solid var(--wp--preset--color--rule);
}

.fd-hero__kicker {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 1rem;
	color: var(--wp--preset--color--brand);
	margin: 0;
}
.fd-hero__kicker a { text-decoration: none; }
.fd-hero__kicker a:hover { text-decoration: underline; }

.fd-hero h1 { margin-top: 0.5rem; max-width: 13ch; overflow-wrap: normal; word-break: normal; hyphens: manual; }

.fd-hero__lead {
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.5;
	max-width: 34rem;
	color: var(--wp--preset--color--ink);
}

/*
 * Title block: modeled on the title block of an engineering drawing.
 * It carries real document metadata (scope, coverage, review date), not decoration.
 */
.fd-title-block {
	font-family: var(--wp--preset--font-family--display);
	background: var(--wp--preset--color--surface);
	border: 2px solid var(--wp--preset--color--ink);
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.35;
}
.fd-title-block { overflow: hidden; }
.fd-title-block__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin: 0;
}
/* Internal ruling only: each cell draws its top and left line, offset under the outer frame. */
.fd-title-block__cell {
	padding: 0.7rem 0.9rem 0.8rem;
	border-top: 1px solid var(--wp--preset--color--ink);
	border-left: 1px solid var(--wp--preset--color--ink);
	margin: -1px 0 0 -1px;
}
.fd-title-block__cell--full { grid-column: 1 / -1; }
.fd-title-block dt {
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--wp--preset--color--muted);
	margin: 0 0 0.2rem;
}
.fd-title-block dd {
	margin: 0;
	font-weight: 620;
	color: var(--wp--preset--color--ink);
}
.fd-title-block__name dd {
	font-size: 1.35rem;
	font-weight: 760;
	font-stretch: 82%;
	line-height: 1.15;
}
.fd-title-block__note {
	background: var(--wp--preset--color--surface-alt);
	border-top: 1px solid var(--wp--preset--color--ink);
	padding: 0.7rem 0.9rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.875rem;
	line-height: 1.45;
	color: var(--wp--preset--color--ink);
	margin: 0;
}

/* ---------- Breadcrumbs ---------- */

.fd-breadcrumbs { font-family: var(--wp--preset--font-family--display); font-size: 0.9rem; }
.fd-breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.fd-breadcrumbs li { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--wp--preset--color--muted); }
.fd-breadcrumbs li + li::before { content: "/"; color: var(--wp--preset--color--rule); }
.fd-breadcrumbs a { color: var(--wp--preset--color--brand); text-decoration: none; }
.fd-breadcrumbs a:hover { text-decoration: underline; }

/* ---------- Use-case list (definition-style rows) ---------- */

.fd-rows { border-top: 2px solid var(--wp--preset--color--ink); }
.fd-rows > .wp-block-group,
.fd-rows > .wp-block-columns {
	border-bottom: 1px solid var(--wp--preset--color--rule);
	padding-block: 1.1rem;
	margin: 0 !important;
}
.fd-rows h3 { font-size: 1.2rem; margin: 0; }
.fd-rows p { margin: 0; }

/* ---------- Comparison table ---------- */

:is(.fd-compare, .is-style-fd-compare) { overflow-x: auto; }
:is(.fd-compare, .is-style-fd-compare) table { border-collapse: collapse; width: 100%; min-width: 44rem; background: var(--wp--preset--color--surface); }
:is(.fd-compare, .is-style-fd-compare) thead { border-bottom: 2px solid var(--wp--preset--color--ink); }
:is(.fd-compare, .is-style-fd-compare) th, :is(.fd-compare, .is-style-fd-compare) td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--rule);
	padding: 0.85rem 0.9rem;
	text-align: left;
	vertical-align: top;
}
:is(.fd-compare, .is-style-fd-compare) thead th { font-weight: 650; font-size: 0.875rem; color: var(--wp--preset--color--muted); }
:is(.fd-compare, .is-style-fd-compare) tbody td:first-child { font-weight: 650; color: var(--wp--preset--color--ink); }
:is(.fd-compare, .is-style-fd-compare) figcaption { text-align: left; margin-top: 0.75rem; font-family: var(--wp--preset--font-family--body); }

/* ---------- Process steps (a real sequence, so numbering is meaningful) ---------- */

:is(.fd-steps, .is-style-fd-steps) {
	counter-reset: fd-step;
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: 0;
	margin-top: var(--wp--preset--spacing--50);
	border-top: 2px solid var(--wp--preset--color--ink);
}
:is(.fd-steps, .is-style-fd-steps) > li {
	counter-increment: fd-step;
	padding: 1rem 1.1rem 1.25rem 0;
	margin: 0;
}
:is(.fd-steps, .is-style-fd-steps) > li + li { padding-left: 1.1rem; border-left: 1px solid var(--wp--preset--color--rule); }
:is(.fd-steps, .is-style-fd-steps) > li::before {
	content: counter(fd-step);
	display: block;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 760;
	font-size: 0.95rem;
	color: var(--wp--preset--color--brand);
	margin-bottom: 0.35rem;
}
:is(.fd-steps, .is-style-fd-steps) strong {
	display: block;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.2rem;
	font-weight: 700;
	margin-bottom: 0.3rem;
}
@media (max-width: 781px) {
	:is(.fd-steps, .is-style-fd-steps) > li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--wp--preset--color--rule); }
}

/* ---------- Checklist ---------- */

:is(.fd-checklist, .is-style-fd-checklist) { list-style: none; padding: 0; margin: 0; }
:is(.fd-checklist, .is-style-fd-checklist) li {
	position: relative;
	padding: 0.85rem 0 0.85rem 2rem;
	border-bottom: 1px solid var(--wp--preset--color--rule);
}
:is(.fd-checklist, .is-style-fd-checklist) li::before {
	content: "";
	position: absolute;
	left: 0.2rem;
	top: 1.15rem;
	width: 0.85rem;
	height: 0.85rem;
	border: 2px solid var(--wp--preset--color--brand);
}
:is(.fd-checklist, .is-style-fd-checklist) strong { font-family: var(--wp--preset--font-family--display); font-weight: 680; }

/* ---------- Notices and callouts ---------- */

.fd-notice {
	border-left: 4px solid var(--wp--preset--color--brand);
	background: var(--wp--preset--color--surface);
	padding: 1rem 1.25rem;
}
.fd-notice--sensitive { border-left-color: var(--wp--preset--color--warning); background: #FBF5E6; font-size: 0.975rem; line-height: 1.5; }
.fd-notice p { margin: 0; }
.fd-notice p + p { margin-top: 0.5rem; }
.fd-notice__title {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 1rem;
}

:is(.fd-callout, .is-style-fd-callout) {
	border: 2px solid var(--wp--preset--color--brand);
	background: var(--wp--preset--color--surface);
	padding: clamp(1.25rem, 3vw, 2rem);
}

/* ---------- FAQ ---------- */

.fd-faq .wp-block-details summary {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 650;
	font-size: 1.15rem;
	cursor: pointer;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding-block: 0.25rem;
	min-height: 44px;
}
.fd-faq .wp-block-details summary::-webkit-details-marker { display: none; }
.fd-faq .wp-block-details summary::after {
	content: "+";
	flex: none;
	width: 1.75rem;
	height: 1.75rem;
	display: grid;
	place-items: center;
	border: 2px solid var(--wp--preset--color--brand);
	color: var(--wp--preset--color--brand);
	font-weight: 700;
	line-height: 1;
}
.fd-faq .wp-block-details[open] summary::after { content: "\2212"; }
.fd-faq .wp-block-details > :not(summary) { margin-top: 0.75rem; max-width: var(--wp--custom--measure--content); }
.fd-faq > .wp-block-details:first-of-type { border-top: 2px solid var(--wp--preset--color--ink); }

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

.fd-footer {
	background: var(--wp--preset--color--navy-deep);
	color: #D5DDE4;
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.95rem;
}
.fd-footer :where(h2, h3) { color: #FFFFFF; font-size: 1rem; font-weight: 700; }
.fd-footer a { color: #FFFFFF; text-decoration: none; }
.fd-footer a:hover { text-decoration: underline; }
.fd-footer .wp-block-navigation { font-size: 0.95rem; font-weight: 450; }
.fd-footer .wp-block-site-title a { color: #FFFFFF; }
.fd-footer__fine { border-top: 1px solid #2E3345; color: #AAB6C1; font-size: 0.85rem; }
.fd-footer :where(a, button):focus-visible { outline-color: var(--wp--preset--color--accent); box-shadow: none; }

/* ---------- Admin-only configuration notice (rendered by fourdirections-core) ---------- */

.fd-config-notice {
	border: 2px dashed var(--wp--preset--color--warning);
	background: #FBF5E6;
	color: var(--wp--preset--color--ink);
	padding: 0.5rem 0.75rem;
	font-size: 0.85rem;
}

/* ---------- Utilities ---------- */

.fd-measure { max-width: var(--wp--custom--measure--content); }
.fd-muted { color: var(--wp--preset--color--muted); }

/*
 * Small screens: the header button gives way to a "Request a quote" item inside
 * the mobile menu, so the wordmark never wraps.
 */
.fd-header .fd-nav-quote { display: none; }
@media (max-width: 599px) {
	.fd-header .fd-header__cta { display: none; }
	.fd-header .wp-block-navigation__responsive-container.is-menu-open .fd-nav-quote { display: flex; }
}

/*
 * Tablets and narrow laptop windows (600–1099 px): the full menu doesn't fit
 * on one line, so use the menu button here too. Core switches at 600 px only.
 */
@media (min-width: 600px) and (max-width: 1099px) {
	.fd-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.fd-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
	.fd-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close { display: flex; }
	.fd-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
	.fd-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
		flex-direction: column;
		align-items: flex-start;
	}
}
.fd-brand { white-space: nowrap; }

/* ---------- Brand lockup (logo mark + wordmark) ---------- */

.fd-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 760;
	font-stretch: 85%;
	font-size: 1.35rem;
	letter-spacing: -0.01em;
	line-height: 1;
}
.fd-brand:hover { color: var(--wp--preset--color--ink); text-decoration: none; }
.fd-brand img { width: 2.25rem; height: 2.25rem; display: block; }
.fd-footer .fd-brand { color: #FFFFFF; }
.fd-brand-wrap { margin: 0; display: flex; align-items: center; }
@media (max-width: 599px) {
	.fd-brand { font-size: 1.1rem; gap: 0.45rem; }
	.fd-brand img { width: 1.9rem; height: 1.9rem; }
}
.fd-header .is-layout-flex { align-items: center; }

/* ---------- Page banner (decorative) ---------- */

.fd-banner { margin-top: 0 !important; margin-bottom: 0 !important; line-height: 0; background: var(--wp--preset--color--navy); }
.fd-banner + .fd-hero { margin-block-start: 0 !important; }
.fd-banner img {
	display: block;
	width: 100%;
	height: clamp(120px, 17vw, 280px);
	object-fit: cover;
}

/* ---------- Information graphics (inline SVG, wide and narrow layouts) ---------- */

.fd-graphic { margin: var(--wp--preset--spacing--50) 0 var(--wp--preset--spacing--60); }
.fd-graphic svg { display: block; width: 100%; height: auto; overflow: visible; }
.fd-graphic text { font-family: var(--wp--preset--font-family--display); }
.fd-graphic__narrow { display: none; max-width: 30rem; }
@media (max-width: 700px) {
	.fd-graphic__wide { display: none; }
	.fd-graphic__narrow { display: block; }
}
.fd-graphic figcaption,
.fd-matrix figcaption {
	margin-top: 0.85rem;
	max-width: var(--wp--custom--measure--content);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
}

/* ---------- Data matrix (real table, styled as a graphic) ---------- */

.fd-matrix { margin: var(--wp--preset--spacing--50) 0; }
.fd-matrix__scroll { overflow-x: auto; position: relative; } /* contains the absolutely positioned screen-reader text */
.fd-matrix table {
	width: 100%;
	min-width: 40rem;
	border-collapse: separate;
	border-spacing: 4px;
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.95rem;
	line-height: 1.35;
}
.fd-matrix caption {
	text-align: left;
	font-weight: 700;
	font-size: 1.15rem;
	padding-bottom: 0.6rem;
}
.fd-matrix th, .fd-matrix td { padding: 0.75rem 0.8rem; text-align: left; vertical-align: top; }
.fd-matrix thead th { font-size: 0.85rem; font-weight: 650; vertical-align: bottom; }
.fd-matrix tbody th { font-weight: 700; width: 18%; }
.fd-matrix__sym {
	display: inline-grid;
	place-items: center;
	width: 1.35em;
	height: 1.35em;
	margin-right: 0.35rem;
	font-weight: 800;
	font-size: 0.85em;
	vertical-align: 0.05em;
	color: #FFFFFF !important;
}
.fd-matrix__yes  { background: #E2F0E8; color: var(--wp--preset--color--ink); }
.fd-matrix__yes  .fd-matrix__sym { background: var(--wp--preset--color--success); }
.fd-matrix__cond { background: #FFF1CC; color: var(--wp--preset--color--ink); }
.fd-matrix__cond .fd-matrix__sym { background: var(--wp--preset--color--warning); }
.fd-matrix__no   { background: #F8E1DE; color: var(--wp--preset--color--ink); }
.fd-matrix__no   .fd-matrix__sym { background: var(--wp--preset--color--error); }

.fd-section--dark .fd-matrix caption,
.fd-section--dark .fd-matrix thead th,
.fd-section--dark .fd-matrix tbody th { color: #FFFFFF; }
.fd-section--dark .fd-matrix figcaption { color: #C9D2DC; }
.fd-matrix__scroll:focus-visible { outline: 3px solid var(--wp--preset--color--accent); outline-offset: 4px; }

/* Small screens: each data class becomes a card; cells carry their column name. */
@media (max-width: 700px) {
	.fd-matrix table, .fd-matrix tbody, .fd-matrix tr, .fd-matrix th, .fd-matrix td { display: block; width: auto; min-width: 0; }
	.fd-matrix table { border-spacing: 0; }
	.fd-matrix caption { display: block; width: auto; }
	.fd-matrix thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.fd-matrix tbody tr { margin-bottom: 1rem; }
	.fd-matrix tbody th { width: auto; padding: 0.5rem 0; font-size: 1.05rem; }
	.fd-matrix td { margin-bottom: 4px; }
	.fd-matrix td::before {
		content: attr(data-label);
		display: block;
		font-size: 0.8rem;
		font-weight: 600;
		margin-bottom: 0.2rem;
		color: var(--wp--preset--color--muted);
	}
}

/* ---------- Lead forms (markup from fourdirections-core) ---------- */

.fd-form-wrap { scroll-margin-top: 1.5rem; }
.fd-form { font-family: var(--wp--preset--font-family--display); }
.fd-form__required-note { font-size: 0.9rem; color: var(--wp--preset--color--muted); margin: 0 0 1.25rem; }

.fd-field { margin: 0 0 1.35rem; border: 0; padding: 0; min-width: 0; }
.fd-field > label,
.fd-field > legend {
	display: block;
	font-weight: 650;
	font-size: 1rem;
	margin-bottom: 0.35rem;
	padding: 0;
	color: var(--wp--preset--color--ink);
}
.fd-field__req { font-weight: 500; color: var(--wp--preset--color--muted); }
.fd-field__help { font-size: 0.875rem; color: var(--wp--preset--color--muted); margin: 0 0 0.45rem; max-width: 38rem; }
.fd-field__error {
	font-size: 0.9rem;
	font-weight: 650;
	color: var(--wp--preset--color--error);
	margin: 0 0 0.45rem;
	padding-left: 0.6rem;
	border-left: 3px solid var(--wp--preset--color--error);
}

.fd-form input[type="text"],
.fd-form input[type="email"],
.fd-form input[type="tel"],
.fd-form input[type="date"],
.fd-form input[type="number"],
.fd-form select,
.fd-form textarea {
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	min-height: 46px;
	padding: 0.6rem 0.75rem;
	font: inherit;
	font-size: 1rem;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--surface);
	border: 2px solid #8C96A3;
	border-radius: var(--wp--custom--radius--control);
}
.fd-form textarea { min-height: 8rem; line-height: 1.5; resize: vertical; }
.fd-form input[type="number"] { max-width: 10rem; }
.fd-form input[type="date"] { max-width: 14rem; }
.fd-form :where(input, select, textarea):focus { border-color: var(--wp--preset--color--brand); }
.fd-field.has-error :where(input, select, textarea) { border-color: var(--wp--preset--color--error); }

.fd-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.25rem 1rem; }
.fd-check { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.4rem 0; font-size: 0.975rem; cursor: pointer; }
.fd-check input { width: 1.2rem; height: 1.2rem; margin: 0.15rem 0 0; accent-color: var(--wp--preset--color--brand); flex: none; }

.fd-form-more {
	border-top: 1px solid var(--wp--preset--color--rule);
	border-bottom: 1px solid var(--wp--preset--color--rule);
	margin: 0.5rem 0 1.5rem;
}
.fd-form-more > summary {
	cursor: pointer;
	font-weight: 650;
	padding: 0.9rem 0;
	min-height: 44px;
	color: var(--wp--preset--color--brand);
}
.fd-form-more__body { padding-top: 0.5rem; }

.fd-form__submit {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.05rem;
	font-weight: 650;
	min-height: 48px;
	padding: 0.8rem 1.6rem;
	color: #FFFFFF;
	background: var(--wp--preset--color--navy);
	border: 2px solid var(--wp--preset--color--navy);
	border-radius: var(--wp--custom--radius--control);
	cursor: pointer;
}
.fd-form__submit:hover { background: var(--wp--preset--color--brand); border-color: var(--wp--preset--color--brand); }
.fd-form__privacy { font-size: 0.85rem; color: var(--wp--preset--color--muted); margin-top: 1rem; }

/* Honeypot: off-screen for people, present for bots. */
.fd-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.fd-form-errors {
	border: 2px solid var(--wp--preset--color--error);
	background: #FCEFED;
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
}
.fd-form-errors__title { font-family: var(--wp--preset--font-family--display); font-weight: 750; margin: 0 0 0.4rem; }
.fd-form-errors ul { margin: 0; padding-left: 1.2rem; }
.fd-form-errors a { color: var(--wp--preset--color--error); font-weight: 600; }

.fd-form-success {
	border: 2px solid var(--wp--preset--color--success);
	border-left-width: 6px;
	background: #EAF4EE;
	padding: 1.25rem 1.5rem;
}
.fd-form-success__title { font-family: var(--wp--preset--font-family--display); font-weight: 750; font-size: 1.25rem; margin: 0 0 0.5rem; }

.fd-aside { border-top: 2px solid var(--wp--preset--color--ink); padding-top: 1rem; }
.fd-aside h2 { margin-top: 1.5rem; }
.fd-aside h2:first-child { margin-top: 0; }
.fd-aside-steps, .fd-aside-list { padding-left: 1.2rem; }
.fd-aside-steps li, .fd-aside-list li { margin-bottom: 0.5rem; }
.fd-business-info { font-family: var(--wp--preset--font-family--display); font-size: 1.1rem; }
.fd-aside .fd-business-info a { font-weight: 650; }
.fd-notice--sensitive { margin-bottom: 1.5rem; }

/* ---------- Homepage hero (generative art behind, copy on the calm left side) ---------- */

.fd-home-hero {
	background: var(--wp--preset--color--navy) url("../img/banners/home-hero.svg") right center / cover no-repeat;
	min-height: clamp(30rem, 72vh, 44rem);
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.fd-home-hero > .fd-home-hero__copy { max-width: var(--wp--style--global--wide-size, 76rem) !important; width: 100%; } /* share the logo's left edge */
.fd-home-hero__copy > * { max-width: 38rem; }
.fd-home-hero h1 {
	color: #FFFFFF;
	font-size: clamp(3rem, 7vw, 5.75rem);
	max-width: 9ch;
	margin: 0 0 1.25rem;
}
.fd-home-hero .fd-hero__lead { color: #DCE3EA; max-width: 34rem; }
@media (max-width: 781px) {
	.fd-home-hero {
		min-height: 0;
		background-position: 78% 0;
		background-size: auto 17rem;
		padding-top: 18rem !important;
	}
}

/* ---------- Four starting points (logo arrows point toward the center of the grid) ---------- */

.fd-quads > .wp-block-columns { margin-bottom: var(--wp--preset--spacing--50); gap: var(--wp--preset--spacing--60); }
.fd-quad {
	position: relative;
	border-top: 2px solid var(--wp--preset--color--ink);
	padding: 1.1rem 0 0 3.6rem;
	height: 100%;
}
.fd-quad::before {
	content: "";
	position: absolute;
	left: 0;
	top: 1.2rem;
	width: 2.6rem;
	height: 2.6rem;
	background: center / contain no-repeat;
}
.fd-quad--nw::before { background-image: url("../img/arrows/nw.svg"); }
.fd-quad--ne::before { background-image: url("../img/arrows/ne.svg"); }
.fd-quad--sw::before { background-image: url("../img/arrows/sw.svg"); }
.fd-quad--se::before { background-image: url("../img/arrows/se.svg"); }
.fd-quad h3 { margin: 0 0 0.5rem; font-size: 1.3rem; }
.fd-quad p { margin: 0 0 0.6rem; }
.fd-quad__links { font-family: var(--wp--preset--font-family--display); font-weight: 650; }

/* ---------- Workload spectrum (Linux migration) ---------- */

.fd-spectrum {
	list-style: none;
	margin: var(--wp--preset--spacing--50) 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 4px;
	font-family: var(--wp--preset--font-family--display);
}
.fd-spectrum li {
	background: var(--wp--preset--color--surface);
	border-top: 8px solid var(--fd-band, var(--wp--preset--color--brand));
	padding: 0.85rem 0.8rem 1rem;
	font-size: 0.9rem;
	line-height: 1.4;
}
.fd-spectrum strong { display: block; font-size: 1rem; margin-bottom: 0.35rem; }
.fd-spectrum__1 { --fd-band: #1B6A80; }
.fd-spectrum__2 { --fd-band: #49ABC4; }
.fd-spectrum__3 { --fd-band: #8FC7D6; }
.fd-spectrum__4 { --fd-band: #FED362; }
.fd-spectrum__5 { --fd-band: #CA2A1C; }
.fd-spectrum__6 { --fd-band: #8C96A3; }
.fd-spectrum-caption { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
@media (max-width: 900px) {
	.fd-spectrum { grid-template-columns: 1fr; }
	.fd-spectrum li { border-top: 0; border-left: 8px solid var(--fd-band, var(--wp--preset--color--brand)); }
}

/* ---------- Status box (time-sensitive, dated, sourced) ---------- */

.is-style-fd-callout { margin-block: var(--wp--preset--spacing--50); }
.is-style-fd-callout h2,
.is-style-fd-callout h3 { margin-top: 0; }
.fd-status-asof { font-family: var(--wp--preset--font-family--display); font-weight: 650; color: var(--wp--preset--color--brand); margin-top: 0; }
.fd-sources { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.fd-sources a { word-break: break-word; }

/* About and other reading pages: rows sit a little wider than the text measure. */
.entry-content > .fd-rows,
.entry-content > .fd-faq { max-width: 60rem; }
.entry-content > .wp-block-buttons { margin-top: var(--wp--preset--spacing--50); }
.fd-updated { display: flex; gap: 0.4rem; align-items: baseline; font-family: var(--wp--preset--font-family--display); font-size: 0.95rem; color: var(--wp--preset--color--muted); }
.fd-updated p { margin: 0; }

/* ==========================================================================
 * Two-column reading grid (owner direction, 2026-10-05: content should fill
 * the width; where it can't, center it).
 *
 * From 960 px up, every section (.fd-prose) and every reading page
 * (.fd-reading) becomes a 34/66 grid: section headings in the left column,
 * running text in the right column out to the container's right edge. The
 * split matches the 34%/66% definition rows (.fd-rows), so headings, row
 * titles and text share two edges down the whole page. Wide components span
 * both columns. Pure CSS: editors keep writing heading-then-text as usual.
 * ========================================================================== */
@media (min-width: 960px) {
	.fd-prose,
	.fd-reading {
		display: grid;
		grid-template-columns: minmax(0, 34fr) minmax(0, 66fr);
		column-gap: var(--wp--style--block-gap, 1.25rem);
		align-items: start;
	}
	.fd-reading > .entry-content { display: contents; }
	/* Section index pages: the page heading and intro use the same title-and-text grid. */
	.fd-reading > h1 { grid-column: 1; margin: 0; padding-right: var(--wp--preset--spacing--40, 1rem); font-size: clamp(2.4rem, 3.4vw, 3.4rem); line-height: 1.02; }
	.fd-reading > h1 + * { grid-column: 2; max-width: none; margin-top: 0; }
	.fd-archive-head { margin-bottom: var(--wp--preset--spacing--60, 2rem); }

	/* Default: everything sits in the text column and runs to the right edge. */
	.fd-prose > *,
	.fd-reading > .entry-content > *,
	.fd-reading > .wp-block-post-title + * { grid-column: 2; max-width: none; }

	/* Headings (and the page title) take the left column, beside their first paragraph. */
	.fd-prose > h2,
	.fd-reading > .entry-content > h2,
	.fd-reading > .wp-block-post-title {
		grid-column: 1;
		max-width: none;
		margin-top: 0;
		padding-right: var(--wp--preset--spacing--40, 1rem);
	}
	.fd-reading > .wp-block-post-title { font-size: clamp(2.4rem, 3.4vw, 3.4rem); line-height: 1.02; }
	/* Let a two-line heading run alongside several paragraphs instead of pushing the second one down. */
	.fd-prose > h2,
	.fd-reading > .entry-content > h2 { grid-row: span 3; }
	.fd-prose > h2:has(+ :is(.fd-rows, .fd-quads, .is-style-fd-steps, .fd-spectrum, .fd-graphic, .fd-matrix, .wp-block-table)),
	.fd-reading > .entry-content > h2:has(+ :is(.fd-rows, .wp-block-table)) { grid-row: auto; }

	/* Wide components span both columns. */
	.fd-prose > :is(.fd-rows, .fd-quads, .is-style-fd-steps, .fd-spectrum, .fd-graphic, .fd-matrix, .wp-block-table, .is-style-fd-callout, .wp-block-columns),
	.fd-reading > .entry-content > :is(.fd-rows, .wp-block-columns, .wp-block-table, .is-style-fd-callout) {
		grid-column: 1 / -1;
	}
	/* A heading followed directly by a wide component spans too, so it isn't stranded. */
	.fd-prose > h2:has(+ :is(.fd-rows, .fd-quads, .is-style-fd-steps, .fd-spectrum, .fd-graphic, .fd-matrix, .wp-block-table)),
	.fd-reading > .entry-content > h2:has(+ :is(.fd-rows, .wp-block-table)) {
		grid-column: 1 / -1;
	}

	/* A full-width heading needs room above the rule of the component below it. */
	.fd-prose > h2:has(+ :is(.fd-rows, .fd-quads, .is-style-fd-steps, .fd-spectrum, .fd-graphic, .fd-matrix, .wp-block-table)),
	.fd-reading > .entry-content > h2:has(+ :is(.fd-rows, .wp-block-table)) { margin-bottom: var(--wp--preset--spacing--40, 1rem); }

	/* Space between heading groups: the heading and the text beside it start together. */
	.fd-prose > h2:not(:first-child),
	.fd-prose > h2:not(:first-child):not(:has(+ :is(.fd-rows, .fd-quads, .is-style-fd-steps, .fd-spectrum, .fd-graphic, .fd-matrix, .wp-block-table))) + *,
	.fd-reading > .entry-content > h2,
	.fd-reading > .entry-content > h2:not(:has(+ :is(.fd-rows, .wp-block-table))) + * {
		margin-top: var(--wp--preset--spacing--70, 3rem);
	}
	.fd-prose > h2:first-child + * { margin-top: 0; }

	/* Reading pages: title beside the opening text; "Last updated" and the lead stack beside it. */
	.fd-reading > .wp-block-post-title { grid-row: 1 / span 2; align-self: start; }
	.fd-reading > .entry-content > :first-child { margin-top: 0; }
	.fd-reading > .fd-breadcrumbs, .fd-reading > nav { grid-column: 1 / -1; }

	/* Rows and FAQ fill the width now that they sit in the grid. */
	.fd-prose > :is(.fd-rows, .fd-faq),
	.fd-reading > .entry-content > :is(.fd-rows, .fd-faq) { max-width: none; }

	/*
	 * Short closing bands (a heading, a sentence and buttons, nothing else)
	 * can't fill the width, so they're centered.
	 */
	.fd-section--dark .fd-prose:not(:has(> :is(ul, ol, .fd-rows, .fd-quads, figure))) {
		display: block;
		text-align: center;
	}
	.fd-section--dark .fd-prose:not(:has(> :is(ul, ol, .fd-rows, .fd-quads, figure))) > * {
		max-width: 46rem;
		margin-left: auto;
		margin-right: auto;
	}
	.fd-section--dark .fd-prose:not(:has(> :is(ul, ol, .fd-rows, .fd-quads, figure))) > .wp-block-buttons { justify-content: center; }
}

/*
 * Service, solution and security pages: the opening uses the same title-and-text
 * grid as every other page (owner, 2026-10-05). Title (same size as other page
 * titles) and the summary box in the left third; lead and buttons on the right.
 */
@media (min-width: 960px) {
	.fd-hero > .wp-block-columns {
		display: grid;
		grid-template-columns: minmax(0, 34fr) minmax(0, 66fr);
		grid-template-rows: auto auto 1fr;
		column-gap: var(--wp--style--block-gap, 1.25rem);
		row-gap: 0;
		align-items: start;
	}
	.fd-hero > .wp-block-columns > .wp-block-column:first-child { display: contents; }
	.fd-hero > .wp-block-columns > .wp-block-column:first-child > .wp-block-post-title {
		grid-column: 1; grid-row: 1;
		margin: 0;
		padding-right: var(--wp--preset--spacing--40, 1rem);
		font-size: clamp(2.4rem, 3.4vw, 3.4rem);
		line-height: 1.02;
		max-width: none;
	}
	.fd-hero > .wp-block-columns > .wp-block-column:first-child > .fd-hero__lead {
		grid-column: 2; grid-row: 1; margin: 0; max-width: none;
	}
	.fd-hero > .wp-block-columns > .wp-block-column:first-child > .wp-block-buttons {
		grid-column: 2; grid-row: 2; align-self: start; margin-top: var(--wp--preset--spacing--50, 1.5rem);
	}
	/* Summary box: a slim strip under the buttons (the title already names the page). */
	.fd-hero > .wp-block-columns > .wp-block-column:last-child {
		grid-column: 2; grid-row: 3;
		align-self: start;
		margin-top: var(--wp--preset--spacing--50, 1.5rem);
	}
	.fd-hero .fd-title-block__name { display: none; }
	.fd-hero .fd-title-block__grid { grid-template-columns: 1fr 1fr; }
	.fd-hero .fd-title-block__cell--full { grid-column: auto; }
	.fd-hero .fd-title-block__grid > .fd-title-block__cell { border-top: 0; }
	.fd-hero .fd-title-block__grid > .fd-title-block__cell + .fd-title-block__cell { border-left: 1px solid var(--wp--preset--color--ink); }
}

