/* GPL Canvas — page-level design tweaks.
 *
 * Loaded last, for one-off overrides that don't belong in the theme's structured layers
 * (theme.css = base/chrome/a11y · blocks.css = section blocks · suprevo.css = engine integration).
 * Empty by design after the main.css → token-based refactor: the old hero/header tweaks here were
 * folded into theme.css + blocks.css. Add site-specific exceptions below as they come up. */

/* Adjacent sections that share a background read as ONE continuous band — the full padding of
 * both creates too large a seam. Pull the second up so the gap halves. The overlap is invisible
 * (both backgrounds are the same colour) and only eats the previous section's empty bottom
 * padding, never its content. Per-scheme pairs (incl. the neutral `default`). */
.sv-section.sv-bg-default + .sv-section.sv-bg-default,
.sv-section.sv-bg-cream   + .sv-section.sv-bg-cream,
.sv-section.sv-bg-white   + .sv-section.sv-bg-white,
.sv-section.sv-bg-slate   + .sv-section.sv-bg-slate,
.sv-section.sv-bg-dark    + .sv-section.sv-bg-dark,
.sv-section.sv-bg-gold    + .sv-section.sv-bg-gold {
	margin-top: calc(-1 * clamp(2rem, 5vw, 4rem));
}

/* Gravity Forms (suprevo-gravityforms `gravity_form` section). Colours already come from the GPL
 * tokens through the add-on's gform_default_styles seed; this adds only what tokens can't say.
 * Gravity prints each form's colour variables in an id-scoped <style>, so the contrast-mode
 * overrides need !important to beat it (custom properties honour !important like any other). */
/* Every Gravity form — the section AND the Formulier block in a column. `body` lifts this above
 * Gravity's own `.gform-theme--framework` default for the variable. */
body .gform-theme--framework {
	--gf-ctrl-btn-radius: 9999px;              /* GPL buttons are pills (.btn) */
	--gf-ctrl-btn-font-weight: 600;
	--gf-ctrl-btn-padding-x: 1.4rem;
	--gf-form-gap-y: 1rem;                     /* the former form's tight field rhythm */
	--gf-label-space-primary: .35rem;
	--gf-ctrl-label-font-weight-primary: 600;  /* semibold labels */
	--gf-ctrl-label-color-req: currentColor;   /* the "*" in the label colour, not red */
	--gf-ctrl-textarea-height: 9.75rem;
}
/* The section reads at the former form's width; a form in a column takes the column's. */
.block-gravity-form .gform_wrapper.gform-theme { max-width: 36rem; }
body .gform-theme--framework .gform_required_legend {
	margin-block-end: .75rem;
	font-size: .875rem;
	color: var(--gpl-slate-600, #4a5e6a);
}
body .gform-theme--framework .gform_required_legend .gfield_required { color: inherit; }
/* Consent: just the checkbox line, as before. The field's legend ("Toestemming") stays for
 * screen readers only, so the required "*" moves onto the visible checkbox label. */
body .gform-theme--framework .gfield--type-consent > .gfield_label {
	position: absolute !important;
	width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
body .gform-theme--framework .gfield--type-consent.gfield_contains_required .gfield_consent_label::after {
	content: " *";
}
/* A form on a DARK section background (slate / dark / a dark free colour): labels and help text
 * turn light and the primary colour (button, checked boxes, focus ring) flips to white-on-ink, so
 * nothing goes dark-on-dark. Fields stay white surfaces. !important beats Gravity's id-scoped
 * per-form variables (see above). */
.sv-section:is(.sv-bg-slate, .sv-bg-dark, .sv-bg-custom--dark) .gform-theme--framework {
	--gf-color-primary: #ffffff !important;
	--gf-color-primary-rgb: 255, 255, 255 !important;
	--gf-color-primary-darker: #e3e9eb !important;
	--gf-color-primary-lighter: #ffffff !important;
	--gf-color-primary-contrast: #232d33 !important;
	--gf-ctrl-btn-bg-color-primary: #ffffff !important;
	--gf-ctrl-btn-bg-color-hover-primary: #e3e9eb !important;
	--gf-ctrl-btn-color-primary: #232d33 !important;
	--gf-ctrl-btn-color-hover-primary: #232d33 !important;
	--gf-ctrl-btn-border-color-primary: #ffffff !important;
	--gf-ctrl-label-color-primary: #ffffff !important;
	--gf-ctrl-label-color-secondary: #ffffff !important;
	--gf-ctrl-desc-color: rgba(255, 255, 255, .82) !important;
	--gf-ctrl-label-color-req: currentColor !important;
}
.sv-section:is(.sv-bg-slate, .sv-bg-dark, .sv-bg-custom--dark) .gform-theme--framework .gform_required_legend { color: rgba(255, 255, 255, .82); }
body.a11y-contrast .gform-theme--framework {
	--gf-color-primary: #000 !important;
	--gf-color-primary-rgb: 0, 0, 0 !important;
	--gf-color-primary-darker: #000 !important;
	--gf-color-primary-contrast: #fff !important;
	--gf-color-in-ctrl: #fff !important;
	--gf-color-in-ctrl-contrast: #000 !important;
	--gf-ctrl-border-color: #000 !important;
	--gf-ctrl-label-color-primary: #000 !important;
	--gf-ctrl-label-color-secondary: #000 !important;
}
