/*
 * WordPress fixes on top of the Webflow design (kit/topics/design-replica.md, rule 2).
 * Every rule that changes how the design looks is listed under "Expected differences" in
 * docs/build-notes.md and tools/qa/regression.txt.
 */

/* Skip link (WCAG 2.4.1). WordPress prints it for block themes; style it in the design. */
.skip-link.screen-reader-text:focus {
	clip-path: none;
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: 12px 20px;
	background: var(--wp--preset--color--action);
	color: var(--wp--preset--color--surface);
	font-family: var(--wp--preset--font-family--sans);
	text-decoration: none;
}

/* Focus (WCAG 2.4.7 / 2.4.11): the design's teal focus colour (2.3:1 on white) gets a dark ring around it. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--focus);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--wp--preset--color--title);
}

/* Button hover: live has white text on coral #ff6a4e (2.8:1). Dark text keeps the colour and passes AA (6.6:1). */
.button:hover,
.button:focus-visible,
.button.outline:hover {
	color: var(--wp--preset--color--title);
}

/* Small accent text in the AA tint (accent #2e9d9e is 3.3:1 on white). */
.text-color-accent {
	color: var(--wp--preset--color--accent-aa);
}

/* Reduced motion: nothing moves, everything is visible (kit/topics/motion-a11y.md). */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* WordPress admin bar on top of the fixed Webflow navigation. */
body.admin-bar .navigation {
	top: var(--wp-admin--admin-bar--height, 32px);
}

/* Cookie icon is a real <button> here (live: a div with a click handler, not reachable by keyboard). */
button.cw-cookie_icon {
	border: 0;
	font: inherit;
}

/* Webflow nav button is focusable here (tabindex). */
.w-nav-button:focus-visible {
	outline-offset: -3px;
}

/* WordPress wrappers that the design doesn't have: let their children take part in the design layout. */
.d35-part-header,
.d35-part-footer,
.d35-part-contactblok,
.d35-post-content,
.privacy-statement-container > .d35-post-content {
	display: contents;
}

/* Images get width/height attributes here (no layout shift); the design sizes them by width (live has no attributes).
   Zero specificity: every design rule that sets a height still wins. */
:where(img[height]) {
	height: auto;
}

/* In-page links to a section (e.g. #formulier on the organisatie pages) stop below the fixed header. */
main [id] {
	scroll-margin-top: 140px;
}

/* Cookie banner with the choices open is taller than a phone screen (live too: the top falls off-screen).
   It scrolls within the screen instead (WCAG 1.4.10). */
.cw-cookie_banner {
	max-height: calc(100vh - 20px);
	max-height: calc(100dvh - 20px);
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* Links in running text (legal pages, HubSpot consent text, search results) inherit the accent #2e9d9e from the
   design, 2.9:1 on the beige page (WCAG 1.4.3). The design's own contrast colour for links (.link-correct-contrast,
   monte-carlo 700) instead: 6.0:1. */
main a:not([class]),
.hs-form a:not([class]) {
	color: var(--wp--preset--color--monte-carlo-700);
}

/* Cookie banner title is an h2 (live: h3, which skips a level on pages without h2's; WCAG 1.3.1), with the look of
   the live h3. */
.cw-cookie_banner .cw-cookie_title {
	font-family: "Google Sans Flex", sans-serif;
	font-size: 24px;
	line-height: 30px;
	font-weight: 700;
	margin: 20px 0 10px;
	color: var(--wp--preset--color--body);
	letter-spacing: normal;
}

/* Layout shift (CLS). The cookie banner starts with its choices open and the script closes them a moment later,
   so the banner jumps ~350px (live too): the choices start closed until the Webflow interactions run (they then
   keep them closed and open them on "Zelf kiezen"; a fixed height would block that). The HubSpot form on
   Contact pushes the contact options down when it arrives: its space is reserved (measured form height). */
html:not(.w-mod-ix3) #cw-cookie-options {
	height: 0;
	overflow: hidden;
}
.contact-hero .wpb-contact-form {
	min-height: 666px;
}
@media (min-width: 768px) {
	.contact-hero .wpb-contact-form {
		min-height: 565px;
	}
}
