/*
 * BlitzBooking - design tokens.
 *
 * Loaded on every front-end view so the header, the footer, the shop and the
 * homepage all speak one language. The tokens are declared on the body class AND
 * on each plugin container, so every container is self-sufficient: if the chrome
 * module is switched off, or a classic theme skips the body class, the homepage
 * and the booking widget still resolve their own variables instead of rendering
 * unstyled.
 *
 * Indigo is the stage, warm paper the field, amber the signal.
 * Mint means exactly one thing: this time slot is free. Nothing else is mint.
 *
 * 1.4.0 ships light-only on purpose. A dark homepage next to a light WooCommerce
 * product page reads worse than one consistent light site, and the purchase path
 * cannot follow into dark until the Woo blocks are skinned. See readme.
 */

body.bbs-scope,
.bbs-home,
.bbs-booking,
.bbs-footer,
.bbs-chrome-header {
	--bbs-ink: #191a3e;
	--bbs-ink-soft: #242654;
	--bbs-ink-line: #3d3f7a;
	--bbs-paper: #faf7f2;
	--bbs-surface: #ffffff;
	--bbs-surface-2: #f3efe8;
	--bbs-text: #23233a;
	--bbs-muted: #5c5c76;
	--bbs-rule: #e2dcd1;
	--bbs-rule-strong: #b9b1a2;
	--bbs-amber: #f5a524;
	/* #c97f0c measured 3.03:1 on paper - below AA for 0.78rem labels. */
	--bbs-amber-deep: #8a5606;
	--bbs-mint: #2fa37f;
	--bbs-mint-soft: #dff3eb;
	--bbs-mint-ink: #04241a;
	--bbs-on-ink: #f2f0fa;
	--bbs-on-ink-dim: #b9b8d4;
	--bbs-on-amber: #201704;

	/* Focus ring per ground - amber alone is 2.06:1 on white and invisible. */
	--bbs-focus: #23233a;

	--bbs-maxw: 1140px;
	--bbs-header-h: 4.25rem;

	--bbs-display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	--bbs-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--bbs-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "Consolas", monospace;
}

/* On indigo grounds the ring has to be light to be seen at all. */
.bbs-chrome-header,
.bbs-footer,
.bbs-hero,
.bbs-closing,
.bbs-facts {
	--bbs-focus: var(--bbs-amber);
}

/* Plugin-owned visually-hidden utility. Deliberately NOT .screen-reader-text,
   which WooCommerce and the theme both own. */
.bbs-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Focus is scoped to plugin containers only - never to the whole document,
   which would restyle the WooCommerce checkout and every other plugin's UI.
   No border-radius here: it would square off the pill buttons on focus. */
.bbs-home :is(a, button, summary, input, select, [tabindex]):focus-visible,
.bbs-booking :is(a, button, summary, input, select, [tabindex]):focus-visible,
.bbs-chrome-header :is(a, button, summary, input, select, [tabindex]):focus-visible,
.bbs-footer :is(a, button, summary, input, select, [tabindex]):focus-visible {
	outline: 3px solid var(--bbs-focus);
	outline-offset: 3px;
}

/* Windows High Contrast strips backgrounds, which is what carries meaning here:
   free vs booked, primary vs ghost, the cart badge. Give them real borders. */
@media (forced-colors: active) {
	.bbs-home .bbs-btn,
	.bbs-footer .bbs-btn,
	.bbs-chrome-header .bbs-nav__cta > a,
	.bbs-home .bbs-slot,
	.bbs-booking .bbs-slot,
	.bbs-home .bbs-day,
	.bbs-home .bbs-card {
		border: 1px solid currentColor !important;
	}

	.bbs-home .bbs-card__badge,
	.bbs-chrome-header .wc-block-mini-cart__badge {
		border: 1px solid currentColor !important;
		forced-color-adjust: none;
	}

	.bbs-chrome-header [aria-current="page"] {
		text-decoration: underline;
		text-underline-offset: 4px;
	}
}

/* Reduced motion, scoped to plugin containers so WooCommerce's own checkout
   spinners and skeletons keep moving - a payment screen with no perceivable
   status is worse than a little movement. */
@media (prefers-reduced-motion: reduce) {
	.bbs-home *,
	.bbs-booking *,
	.bbs-chrome-header *,
	.bbs-footer * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}

	.bbs-home .bbs-card:hover {
		transform: none !important;
	}
}
