/* The design language (spec §3.7): the tokens every widget reads, in a light and a dark scheme.
   Loaded once, before any widget's own stylesheet.

   Our surfaces (cards, controls) carry their own colours, so their text stays readable on any
   theme. Text that sits on the page itself still inherits the theme. Fonts always come from the
   theme. The accent comes from the widget's Accent colour control. */
.hafe-ui {
	--hafe-accent: var(--hafe-accent-color, #237562);
	--hafe-surface: #fff;
	--hafe-ink: #14161a;
	--hafe-ink-soft: #5a6170;
	--hafe-line: #d0d2d8;
	--hafe-tint: color-mix(in srgb, var(--hafe-accent) 11%, var(--hafe-surface));
	--hafe-tint-strong: color-mix(in srgb, var(--hafe-accent) 18%, var(--hafe-surface));
	--hafe-accent-ink: color-mix(in srgb, var(--hafe-accent) 85%, #000);
	--hafe-on-accent: #fff;
	--hafe-shadow: 0 1px 2px rgb(16 24 40 / 5%), 0 12px 32px -10px rgb(16 24 40 / 12%);
	--hafe-shadow-up: 0 2px 4px rgb(16 24 40 / 6%), 0 24px 48px -16px rgb(16 24 40 / 22%);
	--hafe-ring: 0 1px 2px rgb(16 24 40 / 6%), 0 0 0 1px var(--hafe-line);
	/* Solid has no frame: on a light grey section its tinted cards need a small lift to stand out.
	   The dark scheme's fills already stand out, so it has none (owner, 2026-11-27). */
	--hafe-solid-lift: 0 1px 2px rgb(16 24 40 / 8%), 0 6px 16px -6px rgb(16 24 40 / 14%);
	--hafe-radius: 1.25rem;
	--hafe-radius-sm: 0.75rem;
	--hafe-pill: 999px;
	box-sizing: border-box;
	overflow-wrap: anywhere;
}

/* The dark scheme, for dark sections and dark sites (the widget's Colour scheme control). */
.hafe-scheme-dark .hafe-ui {
	--hafe-surface: #1b1f26;
	--hafe-ink: #e8eaee;
	--hafe-ink-soft: #a3a9b4;
	--hafe-line: rgb(255 255 255 / 10%);
	--hafe-tint: color-mix(in srgb, var(--hafe-accent) 24%, var(--hafe-surface));
	--hafe-tint-strong: color-mix(in srgb, var(--hafe-accent) 34%, var(--hafe-surface));
	--hafe-accent-ink: color-mix(in srgb, var(--hafe-accent) 50%, #fff);
	--hafe-shadow: 0 0 0 1px rgb(255 255 255 / 6%), 0 12px 32px -12px rgb(0 0 0 / 60%);
	--hafe-shadow-up: 0 0 0 1px rgb(255 255 255 / 8%), 0 24px 48px -16px rgb(0 0 0 / 70%);
	--hafe-ring: 0 0 0 1px var(--hafe-line);
	--hafe-solid-lift: 0 0 #0000;
	/* The browser's own parts too: scrollbars, fields and their placeholders. */
	color-scheme: dark;
}

/* A mouse click leaves no outline: block themes outline anything focused. The keyboard keeps its own. */
.hafe-ui :focus:not(:focus-visible) {
	outline: none;
}

.hafe-ui :focus-visible {
	outline: 2px solid var(--hafe-accent);
	outline-offset: 2px;
}

/* Tables inherit colour and type, as outside quirks mode: on a block theme, Elementor's inline CSS can
   come before the doctype (spec §4). No weight, so any widget rule wins. */
:where(.hafe-ui) table {
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	font-style: inherit;
	line-height: inherit;
}

/* With Elementor's Inline Font Icons switched off, icons come as an icon font's <i>, each glyph its
   own width and on the font's line. They take the square an SVG icon takes. */
.hafe-ui i[aria-hidden="true"][class] {
	display: inline-block;
	inline-size: 1em;
	block-size: 1em;
	line-height: 1;
	text-align: center;
}

/* Elementor's Site Settings (Theme Style) style every button, field, label and image on the page,
   from `.elementor-kit-N img` up to `.elementor-kit-N input:focus:not(…):not(…)`. What a widget
   draws keeps its design (research/2026-11-18-compat-elementor-settings.md).

   Its buttons, fields and labels get the browser's type back (revert), which a widget's own rules
   build on. This weighs a class and two elements: more than the Kit's buttons and labels, less than
   any rule of a widget's own. */
.hafe-ui :is(button, input, select, textarea, label):not(svg) {
	font-family: revert;
	font-size: revert;
	font-weight: revert;
	font-style: revert;
	line-height: revert;
	letter-spacing: revert;
	word-spacing: revert;
	text-transform: revert;
	text-shadow: revert;
}

/* Its fields too, whose rules weigh up to an id (:not(#hafe-never)), against the Kit's focused fields. */
.hafe-ui :is(input, textarea):not(#hafe-never) {
	letter-spacing: revert;
	word-spacing: revert;
	text-transform: revert;
	accent-color: revert;
}

/* Its pictures keep their frame, hovered too: no border, shadow, filter or fading, and the corners
   the widget gives them in --hafe-img-radius. Images in text written into a widget follow the site,
   like any picture in a post. Two classes and two elements: more than the Kit's `img:hover`. */
.hafe-ui img:is(.hafe-ba__img, .hafe-gallery__image, .hafe-gallery__full, .hafe-posts__image, .hafe-pricing__image, .hafe-table__image, .hafe-timeline__image, .hafe-counter__media--image img, .hafe-ib__media--image img, .hafe-steps__marker img, .hafe-team__photo img, .hafe-tst__photo img) {
	border: 0;
	border-radius: var(--hafe-img-radius, 0);
	box-shadow: none;
	opacity: 1;
	filter: none;
}
