/**
 * Bootstrap bridge — maps Bootstrap's CSS variables onto the --okc-* tokens.
 *
 * Loaded after bootstrap.min.css and tokens.css. This is the ONLY place
 * --bs-* variables may be assigned. Never edit bootstrap.min.css itself.
 */

:root,
[data-bs-theme="dark"],
[data-bs-theme="light"] {
	--bs-body-bg: var(--okc-surface);
	--bs-body-color: var(--okc-text);
	--bs-body-font-family: var(--okc-font);
	--bs-body-font-size: var(--okc-b2-size);
	--bs-body-font-weight: var(--okc-b2-weight);

	--bs-emphasis-color: var(--okc-text);
	--bs-secondary-color: var(--okc-text-muted);
	--bs-border-color: var(--okc-text-muted);
	--bs-link-color: var(--okc-text);
	--bs-link-hover-color: var(--okc-text-muted);
	/* Bootstrap's reboot does NOT build a link's colour from --bs-link-color.
	   Its `a` rule composes the colour from the *channel* variable plus
	   --bs-link-opacity instead, so mapping only the two variables above had no
	   effect at all and every plain content link kept Bootstrap's own default
	   light blue under [data-bs-theme="dark"]. WordPress's
	   `a:where(:not(.wp-element-button))` rule, from theme.json's elements.link,
	   does set --okc-text, but :where() contributes 0 specificity, so it ties
	   with the bare `a` selector and loses on source order (bootstrap.min.css
	   is enqueued after the global styles). Mapping the channel variables is
	   what actually lands. */
	--bs-link-color-rgb: var(--okc-text-rgb);
	--bs-link-hover-color-rgb: var(--okc-text-rgb);

	--bs-heading-color: var(--okc-text);
}

/* Both link colours now resolve from the same channel triplet, so hover needs
   the other half of Bootstrap's formula to stay visible: its own
   --bs-link-opacity, which the `a` rule already reads alongside the channels.
   .6 is --okc-text-muted's own alpha, so this keeps exactly the muted-on-hover
   that the dead --bs-link-hover-color above was asking for, in both themes,
   without a second colour variable. */
a:hover {
	--bs-link-opacity: .6;
}

/* Bootstrap's grid spaces columns with gutter variables rather than `gap`,
   so mapping our spacing tokens onto .row is Bootstrap coupling, which is
   what this file owns — not okc.css. */
.row.okc-stack-md {
	--bs-gutter-x: var(--okc-space-md);
	--bs-gutter-y: var(--okc-space-md);
	gap: 0;
}

.row.okc-stack-sm {
	--bs-gutter-x: var(--okc-space-sm);
	--bs-gutter-y: var(--okc-space-sm);
	gap: 0;
}

/* Site-wide button padding: the design system calls for 11.5px vertical /
   20px horizontal, which doesn't sit on Bootstrap's own padding scale.
   Overriding .btn's own custom properties keeps every button on the site
   consistent without a new class or inline style. */
.btn {
	--bs-btn-padding-x: 20px;
	--bs-btn-padding-y: 11.5px;
}

/* Primary nav: navbar links and dropdown items are their own Bootstrap
   components with their own color variables, not the global --bs-link-*
   ones bridged above, so they need their own override. */
.navbar {
	--bs-navbar-color: var(--okc-text-muted);
	--bs-navbar-hover-color: var(--okc-text);
	--bs-navbar-active-color: var(--okc-text);
	/* 30px between top-level nav items. Bootstrap applies this variable as
	   padding on each side of a .nav-link (from the expand breakpoint up),
	   so 15px a side is what adds up to the 30px gap the design asks for. */
	--bs-navbar-nav-link-padding-x: var(--okc-space-sm);
	max-width: 100vw;
	/* Bootstrap's own padding-y variable only covers top/bottom; there's no
	   horizontal equivalent since Bootstrap expects a .container for that,
	   which Rule 3 bans. Set both directly instead. */
	
}

