/*
 * Process flow.
 *
 * Same rules as every component stylesheet: design-system `--btx-*` tokens
 * only, a fallback on every var(). See cta-button/style.css for the full note.
 *
 * As in problem-grid and faq-list, this file is short on colour on purpose.
 * Three surfaces are in play — the section, an ordinary step and an emphasised
 * one — and the ink for each is *computed* in PHP against whatever an editor
 * picked. They arrive as `--btxc-flow-*` custom properties. Nothing here names
 * a colour token for type; it names those properties, and the defaults below
 * are what they fall back to when the component renders with no background at
 * all, which is paper.
 *
 * The accent is the one colour that comes in per element, on `--btxc-flow-accent`,
 * and it only ever paints the rule across the top of a step. No type is set in
 * it, which is what lets it be a bright yellow.
 */

@layer bertex-components {

	/* ── Shell ─────────────────────────────────────────────────────────── */

	.btxc-flow {
		--btxc-flow-bg: transparent;
		--btxc-flow-ink: var( --btx-color-primary-1, #1a2744 );
		--btxc-flow-quiet: var( --btx-color-primary-1-light-40, #2e4578 );
		--btxc-flow-card-bg: transparent;
		--btxc-flow-card-ink: var( --btx-color-primary-1, #1a2744 );
		--btxc-flow-card-quiet: var( --btx-color-primary-1-light-40, #2e4578 );
		--btxc-flow-emphasis-bg: var( --btx-color-primary-1, #1a2744 );
		--btxc-flow-emphasis-ink: var( --btx-color-text-bg-1, #f9fafb );
		--btxc-flow-emphasis-quiet: var( --btx-color-text-bg-2, #d3e1f7 );

		box-sizing: border-box;
		padding-block: var( --btx-spacing-xxl, 4.5rem );
		padding-inline: var( --btx-spacing-m, 1.25rem );

		background: var( --btxc-flow-bg );
		color: var( --btxc-flow-ink );
	}

	.btxc-flow__inner {
		box-sizing: border-box;
		max-width: var( --btx-max-width, 1440px );
		margin-inline: auto;

		display: flex;
		flex-direction: column;
		gap: var( --btx-spacing-lg, 2rem );
	}

	/* ── Header ────────────────────────────────────────────────────────── */

	/*
	 * The claim and the reason sit side by side rather than stacked, which is
	 * what keeps this section short — it is the join between two long ones and
	 * should not read as a third.
	 */
	.btxc-flow__header {
		display: grid;
		grid-template-columns: 1.05fr 1fr;
		gap: var( --btx-spacing-xl, 3.5rem );
		align-items: start;
	}

	.btxc-flow__lead {
		display: flex;
		flex-direction: column;
		gap: var( --btx-spacing-xs, 0.625rem );

		min-width: 0;
	}

	/*
	 * Bare `monospace`, the same deliberate exception the other components
	 * make: the design system publishes a heading family and a body family and
	 * no third, so a mono face cannot come from a token. See the note in
	 * booking-panel/style.css.
	 */
	.btxc-flow__eyebrow {
		margin: 0;

		font-family: monospace;
		font-size: var( --btx-font-body-xs, 0.8125rem );
		font-weight: 500;
		letter-spacing: 0.12em;
		text-transform: uppercase;
		color: var( --btxc-flow-quiet );
	}

	.btxc-flow__heading {
		margin: 0;

		font-family: var( --btx-font-heading-family, inherit );
		font-size: var( --btx-font-heading-xl, 2.625rem );
		font-weight: 700;
		line-height: var( --btx-line-height-heading, 1.06 );
		letter-spacing: -0.02em;
		text-wrap: pretty;
		color: var( --btxc-flow-ink );
	}

	.btxc-flow__prose {
		display: flex;
		flex-direction: column;
		gap: var( --btx-spacing-xs, 0.625rem );

		min-width: 0;
	}

	.btxc-flow__body {
		margin: 0;

		max-width: 60ch;

		font-size: var( --btx-font-body-m, 1.125rem );
		line-height: var( --btx-line-height-body, 1.7 );
		color: var( --btxc-flow-quiet );
	}

	/* ── The strip ─────────────────────────────────────────────────────── */

	/*
	 * `auto-fit` with a minimum rather than a fixed count, the same reason
	 * card-grid.php gives: the container decides how many fit, so five steps
	 * become three and two without a breakpoint per count.
	 */
	.btxc-flow__strip {
		margin: 0;
		padding: 0;
		list-style: none;

		display: grid;
		grid-template-columns: repeat( auto-fit, minmax( 11rem, 1fr ) );
		gap: var( --btx-spacing-xs, 0.875rem );
		align-items: stretch;
	}

	.btxc-flow__step {
		box-sizing: border-box;
		padding: var( --btx-spacing-m, 1.25rem );

		display: flex;
		flex-direction: column;
		gap: var( --btx-spacing-xxs, 0.5rem );

		background: var( --btxc-flow-card-bg );
		color: var( --btxc-flow-card-ink );

		border: 1px solid color-mix( in srgb, var( --btxc-flow-card-ink ) 14%, transparent );
		border-top: 4px solid var( --btxc-flow-accent, transparent );
		border-radius: var( --btx-border-radius-m, 0.75rem );
	}

	/*
	 * An emphasised step paints its own surface, so it drops the accent rule:
	 * the paint is the emphasis, and a coloured hairline on top of it is a
	 * second signal saying the same thing less clearly. Its ink is measured
	 * against that surface in PHP, which is why a dark choice here is safe on a
	 * light strip.
	 */
	.btxc-flow__step--emphasis {
		background: var( --btxc-flow-emphasis-bg );
		color: var( --btxc-flow-emphasis-ink );

		border: 1px solid transparent;
	}

	.btxc-flow__marker {
		font-family: monospace;
		font-size: var( --btx-font-body-xs, 0.75rem );
		line-height: var( --btx-line-height-body, 1.5 );
		color: var( --btxc-flow-card-quiet );
	}

	.btxc-flow__step--emphasis .btxc-flow__marker {
		color: var( --btxc-flow-emphasis-quiet );
	}

	.btxc-flow__title {
		font-family: var( --btx-font-heading-family, inherit );
		font-size: var( --btx-font-body-lg, 1.1875rem );
		font-weight: 600;
		line-height: var( --btx-line-height-heading, 1.2 );
		text-wrap: pretty;
	}

	/* ── Narrow ────────────────────────────────────────────────────────── */

	@media ( width < 48rem ) {
		.btxc-flow {
			padding-block: var( --btx-spacing-xl, 3rem );
		}

		/* The reason stops being a column and becomes the thing under the
		 * claim, which is what it is on a phone. */
		.btxc-flow__header {
			grid-template-columns: minmax( 0, 1fr );
			gap: var( --btx-spacing-m, 1.25rem );
		}

		.btxc-flow__heading {
			font-size: var( --btx-font-heading-m, 1.875rem );
		}
	}
}
