/* ==========================================================================
   ArtSee theme — layout & component styles (direction F)
   Tokens come from theme.json (--wp--preset--* and --wp--custom--*).
   ========================================================================== */

:root {
	--as-pad: var(--wp--style--root--padding-left, clamp(1.25rem, 4vw, 2.5rem));
	--as-wide: var(--wp--style--global--wide-size, 1200px);
	--as-section: var(--wp--preset--spacing--70);
	--as-radius-media: var(--wp--custom--radius--media, 20px);
	--as-radius-panel: var(--wp--custom--radius--panel, 28px);
	--as-header-h: var(--wp--custom--header-height, 88px);
	--as-shadow-photo: var(--wp--preset--shadow--photo);
}

/* --- Base ---------------------------------------------------------------- */

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--sunflower);
	outline-offset: 3px;
	border-radius: 4px;
}

img {
	max-width: 100%;
	height: auto;
}

/* Marker highlight: select text in a heading and apply "Highlight" in the editor. */
:where(h1, h2, h3) mark {
	background: linear-gradient(transparent 62%, var(--wp--preset--color--sunflower-soft) 62%, var(--wp--preset--color--sunflower-soft) 92%, transparent 92%) !important;
	color: inherit;
	padding: 0 0.12em;
}

.as-eyebrow {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--leaf);
}

.as-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.55;
	color: var(--wp--preset--color--ink-soft);
	max-width: 34em;
}

/* --- Buttons ------------------------------------------------------------- */

.wp-block-buttons {
	gap: 0.75rem 1.5rem;
	align-items: center;
}

.wp-element-button {
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.wp-block-button:not(.is-style-link) .wp-element-button:hover {
	transform: translateY(-1px);
}

.wp-block-button.is-style-link .wp-element-button {
	background: transparent;
	color: var(--wp--preset--color--leaf-dark);
	padding-inline: 0.25rem;
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 0.25em;
	text-decoration-thickness: 2px;
}

.wp-block-button.is-style-link .wp-element-button:hover {
	background: transparent;
	color: var(--wp--preset--color--leaf);
}

.wp-block-button.is-style-dark .wp-element-button {
	background: var(--wp--preset--color--leaf-dark);
	color: var(--wp--preset--color--cream);
}

.wp-block-button.is-style-dark .wp-element-button:hover {
	background: #163a22;
	color: var(--wp--preset--color--cream);
}

/* --- Header -------------------------------------------------------------- */

.as-header {
	padding-inline: var(--as-pad);
}

.as-header__inner {
	max-width: var(--as-wide);
	min-height: var(--as-header-h);
	margin-inline: auto;
	gap: 2rem;
}

.as-logo {
	display: inline-flex;
	color: var(--wp--preset--color--leaf-dark);
	line-height: 0;
	text-decoration: none;
}

.as-logo:hover {
	color: var(--wp--preset--color--leaf);
}

.as-logo__svg {
	width: 140px;
	height: auto;
}

.as-logo--small .as-logo__svg {
	width: 104px;
}

.as-nav .wp-block-navigation__container {
	gap: 2rem;
}

.as-nav .wp-block-navigation-item__content {
	padding-block: 0.25rem;
	transition: color 0.2s ease;
}

.as-nav .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--leaf);
}

/* Only the current page gets the sunflower underline. */
.as-nav .current-menu-item > .wp-block-navigation-item__content {
	box-shadow: inset 0 -2px 0 var(--wp--preset--color--sunflower);
}

/* Mobile menu overlay */
.as-nav .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--cream) !important;
	padding: 1.5rem var(--as-pad);
}

.as-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 1.25rem;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.75rem;
	font-weight: 700;
}

/* --- Page shells --------------------------------------------------------- */

/* Header, main and footer sit flush; spacing is handled per section. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* Front page: full-width sections stack without gaps between them. */
.as-main--front .wp-block-post-content > * {
	margin-block: 0;
}

.as-main--page {
	padding-bottom: var(--as-section);
}

.as-page-intro {
	padding-top: var(--wp--preset--spacing--60);
	margin-bottom: var(--wp--preset--spacing--50);
}

.as-page-intro > * + * {
	margin-block-start: 0.75rem;
}

/* --- Sections ------------------------------------------------------------ */

.as-section {
	padding: var(--as-section) var(--as-pad);
}

.as-section > .wp-block-columns {
	max-width: var(--as-wide);
	margin-inline: auto !important;
}

/* Two cream sections in a row share one gap instead of doubling it. */
.as-section + .as-section {
	padding-top: 0;
}

/* --- Hero ---------------------------------------------------------------- */

.as-hero {
	padding-bottom: var(--as-section);
}

.as-hero__image {
	margin: 0;
}

/* Height follows the viewport, so the headline stays above the fold on laptops.
   Selector is specific enough to beat core's .wp-block-image.alignfull img. */
.wp-block-image.alignfull.as-hero__image img {
	display: block;
	width: 100%;
	height: clamp(340px, calc(100svh - 400px), 680px);
	object-fit: cover;
	object-position: center 45%;
	border-radius: 0;
}

