/*
 * Blocksy integration.
 *
 * The parent theme and the two in-house plugins style headings, links, buttons
 * and form fields through Blocksy's own `--theme-*` custom properties, filled
 * from a Customizer palette. Fighting those rules selector by selector would be
 * an endless game of specificity.
 *
 * Instead, the palette itself is redirected: every `--theme-*` property V2 cares
 * about is bound to a Découverte token. Any parent or plugin rule that reads one
 * now lands on our colour system, in both themes, with nothing to override.
 *
 * This file is loaded LAST so its bindings win, and it is the only place in the
 * child theme that names a Blocksy variable.
 */

/*
 * Declared on the document AND on the body, because the section pigment is
 * scoped to the body (ADR-0029): the copy on the body resolves against that
 * section's accent, so a parent or plugin rule follows the Hub too.
 */
:root,
body {
	/* Text and headings. */
	--theme-text-color: var(--dcv-ink);
	--theme-heading-color: var(--dcv-ink);
	--theme-headings-color: var(--dcv-ink);
	--theme-heading-1-color: var(--dcv-ink);
	--theme-heading-2-color: var(--dcv-ink);
	--theme-heading-3-color: var(--dcv-ink);
	--theme-heading-4-color: var(--dcv-ink);
	--theme-heading-5-color: var(--dcv-ink);
	--theme-heading-6-color: var(--dcv-ink);

	/* Links: colour stays with the text, emphasis rides on the underline. */
	--theme-link-initial-color: var(--dcv-ink);
	--theme-link-hover-color: var(--dcv-accent-strong);
	--theme-text-decoration: none;

	/* Structure. */
	--theme-border-color: var(--dcv-line);
	--theme-icon-color: var(--dcv-muted);
	--theme-icon-hover-color: var(--dcv-accent-strong);

	/* The one accent, used for actions only. */
	--theme-button-background-initial-color: var(--dcv-accent);
	--theme-button-background-hover-color: var(--dcv-accent-strong);
	--theme-button-text-initial-color: var(--dcv-on-olive);
	--theme-button-text-hover-color: var(--dcv-on-olive);
	--theme-button-border-radius: var(--dcv-radius);

	/* Forms. */
	--theme-form-field-border-initial-color: var(--dcv-line-strong);
	--theme-form-field-border-focus-color: var(--dcv-accent-strong);
	--theme-form-field-border-radius: var(--dcv-radius);

	/* Blocksy's palette, so any rule reading a palette slot stays in-system. */
	--theme-palette-color-1: var(--dcv-accent);
	--theme-palette-color-2: var(--dcv-accent-strong);
	--theme-palette-color-3: var(--dcv-ink);
	--theme-palette-color-4: var(--dcv-muted);
	--theme-palette-color-5: var(--dcv-canvas);
	--theme-palette-color-6: var(--dcv-canvas-sunk);
	--theme-palette-color-7: var(--dcv-line);
	--theme-palette-color-8: var(--dcv-olive);

	/* Widths. The canvas owns its own measure; the parent must not re-clamp it. */
	--theme-container-width: var(--dcv-canvas-max);
	--theme-normal-container-max-width: var(--dcv-canvas-max);
	--theme-content-spacing: var(--dcv-space-sm);
	--theme-block-max-width: var(--dcv-measure);
	--theme-block-width: var(--dcv-measure);

	/* Typography. */
	--theme-font-family: var(--dcv-font-ui);
	--theme-font-weight: 400;
}

/* --- Blocksy owns [type="submit"]; the child theme owns its actions --------- */

/*
 * Blocksy styles every `[type="submit"]` as one of its own buttons, and part of
 * that styling is a shadow layer it renders in the element's OWN `::before` —
 * `display: var(--theme-button-shadow, block)`, which resolves to `none` while
 * its shadow option is off.
 *
 * Our action's plate IS its `::before`. So on the only two submit buttons in the
 * theme — the search panel and the contact form — the plate never rendered at
 * all, while Blocksy's own `:hover` took the background and lifted the button
 * 3px. Found by reading the matched rules for the node, not by inspection: the
 * computed `transform` came back as `none`, which is what a `display: none`
 * pseudo-element reports.
 *
 * Blocksy is not modified. These rules restore the action's own contract on the
 * elements the parent also claims, and they are scoped to `.dcv-action` so no
 * other submit button on the site is affected.
 */

/*
 * `display`, because Blocksy hides the layer; `opacity`, because Blocksy fades
 * it to .8 on hover — which would quietly composite the plate against the fill
 * underneath and put the measured contrast somewhere other than where the token
 * says it is.
 */
.dcv-action::before,
.dcv-action::after,
.dcv-action:hover::before,
.dcv-action:hover::after,
.dcv-action:focus-visible::before,
.dcv-action:focus-visible::after {
	display: block;
	opacity: 1;
	box-shadow: none;
	/* Blocksy's shadow layer is a blurred plate. Ours is a plate. */
	filter: none;
}

.dcv-action,
.dcv-action:hover,
.dcv-action:focus-visible {
	background-color: transparent;
	transform: none;
}

/* Re-stated after the `transform: none` above, which would otherwise cancel it. */
.dcv-action:active { transform: translateY(1px); }