.dropdown-menu {
	--bs-dropdown-bg: transparent;
	--bs-dropdown-border-width: 0;
	--bs-dropdown-link-color: var(--okc-text-muted);
	--bs-dropdown-link-hover-color: var(--okc-text);
	--bs-dropdown-link-hover-bg: transparent;
	--bs-dropdown-link-active-color: var(--okc-text);
	--bs-dropdown-link-active-bg: transparent;
}

/* Heading weights: Bootstrap's reboot hardcodes font-weight: 500 on h1–h6
   (a literal, not a variable), which beats theme.json's element weights and
   rendered every "regular" heading as medium. Restore the design system's
   scale — H1 bold, everything below regular. fw-* utilities (!important) and
   class rules such as .card-title still override this per heading. */
h1, .h1 {
	font-weight: var(--okc-h1-weight);
}

h2, .h2,
h3, .h3,
h4, .h4,
h5, .h5,
h6, .h6 {
	font-weight: var(--okc-h2-weight);
}

/* Primary CTA: an inverted pill — text-coloured fill with surface-coloured
   label (white on black in dark mode, black on white in light). Bootstrap's
   .btn-primary sets its colours as custom properties on itself, so they are
   redeclared here on the same selector. Hover/active fade the fill to the
   muted token rather than introducing a new colour. */
.btn-primary {
	--bs-btn-color: var(--okc-surface);
	--bs-btn-bg: var(--okc-text);
	--bs-btn-border-color: var(--okc-text);
	--bs-btn-hover-color: var(--okc-surface);
	--bs-btn-hover-bg: var(--okc-text-muted);
	--bs-btn-hover-border-color: var(--okc-text-muted);
	--bs-btn-active-color: var(--okc-surface);
	--bs-btn-active-bg: var(--okc-text-muted);
	--bs-btn-active-border-color: var(--okc-text-muted);
}

/* Secondary CTA: a borderless pill filled with --okc-card-bg (white 10% /
   black 10%), text-coloured label. Same convention as .btn-primary above —
   Bootstrap's .btn-secondary sets these as custom properties on itself, so
   they're redeclared here rather than on :root. Hover/active step up to
   --okc-border-subtle (20%) for a visible but still subtle lift, since
   --okc-card-bg has no "hover" variant of its own. */
.btn-secondary {
	--bs-btn-color: var(--okc-text);
	--bs-btn-bg: var(--okc-card-bg);
	--bs-btn-border-color: transparent;
	--bs-btn-hover-color: var(--okc-text);
	--bs-btn-hover-bg: var(--okc-border-subtle);
	--bs-btn-hover-border-color: transparent;
	--bs-btn-active-color: var(--okc-text);
	--bs-btn-active-bg: var(--okc-border-subtle);
	--bs-btn-active-border-color: transparent;
}

/* Secondary CTA (e.g. kaizen-academy-form's "Sign in"): a muted grey pill
   with surface-coloured label — a quieter sibling of .btn-primary. */
.btn-secondary {
	--bs-btn-color: var(--okc-surface);
	--bs-btn-bg: var(--okc-text-muted);
	--bs-btn-border-color: transparent;
	--bs-btn-hover-color: var(--okc-surface);
	--bs-btn-hover-bg: var(--okc-text);
	--bs-btn-hover-border-color: transparent;
	--bs-btn-active-color: var(--okc-surface);
	--bs-btn-active-bg: var(--okc-text);
	--bs-btn-active-border-color: transparent;
}

/* Download pill (kaizen-brochures): a .btn-secondary filled with --okc-card-bg
   (white 10% / black 10%) instead of the muted grey above, text-coloured
   label. Declared after both .btn-secondary rules so it wins on equal
   specificity; hover/active step up to --okc-border-subtle as in the first. */