/* Same content edge as the header: logo, panel and sections line up. */
.wp-block-group.as-hero__inner {
	width: min(100% - 2 * var(--as-pad), var(--as-wide));
	margin: 0 auto !important;
	padding-inline: 0;
}

.wp-block-group.as-hero__panel {
	position: relative;
	box-sizing: border-box;
	max-width: 600px;
	margin-top: calc(-1 * clamp(64px, 9vw, 130px));
	padding: clamp(1.5rem, 3.4vw, 2.75rem) clamp(1.25rem, 3.4vw, 3rem);
	background: var(--wp--preset--color--cream);
	border-radius: var(--as-radius-panel);
}

.as-hero__panel > * {
	margin-block: 0;
}

.as-hero__panel > * + * {
	margin-block-start: 1rem !important;
}

.as-hero__panel > .wp-block-buttons {
	margin-block-start: 1.75rem !important;
}

.as-hero__title {
	font-size: clamp(2.75rem, 5.3vw, 4.75rem);
}

/* --- Band: "Zo werkt het" ----------------------------------------------- */

.as-band {
	padding: var(--as-section) var(--as-pad);
}

.wp-block-group.as-band__inner {
	max-width: var(--as-wide);
	margin-inline: auto;
}

.wp-block-columns.as-split {
	gap: clamp(2.5rem, 6vw, 5rem);
	margin: 0;
}

.as-split .wp-block-image {
	margin: 0;
}

.as-split .wp-block-image img {
	display: block;
	width: 100%;
	aspect-ratio: 5 / 4;
	object-fit: cover;
	border-radius: var(--as-radius-media);
}

.as-split__text > * {
	margin-block: 0;
}

.as-split__text > * + * {
	margin-block-start: 1.25rem;
}

.as-split--reverse {
	flex-direction: row;
}

/* Playful tilted photos */
.wp-block-image.is-style-tilted-left img {
	transform: rotate(-2deg);
	box-shadow: var(--as-shadow-photo);
}

.wp-block-image.is-style-tilted-right img {
	transform: rotate(2deg);
	box-shadow: var(--as-shadow-photo);
}

.as-handnote {
	margin: 1.25rem 0 0 0.5rem !important;
	font-family: var(--wp--preset--font-family--hand);
	font-size: 1.75rem;
	line-height: 1.1;
	color: var(--wp--preset--color--leaf-dark);
	transform: rotate(-3deg);
	transform-origin: left center;
}

/* Numbered steps */
.wp-block-list.as-steps {
	list-style: none;
	counter-reset: step;
	margin: 2rem 0 0;
	padding: 0;
	display: grid;
	gap: 1.75rem;
}

.as-steps > li {
	counter-increment: step;
	position: relative;
	min-height: 2.75rem;
	padding-left: 4rem;
	color: var(--wp--preset--color--ink-soft);
}

.as-steps > li::before {
	content: counter(step);
	position: absolute;
	left: 0;
	top: -0.45rem; /* centres the 44px circle on the first (title) line */
	width: 2.75rem;
	height: 2.75rem;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--wp--preset--color--cream);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 1.125rem;
	color: var(--wp--preset--color--leaf-dark);
}

.as-steps > li:last-child::before {
	background: var(--wp--preset--color--sunflower);
	color: var(--wp--preset--color--ink);
}

.as-steps strong {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.3;
	color: var(--wp--preset--color--ink);
}

/* --- Gallery ------------------------------------------------------------- */

/* Give galleries room so the next heading doesn't sit flush against the photos. */
.wp-block-gallery {
	margin-block: var(--wp--preset--spacing--60) !important;
}

/* Captions sit under the photo instead of covering it. */
.wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption) {
	flex-direction: column;
	justify-content: flex-start;
}

.wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption) img {
	flex: 0 0 auto;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
}

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	position: static;
	max-height: none;
	overflow: visible;
	margin: 0;
	padding: 0.75rem 0.25rem 0;
	background: none;
	color: var(--wp--preset--color--ink-soft);
	text-shadow: none;
	text-align: left;
}

.wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption)::before {
	display: none;
}

@media (max-width: 599px) {
	.wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption) {
		width: 100% !important;
	}
}

/* --- Quote --------------------------------------------------------------- */

.wp-block-quote.as-quote {
	max-width: 720px;
	margin-inline: auto !important;
	padding: 0;
	border: 0;
	text-align: center;
}

.wp-block-quote.as-quote::before {
	content: "";
	display: block;
	width: 56px;
	height: 6px;
	margin: 0 auto 2rem;
	border-radius: 3px;
	background: var(--wp--preset--color--sunflower);
}

.wp-block-quote.as-quote p {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 500;
	font-size: clamp(1.5rem, 2.6vw, 2.125rem);
	line-height: 1.3;
	color: var(--wp--preset--color--leaf-dark);
}

