/* =========================================================================
 * brand-vars.css — Tailwind brand-utility → CSS-variable bridge
 * -------------------------------------------------------------------------
 * PROBLEM this file solves (B21.3-A.2 ThemeFix B):
 *   tailwind.css compiles utilities like .bg-brand-primary / .text-brand-primary
 *   to LITERAL hex (rgb(15 118 110/…) == #0F766E). They are baked at build time
 *   and therefore IGNORE the runtime `:root{--color-primary:…}` override that the
 *   theme prints in wp_head (manifest_tier1_print_brand_overrides()). Result:
 *   var()-consuming elements (style.css) recolor on a brand change, but
 *   Tailwind-utility elements (hero buttons, badges, links, focus rings) stay
 *   the default teal — a PARTIAL brand override.
 *
 * FIX (cascade-order, NOT !important):
 *   Re-declare every brand utility that actually compiled into tailwind.css so
 *   it consumes var(--color-*) WITH the original literal as the fallback:
 *       .bg-brand-primary { background-color: var(--color-primary, #0f766e); }
 *   Each selector below MIRRORS Tailwind's exact selector (including the escaped
 *   `:hover` / `:focus` / `.group:hover` variants) so specificity is IDENTICAL.
 *   This file is enqueued AFTER tailwind.css → equal specificity, later source
 *   order wins the cascade. No !important needed.
 *
 *   Solid utilities → var(--color-X, <literal>).
 *   Alpha-tint utilities (e.g. .bg-brand-primary/10 == #0f766e1a) bake opacity
 *   into the hex, so they use color-mix() to recompute the tint from the live
 *   variable, with the literal hex kept as the var() fallback. Browsers without
 *   color-mix() simply keep tailwind.css's literal rule (graceful degrade).
 *
 *   Fallbacks mean: if the owner never customizes (no :root override emitted),
 *   the var() resolves to the bundled default → pixel-identical to before.
 *
 * VARIABLE MAP (theme.css :root ⇄ tailwind literal):
 *   --color-primary        #0f766e   (rgb 15 118 110)
 *   --color-primary-hover  #0e6b64   (rgb 14 107 100)
 *   --color-accent         #d4a75a   (rgb 212 167 90)
 *   --color-accent-hover   #c19a4d   (rgb 193 154 77)
 *
 * Keep in sync with the compiled brand utilities in assets/css/tailwind.css.
 * ========================================================================= */

