/*
 * Theme CSS: only what theme.json cannot express. No hard-coded colours or sizes:
 * use the --wp--preset--* and --wp--custom--* tokens.
 * Breakpoints (mobile first, documented in docs/DESIGN-SYSTEM.md): 600, 782, 1024, 1280 px.
 */

/* Focus: visible everywhere, light ring on dark backgrounds. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: var(--wp--custom--focus--width) solid var(--wp--preset--color--rust);
	outline-offset: var(--wp--custom--focus--offset);
}

.has-forest-background-color :focus-visible,
.has-ink-background-color :focus-visible {
	outline-color: var(--wp--preset--color--paper);
}

/* Reading measure for long text. */
.entry-content > :where(p, ul, ol, blockquote) {
	max-width: var(--wp--custom--measure);
}

/* Header and footer spacing. */
.ww-header {
	padding-block: var(--wp--preset--spacing--m);
	border-bottom: 1px solid var(--wp--preset--color--stone);
}

.ww-footer {
	padding-block: var(--wp--preset--spacing--huge);
}

.ww-main {
	padding-block: var(--wp--preset--spacing--xxl) var(--wp--preset--spacing--giant);
}

/* Small uppercase meta line (date, category). */
.ww-meta {
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--forest);
}

.ww-meta a {
	text-decoration: none;
	color: inherit;
}

/* Card titles in lists. */
.ww-card .wp-block-post-title {
	font-size: var(--wp--preset--font-size--heading-4);
	margin-block: var(--wp--preset--spacing--xs) 0;
}

.ww-card .wp-block-post-title a {
	text-decoration: none;
	color: var(--wp--preset--color--forest);
}

.ww-card .wp-block-post-title a:hover {
	color: var(--wp--preset--color--rust);
}

/* Minimum touch target for navigation links. */
.wp-block-navigation .wp-block-navigation-item__content {
	padding-block: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

/* Footer: site title and links readable on forest. */
.ww-footer .wp-block-site-title a,
.ww-footer .wp-block-navigation a {
	color: var(--wp--preset--color--paper);
}

.ww-footer .wp-block-navigation {
	gap: var(--wp--preset--spacing--xxs);
}

/* Compact meta rows inside cards and article headers. */
.ww-meta {
	gap: var(--wp--preset--spacing--xs) var(--wp--preset--spacing--m);
}

.ww-card {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--xs);
}

.ww-card > * {
	margin-block: 0;
}

/* Header: compact so title, 8 menu items and search fit on one line from 1024px. */
.ww-header .wp-block-search__button {
	background: transparent;
	color: var(--wp--preset--color--ink);
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: 0;
}

.ww-header .wp-block-navigation {
	--navigation-layout-gap: 1rem;
}

@media (max-width: 1023px) {
	.ww-header > .wp-block-group {
		flex-wrap: wrap;
	}
}

/* Route chip on cards, hidden when empty. */
.ww-chip {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--forest);
}

.ww-chip:empty {
	display: none;
}

/* Practical information box ("Alles op een rijtje"). */
.ww-facts {
	padding: var(--wp--preset--spacing--xl);
	border-radius: var(--wp--custom--radius--s);
}

.ww-facts__grid {
	gap: var(--wp--preset--spacing--m) var(--wp--preset--spacing--xl);
}

.ww-fact {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ww-fact > * {
	margin-block: 0;
}

.ww-fact:has(.ww-fact__value:empty) {
	display: none;
}

.ww-fact__label {
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--forest);
}

.ww-fact__value {
	font-weight: 600;
}

.wp-block-button.ww-gpx:has(a[href=""]),
.wp-block-button.ww-gpx:not(:has(a[href])) {
	display: none;
}

.ww-facts-wrap {
	margin-block: var(--wp--preset--spacing--xl);
}

/* Homepage. */
.ww-main--flush {
	padding-top: 0;
}

.ww-hero {
	padding: var(--wp--preset--spacing--xl) var(--wp--preset--spacing--m);
}

.ww-hero .wp-block-post-title,
.ww-hero .wp-block-post-title a {
	color: var(--wp--preset--color--white);
	text-decoration: none;
}

