/* Forced colors (Windows Contrast themes) fixes, WCAG 2.2 AA audit 2026-11-29 (rows B-1, B-2, B-5,
   B-8, B-9). Forced colors drops box-shadow and author background colors, so every boundary, focus
   ring and state cue drawn that way vanished. Every rule sits inside @media (forced-colors: active):
   nothing here applies in normal rendering. Shape cues for controls use an inset outline rather than
   a border so no box grows and no layout moves. The file name sorts last among section styles, so
   these rules win over the component files at equal specificity. */

@media (forced-colors: active) {

	/* ------------------------------------------------------------ B-1: contact form fields
	   The edge, the focus ring and the error state were inset box-shadows on a border: 0 field.
	   The fields are border-box, so a 1px border keeps their size. */
	.ct-input { border: 1px solid CanvasText; }
	.ct-input:hover { border-color: Highlight; }
	.ct-input:focus, .ct-input:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
	.ct-input:disabled { border-color: GrayText; }
	/* Error: a 3px edge, clearly heavier than the 1px idle edge (the message text stays as well). */
	.ct-field.is-error .ct-input { border-width: 3px; }

	/* ------------------------------------------------------------ B-2: ROI calculator sliders
	   Rail, fill and knob were backgrounds and the native range is transparent. The rail gets an
	   edge, the filled part keeps a Highlight fill (forced-color-adjust: none so it is not reset to
	   Canvas), the knob gets an edge over its Canvas fill, and keyboard focus draws an outline. */
	.sb-roi__rail { border: 1px solid CanvasText; }
	.sb-roi__fill { forced-color-adjust: none; background: Highlight; }
	.sb-roi__knob { border: 2px solid CanvasText; }
	.sb-roi__range:focus-visible ~ .sb-roi__knob-rail .sb-roi__knob { border-color: Highlight; outline: 2px solid Highlight; outline-offset: 2px; }

	/* ------------------------------------------------------------ B-5: logos
	   The artwork is a one-color PNG (dark or white) that forced colors leaves alone, so the dark
	   logo disappeared on a dark Contrast theme (and the white one would on a light theme). Recolor
	   every logo to the theme's text color: white on dark themes, black on light themes. */
	.nav__logo img, .mbar__logo img, .foot__logo { filter: brightness(0); }
}

@media (forced-colors: active) and (prefers-color-scheme: dark) {
	.nav__logo img, .mbar__logo img, .foot__logo { filter: brightness(0) invert(1); }
}
/* Home overlay header before it lights up: it is transparent over the hero photo, which forced
   colors keeps dark in every theme, so the logo stays white there in light themes too. */
@media (forced-colors: active) and (min-width: 1280px) {
	.site-header--overlay:not(.is-lit):not(:has(.mega.is-open)) .nav__logo img { filter: brightness(0) invert(1); }
}

@media (forced-colors: active) {

	/* ------------------------------------------------------------ B-8: control and surface shapes
	   Buttons, chips, pills, cards, the home project tabs, the cookie bar and the chat button lost
	   their outline. A 1px inset outline in CanvasText restores the shape without changing any box.
	   Focusable ones skip it while focused, so the site's 2px focus ring still shows. */
	.btn:not(:focus-visible),
	.hm-tab:not(:focus-visible),
	.fchip:not(:focus-visible),
	#sth-launcher:not(:focus-visible),
	.chip, .pill, .ftag, .hm-pill, .chipsg__chip,
	.card:not([data-card-link]),
	[data-card-link]:not(:has(.card-link:focus-visible)),
	#sthenos-cookie-consent {
		outline: 1px solid CanvasText; outline-offset: -1px;
	}
	/* The selected project tab was marked only by its background: a heavier edge marks it. */
	.hm-tab.is-active:not(:focus-visible) { outline-width: 3px; outline-offset: -3px; }

	/* ------------------------------------------------------------ B-9: "On this page" active entry
	   Its bar is a ::before background, which forced colors removed. Keep it, in Highlight. */
	body.sth-article .toc--side .toc__a[aria-current="true"]::before { forced-color-adjust: none; background: Highlight; }
}

/* Second forced-colors pass, 2026-11-30 (Chrome forced-colors emulation, both palettes, all 278
   pages). Same rule as above: everything sits inside @media (forced-colors: active). */