.btn-secondary.btn-download {
	--bs-btn-color: var(--okc-text);
	--bs-btn-bg: var(--okc-card-bg);
	--bs-btn-hover-color: var(--okc-text);
	--bs-btn-hover-bg: var(--okc-border-subtle);
	--bs-btn-active-color: var(--okc-text);
	--bs-btn-active-bg: var(--okc-border-subtle);
}

/* Form fields (kaizen-academy-form): filled, borderless, rounded boxes on
   the card background instead of Bootstrap's outlined white inputs. Bootstrap
   sets these as plain properties (not variables) on the component, so they
   are overridden on the same selectors. Focus swaps the blue glow for a
   text-coloured border so it still flips with the theme. */
.form-control,
.form-select {
	min-height: 45px;
	padding-inline: var(--okc-space-sm);
	color: var(--okc-text);
	background-color: var(--okc-card-bg);
	border-color: transparent;
	border-radius: 12px;
}

.form-control:focus,
.form-select:focus {
	color: var(--okc-text);
	background-color: var(--okc-card-bg);
	border-color: var(--okc-text);
	box-shadow: none;
}

.form-select option {
	color: var(--okc-text);
	background-color: var(--okc-surface);
}

.form-check-input {
	background-color: transparent;
	border-color: var(--okc-text-muted);
}

.form-check-input:checked {
	background-color: var(--okc-text-muted);
	border-color: var(--okc-text-muted);
}

.form-check-input:focus {
	border-color: var(--okc-text);
	box-shadow: none;
}

/* Toggle button group (.btn-check radio + .btn label, e.g. heading-pricelist's
   Monthly/Annually switch): unchecked labels are muted text with no fill; the
   checked one is the same inverted pill as .btn-primary, in bold. Bootstrap
   paints the checked state from --bs-btn-active-*, so those are what change. */
.btn-check + .btn {
	--bs-btn-color: var(--okc-text-muted);
	--bs-btn-hover-color: var(--okc-text);
	--bs-btn-active-color: var(--okc-surface);
	--bs-btn-active-bg: var(--okc-text);
	--bs-btn-active-border-color: var(--okc-text);
}

.btn-check:checked + .btn {
	--bs-btn-font-weight: 700; /* B1 weight, same as fw-bold */
}

/* Label badge: Bootstrap's own .badge rule sets these same custom
   properties directly on itself (color, weight, size, padding), so an
   override at :root only inherits and gets shadowed by that — it has to
   be redeclared on .badge itself to actually win. Defaults are a hardcoded
   white text color, bold weight, and em-based size/padding; the design
   calls for token-driven color, regular weight, literal 12px text, and
   12px vertical / 20px horizontal padding. */
.badge {
	--bs-badge-color: var(--okc-text);
	--bs-badge-font-weight: var(--okc-b2-weight);
	--bs-badge-font-size: 12px;
	--bs-badge-padding-x: 20px;
	--bs-badge-padding-y: 12px;
}

/* Form controls (contact-form.php — first pattern in the theme with real
   form inputs). Bootstrap's .form-control/.form-select/.form-check-input
   read the global --bs-body-bg/--bs-border-color bridged above, which would
   render fields the same flat black as the page itself (--okc-surface) with
   a fairly visible border — neither matches this pattern's source mockup
   (a visible card-tinted field, no border). Overridden directly on the
   component selectors, same convention as .btn/.badge above. */
.form-control,
.form-select {
	background-color: var(--okc-card-bg);
	color: var(--okc-text);
	border: 0;
	border-radius: 10px;
}

.form-control:focus,
.form-select:focus {
	background-color: var(--okc-card-bg);
	color: var(--okc-text);
	box-shadow: none;
}

.form-control::placeholder {
	color: var(--okc-text-muted);
}

/* The checkbox itself keeps a subtle border (--okc-border-subtle) — unlike
   the card/input fields, a checkbox needs a visible outline to read as a
   checkbox at all when unchecked. */
.form-check-input {
	--bs-form-check-bg: var(--okc-card-bg);
	border-color: var(--okc-border-subtle);
}