.ww-hero__meta,
.ww-hero__meta a {
	color: var(--wp--preset--color--white);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}

.ww-hero .wp-block-read-more,
.ww-btn {
	display: inline-block;
	padding: 0.8125rem 1.5rem;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--forest);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	border-radius: var(--wp--custom--radius--s);
	text-decoration: none;
}

.ww-hero .wp-block-read-more:hover {
	background: var(--wp--preset--color--rust);
	color: var(--wp--preset--color--white);
}

.ww-intro,
.ww-section {
	padding-block: var(--wp--preset--spacing--huge) 0;
}

.ww-tile {
	padding: var(--wp--preset--spacing--l);
	border-radius: var(--wp--custom--radius--s);
}

.ww-tile > * {
	margin-block: 0 var(--wp--preset--spacing--xs);
}

.ww-tile a {
	color: var(--wp--preset--color--forest);
	text-decoration: none;
}

.ww-tile a:hover {
	color: var(--wp--preset--color--rust);
	text-decoration: underline;
}

.ww-cta {
	margin-top: var(--wp--preset--spacing--giant);
	padding: var(--wp--preset--spacing--huge) var(--wp--preset--spacing--m);
}

.ww-cta a:focus-visible {
	outline-color: var(--wp--preset--color--paper);
}

.ww-social {
	margin-top: var(--wp--preset--spacing--giant);
	padding: var(--wp--preset--spacing--xl);
	border-radius: var(--wp--custom--radius--s);
}

.ww-term {
	gap: var(--wp--preset--spacing--xs);
}

.ww-term a {
	color: var(--wp--preset--color--forest);
	text-decoration: none;
	font-weight: 600;
}

.ww-related {
	margin-top: var(--wp--preset--spacing--giant);
}

/* FAQ. */
.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
	padding-block: var(--wp--preset--spacing--s);
}

/* Cards: subtle hover on the image only (no layout shift). */
.ww-card .wp-block-post-featured-image img {
	transition: opacity 0.2s;
}

.ww-card:hover .wp-block-post-featured-image img {
	opacity: 0.92;
}

.wp-block-breadcrumbs {
	font-size: var(--wp--preset--font-size--small);
}

/* Template parts that must use the wide width inside the constrained main. */
.ww-main > .ww-wide-part {
	max-width: var(--wp--style--global--wide-size);
}

/* Left-aligned text blocks inside wide sections. */
.ww-intro > *,
.ww-cta > *,
.ww-social > * {
	max-width: 720px;
	margin-inline-start: 0 !important; /* core layout sets auto with !important */
	margin-inline-end: auto !important;
}

/* Hero text aligns with the wide content width. */
.ww-hero .wp-block-cover__inner-container {
	width: 100%;
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
	padding-inline: var(--wp--preset--spacing--m);
	box-sizing: border-box;
}

/* Long unbreakable strings (URLs, very long words or titles) must wrap instead of overflowing. */
body {
	overflow-wrap: break-word;
}

.wp-block-post-title,
.wp-block-query-title,
.entry-content,
.ww-fact__value,
.ww-card,
.wp-block-breadcrumbs,
.ww-map__summary {
	overflow-wrap: anywhere;
}

/* Full-width call-to-action: keep its text aligned with the wide content edge. */
.ww-cta.ww-cta {
	padding-inline: max(var(--wp--preset--spacing--m), calc((100vw - var(--wp--style--global--wide-size)) / 2));
}

/* Shaded tip box (converted from the old add-on "tip" widgets and one-cell tables). */
.ww-tip {
	margin-block: var(--wp--preset--spacing--l);
	padding: var(--wp--preset--spacing--l);
	border-radius: var(--wp--custom--radius--s);
}

.ww-tip > :first-child {
	margin-top: 0;
}

.ww-tip > :last-child {
	margin-bottom: 0;
}

/* Tables: readable borders, scroll sideways on small screens instead of breaking the layout. */
.wp-block-table {
	overflow-x: auto;
}

.wp-block-table :is(td, th) {
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--wp--preset--color--stone);
	text-align: left;
}

.wp-block-table th {
	background: var(--wp--preset--color--mist);
	font-weight: 600;
}
