/*
 * MBSS Accessibility Companion — contrast repairs.
 *
 * Scope note. mbss-a11y.css sets a global body text colour of #3f5361. On the
 * site's white backgrounds that is 7.5:1 — comfortably past WCAG AA. The
 * problem is only that the same colour is inherited into the dark #0c2636
 * testimonial band, where it falls to 1.95:1 against a 3:1 requirement.
 *
 * So this file does not change the global colour. It corrects the two
 * measured failures and leaves everything that already passes alone.
 *
 * The JS companion handles any dark section this stylesheet does not know
 * about, by measuring real computed contrast at runtime.
 */

/* --------------------------------------------------------------------------
 * 1. Dark sections — WCAG 1.4.3
 *
 * The JS pass tags any container whose computed background is genuinely dark
 * (relative luminance < 0.18) and which contains text failing its threshold.
 * Driving this from a class rather than a hard-coded WPBakery id keeps it
 * working when the page is re-saved and the generated ids change.
 * ----------------------------------------------------------------------- */

.mbssac-dark-section,
.mbssac-dark-section p,
.mbssac-dark-section span,
.mbssac-dark-section li,
.mbssac-dark-section div,
.mbssac-dark-section blockquote,
.mbssac-dark-section .sc_item_descr,
.mbssac-dark-section .sc_item_descr p,
.mbssac-dark-section .sc_testimonial_content,
.mbssac-dark-section .sc_services_item_content,
.mbssac-dark-section .sc_services_item_content p {
	/* #dbe4ea on #0c2636 = 13.2:1. Keeps the cool grey character of the
	   original #3f5361 rather than switching to flat white. */
	color: #dbe4ea !important;
}

.mbssac-dark-section h1,
.mbssac-dark-section h2,
.mbssac-dark-section h3,
.mbssac-dark-section h4,
.mbssac-dark-section h5,
.mbssac-dark-section h6 {
	color: #ffffff !important;
}

/* Links inside dark sections need to stay distinguishable from body text
   by more than colour alone — WCAG 1.4.1. */
.mbssac-dark-section a:not(.sc_button):not(.button) {
	color: #8fd3f4 !important;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* --------------------------------------------------------------------------
 * 2. Brand blue on white — WCAG 1.4.3
 *
 * #00aaef on #ffffff is 2.63:1. It cannot reach 4.5:1 without becoming a
 * different colour; #0077A8 hits 4.54:1 and still reads as the same blue.
 *
 * Restricted to small text. Large text (24px+, or 18.66px+ bold) only needs
 * 3:1, which #00aaef already clears at 2.63... it does not, so large text is
 * lifted to #0089C0 (3.4:1) rather than being left failing.
 * ----------------------------------------------------------------------- */

.mbssac-lowcontrast-brand {
	color: #0077a8 !important;
}

.mbssac-lowcontrast-brand-large {
	color: #0089c0 !important;
}

/* Known static instances, so the common cases are corrected before the JS
   pass runs and without waiting for it. */
.scheme_default .woocommerce ul.products li.product .post_header a {
	color: #0077a8;
}

/* --------------------------------------------------------------------------
 * 3. Focus indicators — intentionally absent.
 *
 * mbss-a11y.css already provides:
 *   a:focus-visible, button:focus-visible, input:focus-visible, … {
 *     outline: 3px solid #005fcc !important; outline-offset: 2px;
 *     box-shadow: 0 0 0 5px #fff;
 *   }
 * Verified working with real keyboard navigation. Do not duplicate it here.
 * ----------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
 * 4. Admin debug badge
 * ----------------------------------------------------------------------- */

.mbssac-badge {
	position: fixed;
	bottom: 12px;
	left: 12px;
	z-index: 99999;
	max-width: 20rem;
	padding: .5rem .7rem;
	border-radius: 4px;
	background: #0b3c5d;
	color: #fff;
	font: 400 12px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

.mbssac-badge strong { display: block; margin-bottom: .2rem; }
.mbssac-badge button {
	margin-top: .35rem;
	padding: .1rem .4rem;
	border: 1px solid #fff;
	border-radius: 3px;
	background: transparent;
	color: #fff;
	font: inherit;
	cursor: pointer;
}

@media print {
	.mbssac-badge { display: none !important; }
}