.wp-block-quote.as-quote cite {
	display: block;
	margin-top: 1.5rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	font-style: normal;
	color: var(--wp--preset--color--ink-soft);
}

.wp-block-quote.as-quote cite strong {
	color: var(--wp--preset--color--ink);
}

/* --- Card: "Samenwerken" ------------------------------------------------- */

.wp-block-group.as-card {
	max-width: var(--as-wide);
	margin-inline: auto;
	padding: clamp(2rem, 5vw, 4.5rem);
	gap: 2.5rem;
	border-radius: var(--as-radius-panel);
}

.as-card__text {
	flex: 1 1 30rem;
	min-width: 0;
}

.as-card__text > * {
	margin-block: 0;
}

.as-card__text > * + * {
	margin-block-start: 0.875rem !important;
}

.as-card__text p:not(.as-eyebrow) {
	max-width: 36em;
	color: var(--wp--preset--color--ink-soft);
}

.as-card .as-eyebrow {
	color: var(--wp--preset--color--leaf-dark);
}

/* --- Inner page layout --------------------------------------------------- */
/* Kept above the small-screen rules, below the base component styles. */

.as-main--page .as-section {
	padding-block: var(--wp--preset--spacing--60);
}

.as-main--page .as-section + .as-section {
	padding-top: 0;
}

.as-main--page .wp-block-post-content > .as-section:first-child {
	padding-top: 0;
}

/* A page that opens with a wide photo + text section gets a title on the same wide edge. */
.as-main--page:has(.wp-block-post-content > .as-section:first-child) .as-page-intro > * {
	max-width: var(--as-wide);
}

/* A list of participant reactions reads as cards, not as a run of headlines. */
.as-main--page .wp-block-post-content > .wp-block-quote.as-quote {
	box-sizing: border-box;
	padding: clamp(1.5rem, 3vw, 2.25rem);
	background: var(--wp--preset--color--white);
	border-radius: var(--as-radius-panel);
	text-align: left;
}

.as-main--page .wp-block-post-content > .wp-block-quote.as-quote::before {
	width: 40px;
	height: 5px;
	margin: 0 0 1.25rem;
}

.as-main--page .wp-block-post-content > .wp-block-quote.as-quote p {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 400;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.6;
	color: var(--wp--preset--color--ink);
}

.as-main--page .wp-block-post-content > .wp-block-quote.as-quote cite {
	margin-top: 1rem;
}

/* Desktop hero: let the panel climb further into the photo, so less empty space sits beside it. */
@media (min-width: 782px) {
	.as-hero {
		padding-bottom: var(--wp--preset--spacing--60);
	}

	.wp-block-image.alignfull.as-hero__image img {
		height: clamp(440px, calc(100svh - 240px), 700px);
	}

	.wp-block-group.as-hero__panel {
		margin-top: -240px;
	}
}

/* --- Posts --------------------------------------------------------------- */

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

.as-post-card > * + * {
	margin-block-start: 0.5rem;
}

.as-post-card .wp-block-post-featured-image {
	margin-bottom: 1rem;
}

.as-post-nav {
	max-width: 720px;
	margin: var(--wp--preset--spacing--60) auto 0;
	padding-top: 2rem;
	border-top: 1px solid var(--wp--preset--color--line);
}

/* --- Footer -------------------------------------------------------------- */

.as-footer {
	padding-inline: var(--as-pad);
	border-top: 1px solid var(--wp--preset--color--line);
}

.as-footer__inner {
	max-width: var(--as-wide);
	margin-inline: auto;
	padding-block: 2.5rem;
	gap: 1.5rem 2rem;
	align-items: center;
}

.as-footer__nav .wp-block-navigation__container {
	gap: 0.5rem 1.75rem;
}

.as-footer__nav .wp-block-navigation-item__content {
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
}

.as-footer__copy {
	margin: 0;
	color: var(--wp--preset--color--ink-soft);
}

/* --- Block editor: match the front end ----------------------------------- */
/* The editor canvas has no real viewport height and adds block gaps; pin the hero here. */

.editor-styles-wrapper .wp-block-image.alignfull.as-hero__image img {
	height: 560px;
}

.editor-styles-wrapper .as-hero > .as-hero__inner {
	margin-top: 0 !important;
}

.editor-styles-wrapper .wp-block-group.as-hero__panel {
	margin-top: -130px !important;
}

/* --- Small screens ------------------------------------------------------- */

@media (max-width: 781px) {
	.wp-block-image.alignfull.as-hero__image img {
		height: clamp(300px, 52svh, 460px);
	}

	.wp-block-group.as-hero__panel {
		margin-top: -3rem;
		border-radius: 22px;
	}

	.wp-block-image.is-style-tilted-left img {
		transform: rotate(-1deg);
	}

	.wp-block-image.is-style-tilted-right img {
		transform: rotate(1deg);
	}

	.as-split--reverse {
		flex-direction: column-reverse;
	}

	.as-steps > li {
		padding-left: 3.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}
