/* ══════════════════════════════════════════════════════════════
 * PI Chassis — structural CSS only.
 *
 * Colour, type and spacing come from theme.json. Nothing in this file
 * hardcodes a brand value; everything references a preset variable so a
 * client style variation can retheme the whole site by swapping hex codes.
 * ══════════════════════════════════════════════════════════════ */

/* ── Base ───────────────────────────────────────────────────── */

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

body { text-rendering: optimizeLegibility; }

/* Readable measure on body copy without constraining layout blocks. */
.wp-block-post-content p:not([class*="has-"]) { max-width: 68ch; }

img, svg, video { max-width: 100%; height: auto; }

/* ── Accessibility floor ────────────────────────────────────── */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

.skip-link:focus {
	position: fixed;
	inset-block-start: var(--wp--preset--spacing--sm);
	inset-inline-start: var(--wp--preset--spacing--sm);
	z-index: 999;
	padding: var(--wp--preset--spacing--xs) var(--wp--preset--spacing--sm);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
}

@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 ─────────────────────────────────────────────────── */

.pi-header { border-block-end: 1px solid var(--wp--preset--color--line); }

/* ── CTA router output ──────────────────────────────────────── */

.pi-form__heading {
	margin-block-end: var(--wp--preset--spacing--md);
	text-align: center;
}

.pi-button {
	display: inline-block;
	padding: 0.9rem 1.6rem;
	border-radius: 6px;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--brand-dark);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.pi-button:hover,
.pi-button:focus { background: var(--wp--preset--color--accent-dark); }

.pi-header .pi-button { padding: 0.65rem 1.1rem; }

.pi-form__frame { display: block; }

/* Gravity Forms base field styling, on the token system. For a clean result,
   set Forms → Settings → Default Form Theme to "Gravity Forms 2.5 Theme" (or turn
   off Gravity's CSS output) so these rules are not fighting the plugin sheet. */
.pi-form .gform_wrapper input:not([type="submit"]),
.pi-form .gform_wrapper select,
.pi-form .gform_wrapper textarea {
	inline-size: 100%;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 6px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	font: inherit;
}

.pi-form .gform_wrapper .gform_footer input[type="submit"] {
	padding: 0.9rem 1.6rem;
	border: 0;
	border-radius: 6px;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--brand-dark);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	cursor: pointer;
}

.pi-form .gform_wrapper .gfield_label {
	display: block;
	margin-block-end: 0.35rem;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
}

.pi-form .gform_wrapper .gfield { margin-block-end: var(--wp--preset--spacing--sm); }

.pi-form .gform_wrapper .gfield_required { color: var(--wp--preset--color--accent-dark); }

/* ── Accordion (pattern-built variant) ──────────────────────── */

.pi-accordion__trigger {
	inline-size: 100%;
	padding: var(--wp--preset--spacing--sm) 0;
	border: 0;
	border-block-end: 1px solid var(--wp--preset--color--line);
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 600;
	text-align: start;
	cursor: pointer;
}

.pi-accordion__trigger[aria-expanded="true"] { color: var(--wp--preset--color--accent-dark); }

/* ── Details block ──────────────────────────────────────────── */

.wp-block-details {
	padding-block: var(--wp--preset--spacing--sm);
	border-block-end: 1px solid var(--wp--preset--color--line);
}

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

/* ── Footer ─────────────────────────────────────────────────── */

.pi-footer a { color: inherit; }
.pi-footer .wp-block-separator { border-color: currentColor; opacity: 0.25; }
