/* clean — единната система за текста и отстъпите (карта 016, 10.10.2026; решение на Сашо: една система за целия сайт, и за новите страници).
   Девет стъпки (theme.json → custom.type): заглавие на страница, на раздел, подзаглавие, малко заглавие, текст, дребен текст, бутон,
   голямо число, етикет — всяка с компютър (clamp с таван за 5K), таблет (≤ 980) и телефон (≤ 767). Тухличките ползват САМО var(--t-…);
   пазачът е tools/lint_clean.py (font-size извън --t-… се отказва). Отстъпите: текст и бутон в лентите никога по-близо до ръба
   от --t-gl / --t-gr (таблет 6,5vw / 4,5vw, телефон 9vw / 5vw); на компютър 0 — остава отстъпът на тухличката (max()).
   Зарежда се на всички страници (чисти и старите /en/, /de/, /newsletter-igra/) преди останалия CSS. */
:root {
	--t-title: var(--wp--custom--type--title);
	--t-section: var(--wp--custom--type--section);
	--t-sub: var(--wp--custom--type--sub);
	--t-minor: var(--wp--custom--type--minor);
	--t-text: var(--wp--custom--type--text);
	--t-small: var(--wp--custom--type--small);
	--t-button: var(--wp--custom--type--button);
	--t-number: var(--wp--custom--type--number);
	--t-label: var(--wp--custom--type--label);
	--t-lh-head: var(--wp--custom--type--lh-head);
	--t-lh-text: var(--wp--custom--type--lh-text);
	--t-lh-small: var(--wp--custom--type--lh-small);
	--t-lh-number: var(--wp--custom--type--lh-number);
	--t-caps: var(--wp--custom--type--caps);
	--t-gl: var(--wp--custom--type--gutter-none);
	--t-gr: var(--wp--custom--type--gutter-none);
	--t-gb: var(--wp--custom--type--box-gap); /* (019) най-малкият отстъп на текста до ръба на цветната му кутия (горе/долу/ляво) */
}
@media (max-width: 980px) {
	:root {
		--t-title: var(--wp--custom--type--title-tablet);
		--t-section: var(--wp--custom--type--section-tablet);
		--t-sub: var(--wp--custom--type--sub-tablet);
		--t-minor: var(--wp--custom--type--minor-tablet);
		--t-text: var(--wp--custom--type--text-tablet);
		--t-small: var(--wp--custom--type--small-tablet);
		--t-button: var(--wp--custom--type--button-tablet);
		--t-number: var(--wp--custom--type--number-tablet);
		--t-label: var(--wp--custom--type--label-tablet);
		--t-gl: var(--wp--custom--type--gutter-tablet-left);
		--t-gr: var(--wp--custom--type--gutter-tablet-right);
		--t-gb: var(--wp--custom--type--box-gap-tablet);
	}
}
@media (max-width: 767px) {
	:root {
		--t-title: var(--wp--custom--type--title-phone);
		--t-section: var(--wp--custom--type--section-phone);
		--t-sub: var(--wp--custom--type--sub-phone);
		--t-minor: var(--wp--custom--type--minor-phone);
		--t-text: var(--wp--custom--type--text-phone);
		--t-small: var(--wp--custom--type--small-phone);
		--t-button: var(--wp--custom--type--button-phone);
		--t-number: var(--wp--custom--type--number-phone);
		--t-label: var(--wp--custom--type--label-phone);
		--t-gl: var(--wp--custom--type--gutter-phone-left);
		--t-gr: var(--wp--custom--type--gutter-phone-right);
		--t-gb: var(--wp--custom--type--box-gap-phone);
	}
}
/* (016, 11.10.2026, основно правило на Сашо: „НИКОГА не пренасяй с тире дума от заглавие!“) заглавията не се пренасят по срички — дума,
   която не се побира, отива на нов ред; пазачът (tools/lint_clean.py) отказва hyphens: auto в правило за заглавие */
