/* ==========================================================================
   Clazing & Mol — reset, element defaults and CMS prose

   Element rules follow the design system's tokens/base.css. Everything under
   .prose styles what an editor types into Velifact's page body, so it has to
   look right for plain paragraphs, pasted headings and bullet lists alike.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--surface-page);
	color: var(--text-body);
	font: var(--text-body-m);
	letter-spacing: var(--tracking-body);
	text-wrap: pretty;
	-webkit-font-smoothing: antialiased;
	overflow-y: scroll;
}

/* Headings are uppercase Montserrat Bold with a little tracking — the logo
   sets that rule. The tagline is the one deliberate exception. */
h1, h2, h3, h4, h5, h6 {
	margin: 0;
	color: var(--text-heading);
	text-transform: uppercase;
	letter-spacing: var(--tracking-heading);
}
h1 { font: var(--text-h1); }
h2 { font: var(--text-h2); }
h3 { font: var(--text-h3); }
h4, h5, h6 { font: var(--weight-bold) var(--size-h4)/var(--leading-snug) var(--font-display); }

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a {
	color: var(--text-link);
	text-decoration: none;
	border-bottom: 1px solid var(--accent-soft);
	transition: var(--transition-control);
}
a:hover {
	color: var(--text-link-hover);
	border-bottom-color: var(--accent);
}

img { max-width: 100%; }

button, input, select, textarea {
	font-family: inherit;
	font-size: 100%;
}
button { background: none; border: none; }

/* Focus is never removed. */
*:focus-visible {
	outline: 2px solid var(--focus-ring);
	outline-offset: 2px;
}

::selection {
	background: var(--accent-soft);
	color: var(--cm-ink-900);
}

/* --------------------------------------------------------------------------
   Brand utilities
   -------------------------------------------------------------------------- */
.overline {
	display: block;
	font: var(--weight-bold) var(--size-overline)/1.2 var(--font-display);
	letter-spacing: var(--tracking-overline);
	text-transform: uppercase;
	color: var(--text-accent);
}
.overline_inverse { color: var(--cm-green-300); }

/* timmerwerk & afbouw is always lowercase, always green, never uppercased. */
.tagline {
	font: var(--weight-medium) var(--size-body-m)/1.3 var(--font-body);
	color: var(--accent);
	text-transform: none;
}

.icon {
	display: inline-block;
	flex: 0 0 auto;
	vertical-align: -.15em;
	fill: currentColor;
}

.visually_hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.skip_link {
	position: absolute;
	left: var(--space-4);
	top: -100%;
	z-index: 100;
	padding: var(--space-3) var(--space-4);
	background: var(--cm-ink-900);
	color: var(--text-inverse);
	border: none;
	border-radius: var(--radius-xs);
	font: var(--weight-bold) var(--size-body-s)/1 var(--font-display);
	letter-spacing: var(--tracking-heading);
	text-transform: uppercase;
	transition: top var(--dur-fast) var(--ease-standard);
}
.skip_link:focus {
	top: var(--space-4);
	color: var(--text-inverse);
}

/* --------------------------------------------------------------------------
   Scroll reveal — fade in with an 8px rise, once per element. Only hidden
   when JavaScript is there to reveal it again; see the `js` class set in
   header.php before first paint.
   -------------------------------------------------------------------------- */
.js .reveal {
	opacity: 0;
	transform: translateY(8px);
	transition:
		opacity var(--dur-slow) var(--ease-out),
		transform var(--dur-slow) var(--ease-out);
	transition-delay: calc(var(--stagger, 0) * 60ms);
}
.js .reveal.is_visible {
	opacity: 1;
	transform: none;
}

/* Content swap: the old content is replaced, never animated out. */
.fade_in { animation: fade_in var(--dur-slow) var(--ease-out) both; }

@media (prefers-reduced-motion: reduce) {
	.js .reveal { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   .prose — the Velifact page body

   Editors type plain paragraphs and paste HTML from Word, so this has to hold
   up for both. Measure is capped at 62ch; body line-height is 1.55.
   -------------------------------------------------------------------------- */
.prose {
	font: var(--text-body-m);
	color: var(--text-body);
	max-width: var(--measure-body);
}
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }

.prose p { margin: 0 0 var(--space-4); }

.prose h2 {
	font: var(--text-h2);
	margin: var(--space-7) 0 var(--space-3);
}
.prose h3 {
	font: var(--text-h3);
	margin: var(--space-6) 0 var(--space-3);
}
.prose h4 {
	font: var(--weight-bold) var(--size-h4)/var(--leading-snug) var(--font-display);
	margin: var(--space-5) 0 var(--space-2);
}

.prose strong, .prose b { font-weight: var(--weight-bold); }
.prose em, .prose i { font-style: normal; color: var(--text-accent); }

/* Lists are for scopes of work, never for benefits — so they read as a
   checklist. The tick is the design system's own `check` glyph, inlined. */
.prose ul {
	list-style: none;
	margin: 0 0 var(--space-5);
	padding: 0;
}
.prose ul li {
	position: relative;
	padding-left: var(--space-6);
	margin-bottom: var(--space-3);
}
.prose ul li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .18em;
	width: 20px;
	height: 20px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960' fill='%2352b048'%3E%3Cpath d='M378-246 154-470l43-43 181 181 384-384 43 43-427 427Z'/%3E%3C/svg%3E") no-repeat center / contain;
}

.prose ol {
	margin: 0 0 var(--space-5);
	padding-left: var(--space-5);
}
.prose ol li { margin-bottom: var(--space-3); }
.prose ol li::marker {
	font-weight: var(--weight-bold);
	color: var(--accent);
}

.prose li:last-child { margin-bottom: 0; }
.prose li > ul, .prose li > ol { margin-top: var(--space-3); }

/* A green top rule is the one decorative accent — explicitly not a coloured
   left border, that trope is banned here. */
.prose blockquote {
	margin: var(--space-6) 0;
	padding: var(--space-5) 0 0;
	border-top: var(--rule-accent) solid var(--accent);
	font: var(--weight-medium) var(--size-body-l)/1.45 var(--font-display);
	color: var(--text-heading);
}
.prose blockquote cite {
	display: block;
	margin-top: var(--space-3);
	font: var(--text-body-s);
	font-style: normal;
	color: var(--text-faint);
}

.prose img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: var(--space-5) 0;
	border-radius: var(--radius-md);
}

.prose hr {
	margin: var(--space-7) 0;
	border: none;
	border-top: 1px solid var(--border-subtle);
}

.prose table {
	width: 100%;
	margin: 0 0 var(--space-5);
	border-collapse: collapse;
	font: var(--text-body-s);
}
.prose th, .prose td {
	padding: var(--space-3);
	text-align: left;
	border-bottom: 1px solid var(--border-subtle);
}
.prose th {
	font: var(--weight-bold) var(--size-caption)/1.2 var(--font-display);
	letter-spacing: var(--tracking-overline);
	text-transform: uppercase;
	color: var(--text-body);
}

/* Wide content scrolls inside its own box rather than the page. */
.prose .table_scroll { overflow-x: auto; }

.prose iframe {
	max-width: 100%;
	border: 1px solid var(--border-subtle);
}

/* Prose on the charcoal bands */
.prose_inverse { color: var(--cm-neutral-300); }
.prose_inverse h2,
.prose_inverse h3,
.prose_inverse h4 { color: var(--text-inverse); }
.prose_inverse a { color: var(--cm-green-300); }