@media (forced-colors: active) {

	/* ------------------------------------------------------------ HC-1: FAQ open/closed chevron
	   It is a mask over a currentColor background; forced colors reset the background to the page
	   color, so the chevron vanished and the open state had no mark. */
	.faq__q::after { forced-color-adjust: none; background: CanvasText; }

	/* ------------------------------------------------------------ HC-2: blog search field
	   Its edge was an inset shadow only. Below 768 the box is the field; from 768 the whole bar is. */
	.hsearch__box:not(:focus-within) { outline: 1px solid CanvasText; outline-offset: -1px; }

	/* ------------------------------------------------------------ HC-3: icons with their own color
	   An svg keeps a color set on itself in forced colors, so brand-blue and ink icons (search
	   glass, select chevron, eyebrow spark, info note, list arrows, "On this page" chevron) sat
	   near 2:1 on a dark theme. Inheriting gives them the theme color of the text beside them. */
	svg.ico, svg[class*="wp-ico"], .hsearch__ico, .ct-select__chev { color: inherit !important; }

	/* ------------------------------------------------------------ HC-4: list markers
	   Dots drawn as a background vanished, so list items read as loose lines. */
	.article__body > ul > li::before,
	.scene__pill::before, .scene__tags li::before,
	.cert::before { forced-color-adjust: none; background: CanvasText; }
	/* Check marks were a background image on a tinted disc. Draw the same check as a mask filled
	   with the theme text color. */
	.sth-wp-post .article__body .sv-checks > li::before {
		forced-color-adjust: none; border-radius: 0; background: CanvasText;
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
	}

	/* ------------------------------------------------------------ HC-5: more shapes drawn by shadow
	   Footer social links and the case-study chip links (same inset outline as B-8). */
	.social:not(:focus-visible),
	#sthenos-cs h2 + p + div > a:not(:focus-visible) { outline: 1px solid CanvasText; outline-offset: -1px; }

	/* ------------------------------------------------------------ HC-6: keyboard focus
	   One ring color in every theme, clearly different from the 1px CanvasText shape outlines. */
	:focus-visible { outline-color: Highlight !important; }
	[data-card-link]:has(.card-link:focus-visible) { outline: 2px solid Highlight; outline-offset: 3px; }
	/* The blog search draws its ring on the box around the input. */
	.hsearch__box:focus-within { outline: 2px solid Highlight; outline-offset: 3px; }
	/* Chat button and chat message box (the widget prints its own styles later, hence !important):
	   an inside ring sits on the control's own fill, whatever is behind it. */
	#sth-launcher:focus-visible { outline: 2px solid Highlight !important; outline-offset: -4px !important; }
	#sth-input:focus-visible { outline: 2px solid Highlight !important; outline-offset: -2px !important; }
	/* Chat icons are filled white by the widget; on a light theme that was white on white. */
	#sth-launcher, #sth-send { background: ButtonFace !important; }
	#sth-launcher svg, #sth-send svg { fill: ButtonText !important; }
	#sth-send:not(:focus-visible) { outline: 1px solid ButtonText; outline-offset: -1px; }
	/* Buttons over a photo (hero, closing banner): a see-through button kept the photo behind it, and
	   the photo stays dark in every theme, so its outline and its focus ring could vanish. Every
	   button gets the theme's page color as its fill and an inside focus ring. */
	.btn { background-color: Canvas; }
	.btn:focus-visible { outline-offset: -4px; }
}
/* Home overlay header before it lights up: it sits on the hero photo, which stays dark in every
   theme, so a ring in a theme color could vanish there (it did on light themes). The focused item
   gets the theme's page color behind it and an inside ring, and the logo takes the theme's text
   color while focused so it stays visible on that fill. */
@media (forced-colors: active) and (min-width: 1280px) {
	.site-header--overlay:not(.is-lit):not(:has(.mega.is-open)) .nav :focus-visible { background-color: Canvas; outline-offset: -2px; }
	/* The menu arrows take the theme's text color, which is dark on a light theme and vanished on the
	   photo (the labels were fine: the browser puts the page color behind text, not behind a drawing).
	   Each menu item now has the page color behind the whole item, arrow included. */
	.site-header--overlay:not(.is-lit):not(:has(.mega.is-open)) .nav .nav-link { background-color: Canvas; }
	.site-header--overlay:not(.is-lit):not(:has(.mega.is-open)) .nav .nav-link__chev { opacity: 1; }
	/* The logo is an image, larger than its link box, so it keeps its white art and gets a white
	   ring instead (a fixed color is right here: the photo behind it is the same in every theme). */
	.site-header--overlay:not(.is-lit):not(:has(.mega.is-open)) .nav .nav__logo:focus-visible { forced-color-adjust: none; background-color: transparent; outline: 2px solid #fff !important; outline-offset: 3px; }
}
@media (forced-colors: active) and (min-width: 768px) {
	.hsearch { outline: 1px solid CanvasText; outline-offset: -1px; }
	.hsearch__box:not(:focus-within) { outline: 0; }
}