:is(h1, h2, h3, h4, h5, h6, .wp-block-heading, [class*="__title"], summary) { hyphens: manual !important; -webkit-hyphens: manual !important; }
/* (016, 11.10.2026) дума от заглавие не се реже, без JS (водещият): inc/heading-fit.php дава xp-w-N по най-дългата дума в знаци.
   (19.10.2026, пускане 40) Вместо постоянния множител по N и тухличка (xp-wk, мерен за най-тесния случай и прилаган навсякъде —
   „Каузи“ DE, EN услугите на 390) размерът е min(стъпката, ширината на колоната / ширината на най-широката дума): heading-fit.php
   слага --xp-wu (думата с главни, em) и --xp-wl (както е написана) по таблицата на шрифта (inc/heading-em-table.php, мярка
   p99 1,004 → запас ×1,035); 100cqi е ширината на прекия родител (container-type по-долу). Само надолу: при място — стъпката.
   Браузър без cqi вижда само стъпката (@supports; невалидна min() в custom property не пада към предходна декларация — водещият).
   Разредката: --t-caps = normal (theme.json) — 0 заглавия с letter-spacing; ако стане em, тук се добавя × броя знаци. */
[class*="xp-w-"] {
	--t-title: var(--wp--custom--type--title);
	--t-section: var(--wp--custom--type--section);
	--t-sub: var(--wp--custom--type--sub);
	--t-minor: var(--wp--custom--type--minor);
}
@media (max-width: 980px) {
	[class*="xp-w-"] {
		--t-title: var(--wp--custom--type--title-tablet);
		--t-section: var(--wp--custom--type--section-tablet);
		--t-sub: var(--wp--custom--type--sub-tablet);
		--t-minor: var(--wp--custom--type--minor-tablet);
	}
}
@media (max-width: 767px) {
	[class*="xp-w-"] {
		--t-title: var(--wp--custom--type--title-phone);
		--t-section: var(--wp--custom--type--section-phone);
		--t-sub: var(--wp--custom--type--sub-phone);
		--t-minor: var(--wp--custom--type--minor-phone);
	}
}
@supports (width: 1cqi) {
	[class*="xp-w-"] {
		--xp-wd: var(--xp-wu, 0.01);
		--xp-cq: 100cqi; /* наличната ширина: контейнерът, или собствената ширина на заглавието, когато е по-тясна (по-долу) */
		--xp-cq2: 100cqi; /* втори таван (max-width от панела в героя) */
		--xp-fit: calc(min(100cqi, var(--xp-cq), var(--xp-cq2)) / (var(--xp-wd) * 1.035));
		--t-title: min(var(--wp--custom--type--title), var(--xp-fit));
		--t-section: min(var(--wp--custom--type--section), var(--xp-fit));
		--t-sub: min(var(--wp--custom--type--sub), var(--xp-fit));
		--t-minor: min(var(--wp--custom--type--minor), var(--xp-fit));
	}
	/* xp-wl:начало — контекстите без главни (мярка: tools/tests/head_floor_probe.py, колоната „регистър“, local/040/floor-before-sample.tsv
	   и text-transform: none в темата): заглавието на картата на запис, на бюлетина, на брояча, на реда в падащия списък, цитатите в
	   „Примери“ (h5/h6), текстът на статия. Другаде по подразбиране главни (по-широката дума → при грешка само по-малко, никога отрязано). */
	:is(.xp-rc__title, .xp-ft__title, .xp-counter__title, .xp-accordion__title, .xp-newsletter__title, .xp-b-svc-examples :is(h5, h6), .xp-art :is(h2, h3, h4, h5):not(.xp-h1), .xp-post__content :is(h2, h3, h4, h5))[class*="xp-w-"] { --xp-wd: var(--xp-wl, 0.01); }
	/* xp-wl:край */
	/* xp-cqw:начало — заглавия със собствена ширина, по-тясна от контейнера (23.10.2026, test_023 „Industrietypen“ 1366: заглавието 60vw =
	   768 px в колона 1093 → думата 783 px се чупеше на 2 реда): наличната ширина = ширината на заглавието. Огледало на правилата за
	   ширина: svc-hero/clean.css и assets/css/modules/b-svc-hero.css (--hx-hw по ширина), assets/css/clean/tw.css (xp-tw-N от 981 px),
	   modules/service.css (is-h1-N от 981 px). Където ширината е auto, остава контейнерът. */
	.xp-b-svc-hero h1[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-hero--w-60); }
	.xp-b-svc-hero.has-title-w-50 h1[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-hero--w-50); }
	.xp-b-svc-hero.has-title-w-55 h1[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-hero--w-55); }
	.xp-b-svc-hero.has-title-w-70 h1[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-hero--w-70); }
	.xp-b-svc-hero.has-title-w-80 h1[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-hero--w-80); }
	@media (min-width: 981px) {
		.xp-clean :is(h2, h3, h4).xp-tw-20[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-20); }
		.xp-clean :is(h2, h3, h4).xp-tw-25[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-25); }
		.xp-clean :is(h2, h3, h4).xp-tw-30[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-30); }
		.xp-clean :is(h2, h3, h4).xp-tw-35[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-35); }
		.xp-clean :is(h2, h3, h4).xp-tw-40[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-40); }
		.xp-clean :is(h2, h3, h4).xp-tw-45[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-45); }
		.xp-clean :is(h2, h3, h4).xp-tw-50[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-50); }
		.xp-clean :is(h2, h3, h4).xp-tw-55[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-55); }
		.xp-clean :is(h2, h3, h4).xp-tw-60[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-60); }
		.xp-clean :is(h2, h3, h4).xp-tw-65[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-65); }
		.xp-clean :is(h2, h3, h4).xp-tw-70[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-70); }
		.xp-clean :is(h2, h3, h4).xp-tw-75[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-75); }
		.xp-clean :is(h2, h3, h4).xp-tw-80[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-80); }
		.xp-clean :is(h2, h3, h4).xp-tw-85[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-85); }
		.xp-clean :is(h2, h3, h4).xp-tw-90[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-90); }
		.xp-clean :is(h2, h3, h4).xp-tw-95[class*="xp-w-"] { --xp-cq: var(--wp--custom--tw--n-95); }
		.xp-sv-intro.is-h1-50 h1[class*="xp-w-"] { --xp-cq: calc(50 * var(--wp--custom--vw)); }
		.xp-sv-intro.is-h1-55 h1[class*="xp-w-"] { --xp-cq: calc(55 * var(--wp--custom--vw)); }
		.xp-sv-intro.is-h1-60 h1[class*="xp-w-"] { --xp-cq: calc(60 * var(--wp--custom--vw)); }
		.xp-sv-intro.is-h1-65 h1[class*="xp-w-"] { --xp-cq: calc(65 * var(--wp--custom--vw)); }
		.xp-sv-intro.is-h1-70 h1[class*="xp-w-"] { --xp-cq: calc(70 * var(--wp--custom--vw)); }
		.xp-sv-intro.is-h1-75 h1[class*="xp-w-"] { --xp-cq: calc(75 * var(--wp--custom--vw)); }
		.xp-sv-intro.is-h1-80 h1[class*="xp-w-"] { --xp-cq: calc(80 * var(--wp--custom--vw)); }
		.xp-sv-intro.is-h1-85 h1[class*="xp-w-"] { --xp-cq: calc(85 * var(--wp--custom--vw)); }
		.xp-sv-intro.is-h1-90 h1[class*="xp-w-"] { --xp-cq: calc(90 * var(--wp--custom--vw)); }
		/* героят с панел: заглавието е до панела (svc-hero/clean.panel.css max-width) — „Industrietypen“ 1366: 768 px, не 60vw = 820 */
		.xp-b-svc-hero.has-panel:is(.has-panel-edge, :not([class*="has-title-w-"])):not(.has-panel-left) h1[class*="xp-w-"] { --xp-cq2: calc(var(--hx-panel-l) - var(--hx-pl) - var(--t-gb)); }
	}
	/* картата на запис: името е с поле от двете страни (record-cards/style.css margin: --cards--pad) — „предизвикателства“ 1366: 299 px в 272 */
	.xp-rc__name[class*="xp-w-"] { --xp-cq: calc(100cqi - 2 * var(--wp--custom--cards--pad)); }
	/* „Примери“ с плъзгач: заглавието е max-content до --ex-tw (svc-examples/clean.css) — „ангажираността“ 1366: 232 px в 206 */
	.xp-b-svc-examples.is-slider > :is(h2, h3, h4)[class*="xp-w-"] { --xp-cq: var(--ex-tw); }
	/* картата в „Примери“: заглавието е с ширина --card-inner (b-svc-examples.css .post_title) — „ангажираността“ 1366: 232 px в 206 */
	.xp-b-svc-examples .xp-card .post_title[class*="xp-w-"] { --xp-cq: calc(100cqi - 40px); } /* card-inner е calc(100% - 40px): „%“ във font-size е спрямо шрифта на родителя → тук cqi */
	/* (040 поправка 2, 23.10.2026, пълната проба 1 627 × 4: 17 разделени срещу 2 при 026) картите на записи: заглавието е с поле 20 px от
	   двете страни (theme.css .xp-card .post_title margin 20px !important; lists.css 0 20px) — „Generationenwechsel“ /de/ 768: 236 px в 205;
	   списъкът на записи: името с margin-inline --list--card-pad (record-list/style.css) — „предизвикателства“ /blog/ 768: 212 px в 205 */
	.xp-card .post_title[class*="xp-w-"] { --xp-cq: calc(100cqi - 40px); }
	.xp-rl__card > .xp-rl__name[class*="xp-w-"] { --xp-cq: calc(100cqi - 2 * var(--wp--custom--list--card-pad)); }
	@media (max-width: 980px) {
		/* героят: заглавието е с margin-right по svc-hero/clean.gutter.css (is-wide на таблет: --hx-hmr 10vw) — „personenbezogene“ GDPR DE
		   768: 545 px в 517; отрицателното поле (до ръба) не дава повече място от контейнера → max(0px, …) */
		.xp-b-svc-hero h1[class*="xp-w-"], .xp-b-svc-hero[class*="has-title-w-"] h1[class*="xp-w-"] { --xp-cq: calc(100cqi - max(0px, var(--hx-hmr, 0px), calc(var(--t-gr, 0px) - max(var(--hx-pr, 0px), var(--t-gr, 0px))))); }
		.xp-b-svc-hero.has-title-wt-60 h1[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-hero--w-60); }
		.xp-b-svc-hero.has-title-wt-80 h1[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-hero--w-80); }
	}
	@media (max-width: 767px) {
		.xp-b-svc-hero h1[class*="xp-w-"], .xp-b-svc-hero[class*="has-title-w-"] h1[class*="xp-w-"] { --xp-cq: 100cqi; }
		.xp-b-svc-hero.has-title-wp-60 h1[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-hero--w-60); }
		.xp-b-svc-hero.has-title-wp-70 h1[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-hero--w-70); }
	}
	/* (040, 23.10.2026 05:2x, одитът: defect на 76-те засегнати адреса — 12 нови разделени думи след cqi, 2 преди; П5) още заглавия със
	   собствена кутия, по-тясна от контейнера: „Видове“ (svc-types/clean.css max-width --title-w / таблет / телефон, clean.title.css от 1280 px;
	   картата: заглавието с отстъп --card-x от двете страни — „Unternehmenskommunikation“ 292 − 70 px), „Текст“ (svc-text/clean.css max-width
	   --t-hw от 981 px — „Dienstleistungen“ 820 px в колона 1 133). */
	.xp-b-svc-types.xp-b > :is(h2, h3, h4)[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-types--title-w); }
	.xp-b-svc-types.is-look-images.xp-b > :is(h2, h3, h4)[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-types--card-w); }
	.xp-b-svc-types.is-look-card.xp-b .xp-cover > .xp-cover__title[class*="xp-w-"] { --xp-cq: calc(100cqi - 2 * var(--wp--custom--svc-types--card-x)); }
	@media (min-width: 981px) {
		.xp-b-svc-text > :is(h2, h3, h4, h5, h6)[class*="xp-w-"] { --xp-cq: var(--t-hw); }
		.xp-b-svc-text.has-head-w-first > :is(h2, h3, h4, h5, h6)[class*="xp-w-"]:not(:is(h2, h3, h4, h5, h6) ~ *) { --xp-cq: calc(var(--t-hwf-n) * var(--wp--custom--vw)); }
	}
	@media (min-width: 1280px) {
		.xp-b-svc-types.xp-b.has-title-w-46:not(.is-look-card) > :is(h2, h3, h4)[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-types--title-w-46); }
		.xp-b-svc-types.xp-b.has-title-w-60:not(.is-look-card) > :is(h2, h3, h4)[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-types--title-w-60); }
		.xp-b-svc-types.xp-b.has-title-w-70:not(.is-look-card) > :is(h2, h3, h4)[class*="xp-w-"] { --xp-cq: var(--wp--custom--svc-types--title-w-70); }
	}
	@media (max-width: 980px) {
		.xp-b-svc-types.xp-b > :is(h2, h3, h4)[class*="xp-w-"] { --xp-cq: min(var(--wp--custom--svc-types--title-w-tablet), calc(100cqi - var(--wp--custom--svc-types--side) - var(--t-gr))); }
	}
	@media (max-width: 767px) {
		.xp-b-svc-types.xp-b > :is(h2, h3, h4)[class*="xp-w-"] { --xp-cq: min(var(--wp--custom--svc-types--w-phone), calc(100cqi - var(--wp--custom--svc-types--title-side-phone) - var(--t-gr))); }
	}
	/* xp-cqw:край */
	@media (max-width: 980px) {
		[class*="xp-w-"] {
			--t-title: min(var(--wp--custom--type--title-tablet), var(--xp-fit));
			--t-section: min(var(--wp--custom--type--section-tablet), var(--xp-fit));
			--t-sub: min(var(--wp--custom--type--sub-tablet), var(--xp-fit));
			--t-minor: min(var(--wp--custom--type--minor-tablet), var(--xp-fit));
		}
	}
	@media (max-width: 767px) {
		[class*="xp-w-"] {
			--t-title: min(var(--wp--custom--type--title-phone), var(--xp-fit));
			--t-section: min(var(--wp--custom--type--section-phone), var(--xp-fit));
			--t-sub: min(var(--wp--custom--type--sub-phone), var(--xp-fit));
			--t-minor: min(var(--wp--custom--type--minor-phone), var(--xp-fit));
		}
	}
	/* xp-cq:начало — прекият родител на заглавие с xp-w-* е контейнер. Без родителите, при които пробата tools/tests/cq_parent_probe.py
	   (local/040/cqp-q*.tsv, 1 627 × 5) показа промяна: колоната с текст в „Медия“ на кейсовете (.xp-md__text: ширина → 0 на 1366–1920, 93
	   страници), вътрешността на обложката при обявите (.wp-block-cover__inner-container: 390 → 78 px), текстовата лента в кейсовете
	   (.xp-tx: +30 px височина от спряното сливане на полетата), групите по устройство (.xp-mv) и бюлетинът (.xnl__head). Там заглавието
	   остава на стъпката (както досега: за тях xp-wk нямаше правила). Слайдът на въртележката (±0,3 px от мащаба) остава контейнер. */
	:has(> [class*="xp-w-"]):not(.xp-md__text, .wp-block-cover__inner-container, .xp-tx, .xp-mv, .xnl__head) { container-type: inline-size; }
	/* xp-cq:край */
}
