/**
 * Local aliases of the theme.json tokens: the approved visual identity
 * (D-021), applied in Stage 8 (D-030).
 *
 * Loaded on the site and inside the block editor, so both share the same
 * names. Every value comes from theme.json: presets (--wp--preset--*), layout
 * sizes (--wp--style--global--*) and custom values (--wp--custom--*). Change
 * the values in theme.json, never here. This file only gives each value a
 * role (text, heading, link, accent…), so components never pick a color by
 * its name.
 *
 * Contrast (WCAG 2.2, D-021 and D-030): graphite on ivory 10.96:1, brand blue
 * on ivory 9.68:1, support blue on ivory 5.65:1 (muted text), graphite on
 * peach 7.49:1, brand blue on peach 6.61:1. Terracotta on ivory is 4.40:1, so
 * it is used only for large text and details that are not text (rules,
 * borders, underline color); peach is never a text color on light
 * backgrounds. On peach and on the derived surface, muted text falls back to
 * graphite (support blue on peach is only 3.86:1).
 *
 * ".editor-styles-wrapper" is the editor canvas; WordPress leaves selectors
 * that already name it untouched when it loads editor styles.
 */

:root,
.editor-styles-wrapper {
	/* Colors by role. */
	--carolsaling-color-text: var(--wp--preset--color--graphite);
	--carolsaling-color-background: var(--wp--preset--color--ivory);
	--carolsaling-color-heading: var(--wp--preset--color--brand);
	--carolsaling-color-link: var(--wp--preset--color--brand);
	--carolsaling-color-muted: var(--wp--preset--color--brand-support);
	--carolsaling-color-accent: var(--wp--preset--color--terracotta);
	--carolsaling-color-highlight: var(--wp--preset--color--peach);
	--carolsaling-color-surface: var(--wp--custom--color--surface);
	--carolsaling-color-border: var(--wp--custom--color--border);
	--carolsaling-color-field-border: var(--wp--preset--color--brand-support);
	--carolsaling-color-inverse-background: var(--wp--preset--color--brand);
	--carolsaling-color-inverse-text: var(--wp--preset--color--ivory);
	--carolsaling-color-button: var(--wp--preset--color--brand);
	--carolsaling-color-button-text: var(--wp--preset--color--ivory);
	--carolsaling-color-button-hover: var(--wp--preset--color--brand-support);
	--carolsaling-color-focus: var(--wp--preset--color--brand);

	/* Fonts and weights. */
	--carolsaling-font-text: var(--wp--preset--font-family--manrope);
	--carolsaling-font-heading: var(--wp--preset--font-family--newsreader);
	--carolsaling-font-mono: var(--wp--preset--font-family--monospace);
	--carolsaling-weight-heading: var(--wp--custom--font-weight--heading, 500);
	--carolsaling-weight-navigation: var(--wp--custom--font-weight--navigation, 500);
	--carolsaling-weight-cta: var(--wp--custom--font-weight--cta, 600);

	/* Sizes. */
	--carolsaling-font-size-small: var(--wp--preset--font-size--small);
	--carolsaling-font-size-medium: var(--wp--preset--font-size--medium);
	--carolsaling-font-size-large: var(--wp--preset--font-size--large);
	--carolsaling-font-size-x-large: var(--wp--preset--font-size--x-large);
	--carolsaling-font-size-xx-large: var(--wp--preset--font-size--xx-large);
	--carolsaling-line-height-body: var(--wp--custom--line-height--body, 1.65);
	--carolsaling-line-height-heading: var(--wp--custom--line-height--heading, 1.2);

	/* Layout and spacing. */
	--carolsaling-content-width: var(--wp--style--global--content-size, 35rem);
	--carolsaling-wide-width: var(--wp--style--global--wide-size, 72rem);
	--carolsaling-gutter: var(--wp--custom--spacing--gutter, 1rem);
	--carolsaling-space: var(--wp--custom--spacing--block, 1.5rem);
	--carolsaling-section-space: var(--wp--custom--spacing--section, 4rem);

	/* Borders, corners, focus and touch. */
	--carolsaling-border-thin: var(--wp--custom--border-width--thin, 1px);
	--carolsaling-border-thick: var(--wp--custom--border-width--thick, 4px);
	--carolsaling-radius-small: var(--wp--custom--radius--small, 0.375rem);
	--carolsaling-radius-medium: var(--wp--custom--radius--medium, 0.75rem);
	--carolsaling-radius-large: var(--wp--custom--radius--large, 1.5rem);
	--carolsaling-radius-pill: var(--wp--custom--radius--pill, 999px);
	--carolsaling-focus-width: var(--wp--custom--focus--width, 3px);
	--carolsaling-focus-offset: var(--wp--custom--focus--offset, 2px);
	--carolsaling-touch-target: var(--wp--custom--touch-target, 2.75rem);
}

/*
 * Dark areas (brand blue background: the closing invitation card of the home
 * page and the footer, which carries the class carolsaling-tone-inverse).
 * Every role switches to a pair that keeps the contrast: ivory on brand blue
 * 9.68:1, peach on brand blue 6.61:1 (buttons: brand blue text on peach).
 * Since the home page review (D-031) the opening is light, on the surface tone.
 */
.carolsaling-tone-inverse,
.carolsaling-cta {
	--carolsaling-color-text: var(--wp--preset--color--ivory);
	--carolsaling-color-background: var(--wp--preset--color--brand);
	--carolsaling-color-heading: var(--wp--preset--color--ivory);
	--carolsaling-color-link: var(--wp--preset--color--ivory);
	--carolsaling-color-muted: var(--wp--preset--color--ivory);
	--carolsaling-color-accent: var(--wp--preset--color--peach);
	--carolsaling-color-border: color-mix(in srgb, var(--wp--preset--color--ivory) 35%, var(--wp--preset--color--brand));
	--carolsaling-color-button: var(--wp--preset--color--peach);
	--carolsaling-color-button-text: var(--wp--preset--color--brand);
	--carolsaling-color-button-hover: var(--wp--preset--color--ivory);
	--carolsaling-color-focus: var(--wp--preset--color--ivory);
}

/*
 * Peach and surface areas: muted text becomes graphite, because support blue
 * on peach is below 4.5:1. Terracotta details stay (non-text, 3.01:1 on
 * peach). The internal pages (review after D-031) use the surface tone for
 * their header band, cards, messages and form cards.
 */
.carolsaling-section--intro,
.carolsaling-section--areas,
.carolsaling-section--resources,
.carolsaling-section--posts .wp-block-post-template > li,
.carolsaling-photo-placeholder,
.carolsaling-info-card,
.page-header,
.entry-singular > .entry-header,
.entry-summary-card,
.author-box,
.post-navigation a,
.no-results,
.not-found,
.entry-content .post-password-form,
.entry-content .wpcf7,
.wp-block-file,
.comment-respond {
	--carolsaling-color-muted: var(--wp--preset--color--graphite);
}

/* Contact sections of the Stage 7/8 patterns (peach band, no card). */
.carolsaling-section--contact:not(:has(> .carolsaling-cta)) {
	--carolsaling-color-muted: var(--wp--preset--color--graphite);
}