/* ---- background: solid ------------------------------------------------- */
.bg-brand-primary          { background-color: var(--color-primary, #0f766e); }
.bg-brand-accent           { background-color: var(--color-accent,  #d4a75a); }

/* ---- background: alpha tints (color-mix recomputes from live var) ------ */
.bg-brand-primary\/5       { background-color: color-mix(in srgb, var(--color-primary, #0f766e) 5%,  transparent); }
.bg-brand-primary\/10      { background-color: color-mix(in srgb, var(--color-primary, #0f766e) 10%, transparent); }
.bg-brand-accent\/5        { background-color: color-mix(in srgb, var(--color-accent,  #d4a75a) 5%,  transparent); }
.bg-brand-accent\/10       { background-color: color-mix(in srgb, var(--color-accent,  #d4a75a) 10%, transparent); }
.bg-brand-accent\/20       { background-color: color-mix(in srgb, var(--color-accent,  #d4a75a) 20%, transparent); }

/* ---- background: hover variants ---------------------------------------- */
.hover\:bg-brand-primary:hover         { background-color: var(--color-primary,       #0f766e); }
.hover\:bg-brand-primary-hover:hover   { background-color: var(--color-primary-hover, #0e6b64); }
.hover\:bg-brand-accent-hover:hover    { background-color: var(--color-accent-hover,  #c19a4d); }
.hover\:bg-brand-primary\/5:hover      { background-color: color-mix(in srgb, var(--color-primary, #0f766e) 5%,  transparent); }
.hover\:bg-brand-primary\/10:hover     { background-color: color-mix(in srgb, var(--color-primary, #0f766e) 10%, transparent); }
.hover\:bg-brand-accent\/90:hover      { background-color: color-mix(in srgb, var(--color-accent,  #d4a75a) 90%, transparent); }

/* ---- background: focus + group-hover variants -------------------------- */
.focus\:bg-brand-primary:focus                       { background-color: var(--color-primary, #0f766e); }
.group:hover .group-hover\:bg-brand-primary\/10      { background-color: color-mix(in srgb, var(--color-primary, #0f766e) 10%, transparent); }

/* ---- text: solid ------------------------------------------------------- */
.text-brand-primary        { color: var(--color-primary, #0f766e); }
.text-brand-accent         { color: var(--color-accent,  #d4a75a); }

/* ---- text: alpha tints ------------------------------------------------- */
.text-brand-primary\/15    { color: color-mix(in srgb, var(--color-primary, #0f766e) 15%, transparent); }
.text-brand-primary\/20    { color: color-mix(in srgb, var(--color-primary, #0f766e) 20%, transparent); }
.text-brand-primary\/40    { color: color-mix(in srgb, var(--color-primary, #0f766e) 40%, transparent); }

/* ---- text: hover + group-hover variants -------------------------------- */
.hover\:text-brand-primary:hover                 { color: var(--color-primary, #0f766e); }
.group:hover .group-hover\:text-brand-primary    { color: var(--color-primary, #0f766e); }

/* ---- border: solid ----------------------------------------------------- */
.border-brand-primary      { border-color: var(--color-primary, #0f766e); }

/* ---- border: alpha tints ----------------------------------------------- */
.border-brand-primary\/20  { border-color: color-mix(in srgb, var(--color-primary, #0f766e) 20%, transparent); }
.border-brand-primary\/30  { border-color: color-mix(in srgb, var(--color-primary, #0f766e) 30%, transparent); }
.border-brand-accent\/40   { border-color: color-mix(in srgb, var(--color-accent,  #d4a75a) 40%, transparent); }

/* ---- border: hover + focus + focus-within variants --------------------- */
.hover\:border-brand-primary:hover                 { border-color: var(--color-primary, #0f766e); }
.focus\:border-brand-primary:focus                 { border-color: var(--color-primary, #0f766e); }
.focus-within\:border-brand-primary:focus-within   { border-color: var(--color-primary, #0f766e); }

/* ---- ring (Tailwind ring uses --tw-ring-color custom prop) ------------- */
.ring-brand-primary\/20                            { --tw-ring-color: color-mix(in srgb, var(--color-primary, #0f766e) 20%, transparent); }
.focus\:ring-brand-primary\/10:focus               { --tw-ring-color: color-mix(in srgb, var(--color-primary, #0f766e) 10%, transparent); }
.focus\:ring-brand-primary\/20:focus               { --tw-ring-color: color-mix(in srgb, var(--color-primary, #0f766e) 20%, transparent); }
.focus-visible\:ring-brand-primary:focus-visible   { --tw-ring-color: var(--color-primary, #0f766e); }

/* ---- form accent ------------------------------------------------------- */
.accent-brand-primary      { accent-color: var(--color-primary, #0f766e); }

/* ---- Tailwind `!`-important utilities ---------------------------------- */
/* tailwind.css emits these WITH !important. To win the cascade at equal
 * specificity we MUST also use !important here (later source order then wins).
 * This is the ONLY block where !important is required — it mirrors Tailwind's
 * own important flag, it does not escalate specificity. */
.\!text-brand-primary      { color: var(--color-primary, #0f766e) !important; }
.\!border-brand-primary    { border-color: var(--color-primary, #0f766e) !important; }

/* ---- gradients (Tailwind from-/to- write --tw-gradient-* custom props) -- */
.from-brand-primary\/20 {
	--tw-gradient-from: color-mix(in srgb, var(--color-primary, #0f766e) 20%, transparent) var(--tw-gradient-from-position);
	--tw-gradient-to:   color-mix(in srgb, var(--color-primary, #0f766e) 0%,  transparent) var(--tw-gradient-to-position);
	--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-brand-accent\/20 {
	--tw-gradient-from: color-mix(in srgb, var(--color-accent, #d4a75a) 20%, transparent) var(--tw-gradient-from-position);
	--tw-gradient-to:   color-mix(in srgb, var(--color-accent, #d4a75a) 0%,  transparent) var(--tw-gradient-to-position);
	--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.to-brand-primary\/20      { --tw-gradient-to: color-mix(in srgb, var(--color-primary, #0f766e) 20%, transparent) var(--tw-gradient-to-position); }
.to-brand-accent\/20       { --tw-gradient-to: color-mix(in srgb, var(--color-accent,  #d4a75a) 20%, transparent) var(--tw-gradient-to-position); }
