/**
 * Consistency layer — shared across all markets (part of the child).
 *
 * Unifies typography, content rhythm and buttons at the CSS layer,
 * without changing the content or the way it is displayed.
 * Loaded automatically after the child's style.css (inc/consistency.php).
 *
 * Audit 2026-07-02 (FI and UK, same parent theme): H2 32/36px depending
 * on the template, six H3 variants (16-32px, some larger than H2),
 * H4 28px > H3 24px, four paragraph line-heights (1.6-1.75), lists 16px/1.3,
 * buttons with weights 400-700, pills 200px/999px/2000px/9999px,
 * stray foreign fonts (inline font-family, sans-serif in SVG).
 */

/* ---------------------------------------------------------------
 * 1. Typographic scale — one for all templates
 * ------------------------------------------------------------- */
:root {
	--h1-font-size: min(11vw, 2.5rem);   /* 40px */
	--h2-font-size: min(8vw, 2rem);      /* 32px */
	--h3-font-size: 1.5rem;              /* 24px */
	--h4-font-size: 1.25rem;             /* 20px */
	--h5-font-size: 1.125rem;            /* 18px */
	--h6-font-size: 1rem;                /* 16px */
	--content-line-height: 1.7;
	--heading-margin-bottom: 1.5rem;     /* 24px — instead of the 20/24/25px mix */
}

/* CONTENT headings (Gutenberg, .wp-block-heading) — component headings
 * (cards, FAQ, tables) remain untouched.
 * !important wins over sizes set manually in the editor;
 * this is intentional — the normalization must also apply to old posts. */
.wysiwyg-part h1.wp-block-heading { font-size: var(--h1-font-size) !important; font-weight: 700; }
.wysiwyg-part h2.wp-block-heading { font-size: var(--h2-font-size) !important; font-weight: 700; }
.wysiwyg-part h3.wp-block-heading { font-size: var(--h3-font-size) !important; font-weight: 600; }
.wysiwyg-part h4.wp-block-heading { font-size: var(--h4-font-size) !important; font-weight: 600; }
.wysiwyg-part h5.wp-block-heading { font-size: var(--h5-font-size) !important; font-weight: 600; }
.wysiwyg-part h6.wp-block-heading { font-size: var(--h6-font-size) !important; font-weight: 600; }

.wysiwyg-part :is(h2, h3, h4, h5, h6).wp-block-heading {
	margin-bottom: var(--heading-margin-bottom);
	line-height: 1.2;
}

/* ---------------------------------------------------------------
 * 2. Content rhythm — one line-height for paragraphs and lists in an article
 * ------------------------------------------------------------- */
/* !important as with the headings — old posts have a line-height
 * set inline from the editor (26/28px) and we cannot override it otherwise.
 * There will be no new stragglers: theme.json disables the lineHeight control. */
.wysiwyg-part p {
	line-height: var(--content-line-height) !important;
}

/* Lists in the content: paragraph size (16px) and the same leading.
 * Component lists (cards, tables, navigation) have their own classes
 * and are not caught by these selectors. */
.wysiwyg-part .wp-block-list li,
.wysiwyg-part .wp-block-group__inner-container > ul li,
.wysiwyg-part .wp-block-group__inner-container > ol li {
	font-size: var(--main-font-size);
	line-height: var(--content-line-height) !important;
	margin-bottom: 0.5em;
}

/* ---------------------------------------------------------------
 * 3. Buttons — primary 700, secondary 600, one radius from the token
 * ------------------------------------------------------------- */
/* CTAs from the content (Buttons block) — previously weight 400 and radius 9999px */
.wp-block-button__link {
	font-weight: 600;
	border-radius: var(--button-border-radius);
}

/* ---------------------------------------------------------------
 * 4. Stray fonts
 * ------------------------------------------------------------- */
/* Text in SVG badges fell back to sans-serif instead of the theme font */
svg text {
	font-family: var(--main-font-family);
}

/* Editor leftovers (inline font-family) in the content */
.wysiwyg-part span[style*="font-family"] {
	font-family: var(--main-font-family) !important;
}
