/**
 * «Feldbuch»: the shared look. Paper, ink, pasted prints with tape, marker
 * flags and register tabs, and the buttons. Values come from theme.json
 * presets wherever one exists; the rest are the spec's (SPECS.md §2–6).
 *
 * Block styles live here because every page uses them; the views of the
 * content model have their own files (header, orangutans, research, news,
 * donate).
 */

:root {
	--suaq-tape: var(--wp--custom--tape, rgb(230 219 178 / 82%));
	--suaq-grid-line: var(--wp--custom--grid-line, rgb(47 90 30 / 6%));
	--suaq-grid-size: 24px;
	--suaq-ink: var(--wp--custom--ink, #141711);
	--suaq-ink-accent: var(--wp--custom--ink-accent, #8f3713);
	--suaq-gutter: clamp(1.25rem, 5.333vw, 4rem);
	--suaq-print-shadow: var(--wp--preset--shadow--print);
	--suaq-tape-clip: polygon(2% 0, 98% 6%, 100% 35%, 97% 60%, 100% 92%, 4% 100%, 0 70%, 3% 40%, 0 12%);
	--suaq-flag-clip: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%);
	--suaq-tab-clip: polygon(0 100%, 0 30%, 8px 0, calc(100% - 8px) 0, 100% 30%, 100% 100%);
}

@media (min-width: 600px) {
	:root {
		--suaq-grid-size: 28px;
	}
}

/* Text ------------------------------------------------------------------ */

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

p,
li,
dd {
	text-wrap: pretty;
}

h1,
h2,
h3 {
	text-wrap: balance;
}

:where(.wp-site-blocks) a:where(:not(.wp-element-button)) {
	text-underline-offset: 4px;
	text-decoration-thickness: 2px;
}

:where(.wp-site-blocks) a:where(:not(.wp-element-button)):hover {
	text-decoration-thickness: 3px;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

::selection {
	background: var(--wp--preset--color--kraft);
	color: var(--wp--preset--color--contrast);
}

/* Barlow labels: the small uppercase lines (meta, captions, dt). */
.suaq-label,
.wp-block-post-date,
.wp-element-caption.suaq-label {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 0.875rem;
	line-height: 1;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* Grid paper (block style «Rasterpapier» on core/group) ----------------- */

.is-style-raster,
.suaq-raster {
	background-color: var(--wp--preset--color--base);
	background-image:
		linear-gradient(var(--suaq-grid-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--suaq-grid-line) 1px, transparent 1px);
	background-size: var(--suaq-grid-size) var(--suaq-grid-size);
}

/* Marker flag (block style «Fähnchen» on core/paragraph) ---------------- */

p.is-style-marker,
.suaq-marker {
	align-self: flex-start;
	display: inline-block;
	width: fit-content;
	max-width: 100%;
	margin-block: 0;
	padding: 8px 22px 7px 14px;
	background-color: var(--wp--preset--color--primary);
	color: #fff;
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	clip-path: var(--suaq-flag-clip);
	transform: rotate(-1deg);
}

p.is-style-marker:where(.has-kraft-background-color, .has-surface-background-color, .has-base-background-color) {
	color: var(--wp--preset--color--contrast);
}

p.is-style-marker a {
	color: inherit;
	text-decoration: none;
}

.suaq-marker--small {
	padding: 7px 18px 6px 12px;
	font-size: 0.8125rem;
	clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 50%, 100% 100%, 0 100%);
	transform: none;
}

@media (max-width: 599px) {
	p.is-style-marker {
		font-size: 0.8125rem;
		padding: 7px 18px 6px 12px;
	}
}

/* Register tab (block style «Reiter» on core/heading) --------------------
   The heading draws the 2 px line; its text sits in a tab on the line. The
   tab's colour is the heading's background colour (default leaf green). */

.wp-block-heading.is-style-tab {
	display: flex;
	align-items: flex-end;
	margin-block-end: 0;
	padding: 0 !important;
	border-bottom: 2px solid var(--wp--preset--color--contrast);
	background: none !important;
	color: inherit !important;
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.875rem !important;
	font-weight: 600;
	line-height: 1 !important;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.suaq-tab {
	display: inline-block;
	padding: 8px 16px 6px;
	background-color: var(--wp--preset--color--primary);
	color: #fff;
	clip-path: var(--suaq-tab-clip);
	white-space: nowrap;
}

.suaq-tab:where(.has-kraft-background-color, .has-surface-background-color, .has-base-background-color, .has-paper-background-color) {
	color: var(--wp--preset--color--contrast);
}

.suaq-tab a {
	color: inherit;
	text-decoration: none;
}

/* Cards (block style «Karte» on core/group) -------------------------------- */

.wp-block-group.is-style-card {
	display: flex;
	flex-direction: column;
	gap: 18px;
	background-color: var(--wp--preset--color--surface);
	padding: 0 36px 36px;
	border-radius: 0;
}

.wp-block-group.is-style-card > * {
	margin-block: 0;
}

.wp-block-group.is-style-card > .is-style-tab:first-child {
	margin-inline: -36px;
	padding-inline: 36px;
	margin-block-start: 30px;
}

.wp-block-group.is-style-card > .is-style-tab:first-child .suaq-tab {
	margin-top: -30px;
}

.wp-block-group.is-style-card h3 {
	font-size: clamp(1.75rem, 1.4rem + 0.8vw, 2.125rem);
}

.wp-block-group.is-style-card .wp-block-buttons {
	margin-top: auto;
}

@media (max-width: 599px) {
	.wp-block-group.is-style-card {
		padding: 0 22px 22px;
	}

	.wp-block-group.is-style-card > .is-style-tab:first-child {
		margin-inline: -22px;
		padding-inline: 22px;
	}
}

/* Index card (block style «Karteikarte» on core/group): white, taped. */
.wp-block-group.is-style-note {
	position: relative;
	background: var(--wp--preset--color--paper);
	box-shadow: var(--suaq-print-shadow);
	padding: 28px 28px 24px;
	transform: rotate(1.2deg);
}

.wp-block-group.is-style-note::before {
	content: "";
	position: absolute;
	top: -13px;
	left: 50%;
	width: 92px;
	height: 26px;
	margin-left: -46px;
	background: var(--suaq-tape);
	clip-path: var(--suaq-tape-clip);
	transform: rotate(-3deg);
	pointer-events: none;
}

/* Prints: every image is a pasted photo ------------------------------------ */

.wp-block-image:not(.is-style-plain) {
	--print-pad: 10px;
	--tape-w: 92px;
	--tape-h: 26px;
	--rot: 0deg;
	position: relative;
	box-sizing: border-box;
}

.wp-block-image:not(.is-style-plain) > img,
.wp-block-image:not(.is-style-plain) > a > img,
.wp-block-image:not(.is-style-plain) > picture img,
.wp-block-image:not(.is-style-plain) > a > picture img {
	border: 0 !important;
	box-shadow: none !important;
	display: block;
	width: 100%;
	height: auto;
}

.wp-block-image:not(.is-style-plain) {
	background: var(--wp--preset--color--paper);
	padding: var(--print-pad);
	box-shadow: var(--suaq-print-shadow);
	transform: rotate(var(--rot));
	width: fit-content;
	max-width: 100%;
}

.wp-block-image:not(.is-style-plain):has(> figcaption) {
	padding-bottom: 0;
}

.wp-block-image:not(.is-style-plain) > figcaption.wp-element-caption {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin: 0;
	padding: calc(var(--print-pad) * 1.1) 2px calc(var(--print-pad) * 1.3);
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--display);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: start;
}

.wp-block-image:not(.is-style-plain) > figcaption em,
.wp-block-image:not(.is-style-plain) > figcaption .suaq-meta {
	flex: none;
	font-style: normal;
	color: var(--wp--preset--color--muted);
}

.wp-block-image.is-resized,
.wp-block-image.aligncenter {
	margin-inline: auto;
}

.wp-block-image.alignwide,
.wp-block-image.alignfull {
	width: auto;
}

/* Rotation by position, so it stays the same on every visit. */
:where(.entry-content, .wp-block-post-content, .wp-block-group, .wp-block-column) > .wp-block-image:not(.is-style-plain):nth-of-type(4n + 1) { --rot: -1deg; }
:where(.entry-content, .wp-block-post-content, .wp-block-group, .wp-block-column) > .wp-block-image:not(.is-style-plain):nth-of-type(4n + 2) { --rot: 1.4deg; }
:where(.entry-content, .wp-block-post-content, .wp-block-group, .wp-block-column) > .wp-block-image:not(.is-style-plain):nth-of-type(4n + 3) { --rot: -0.6deg; }
:where(.entry-content, .wp-block-post-content, .wp-block-group, .wp-block-column) > .wp-block-image:not(.is-style-plain):nth-of-type(4n + 4) { --rot: 1.6deg; }

.wp-block-image.is-style-straight {
	--rot: 0deg !important;
}

/* Tape: none on «Abzug» and «Gerade», top by default, or a corner or two. */
.wp-block-image:not(.is-style-plain, .is-style-print, .is-style-straight)::before,
.wp-block-image.is-style-taped-corners::after,
.wp-block-image.is-style-taped-diagonal::after {
	content: "";
	position: absolute;
	z-index: 2;
	width: var(--tape-w);
	height: var(--tape-h);
	background: var(--suaq-tape);
	clip-path: var(--suaq-tape-clip);
	pointer-events: none;
}

.wp-block-image:not(.is-style-plain, .is-style-print, .is-style-straight, .is-style-taped-corner, .is-style-taped-corners, .is-style-taped-diagonal)::before {
	top: calc(var(--tape-h) / -2);
	left: 50%;
	margin-left: calc(var(--tape-w) / -2);
	transform: rotate(3deg);
}

.wp-block-image.is-style-taped-corner::before,
.wp-block-image.is-style-taped-corners::after {
	top: calc(var(--tape-h) * -0.25);
	right: calc(var(--tape-w) * -0.28);
	width: calc(var(--tape-w) * 0.9);
	transform: rotate(40deg);
}

.wp-block-image.is-style-taped-corners::before,
.wp-block-image.is-style-taped-diagonal::before {
	top: calc(var(--tape-h) * -0.25);
	left: calc(var(--tape-w) * -0.28);
	width: calc(var(--tape-w) * 0.9);
	transform: rotate(-40deg);
}

.wp-block-image.is-style-taped-diagonal::after {
	bottom: calc(var(--tape-h) * -0.25);
	right: calc(var(--tape-w) * -0.28);
	width: calc(var(--tape-w) * 0.9);
	transform: rotate(-40deg);
}

/* Sizes: S in tight grids, L for headers and leads. */
.suaq-print--s,
.wp-block-image.is-print-s {
	--print-pad: 6px;
	--tape-w: 54px;
	--tape-h: 16px;
}

.suaq-print--l,
.wp-block-image.is-print-l,
.wp-block-image.alignwide:not(.is-style-plain),
.wp-block-image.alignfull:not(.is-style-plain) {
	--print-pad: 12px;
	--tape-w: 108px;
	--tape-h: 30px;
}

.wp-block-image.is-style-plain img {
	box-shadow: none;
	border: 0;
}

@media (max-width: 599px) {
	.wp-block-image:not(.is-style-plain) {
		--print-pad: 8px;
	}
}

/* Galleries: prints in masonry columns, each with an enlarge button -------- */

.wp-block-gallery.has-nested-images {
	display: block;
	columns: 2;
	column-gap: clamp(1.25rem, 2.5vw, 2.25rem);
}

/* From tablet up, as many columns as fit at about 12rem each, at most four:
   a gallery in a narrow column gets two, a wide one four. */
@media (min-width: 600px) {
	.wp-block-gallery.has-nested-images {
		columns: 12rem 4;
	}
}

.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
	display: block;
	width: 100% !important;
	margin: 14px 4px 30px;
	break-inside: avoid;
	--print-pad: 10px;
	--tape-w: 92px;
	--tape-h: 26px;
}

.wp-block-gallery.has-nested-images figure.wp-block-image img {
	height: auto !important;
	object-fit: initial !important;
}

.wp-block-gallery.has-nested-images figure.wp-block-image > figcaption.wp-element-caption {
	position: static;
	background: none;
	max-height: none;
	overflow: visible;
	color: var(--wp--preset--color--contrast);
	text-shadow: none;
	font-size: 0.9375rem;
}

/* In galleries the tape cycles so neighbours never overlap: top, tr, tl, top, br, tl+tr. */
.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 1) { --rot: -1.4deg; }
.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 2) { --rot: 1.2deg; }
.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 3) { --rot: -0.6deg; }
.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 4) { --rot: 1.6deg; }
.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 5) { --rot: -1.8deg; }
.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 6) { --rot: 0.8deg; }

.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 2)::before,
.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 3)::before,
.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 5)::before,
.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 6)::before {
	top: calc(var(--tape-h) * -0.25);
	width: calc(var(--tape-w) * 0.9);
	margin-left: 0;
}

.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 2)::before {
	left: auto;
	right: calc(var(--tape-w) * -0.28);
	transform: rotate(40deg);
}

.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 3)::before,
.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 6)::before {
	left: calc(var(--tape-w) * -0.28);
	transform: rotate(-40deg);
}

.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 5)::before {
	top: auto;
	bottom: calc(var(--tape-h) * -0.25);
	left: auto;
	right: calc(var(--tape-w) * -0.28);
	transform: rotate(-40deg);
}

.wp-block-gallery figure.wp-block-image:nth-of-type(6n + 6)::after {
	content: "";
	position: absolute;
	z-index: 2;
	top: calc(var(--tape-h) * -0.25);
	right: calc(var(--tape-w) * -0.28);
	width: calc(var(--tape-w) * 0.9);
	height: var(--tape-h);
	background: var(--suaq-tape);
	clip-path: var(--suaq-tape-clip);
	transform: rotate(40deg);
	pointer-events: none;
}

/* The enlarge button the lightbox puts on each linked print. */
.suaq-zoom {
	position: absolute;
	right: calc(var(--print-pad, 10px) + 8px);
	bottom: 8px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: rgb(35 39 31 / 80%);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.suaq-zoom:hover {
	background: var(--wp--preset--color--accent);
}

.wp-block-image:has(> figcaption) .suaq-zoom {
	bottom: auto;
}

.suaq-zoom-wrap {
	position: relative;
	display: block;
}

.suaq-zoom-wrap .suaq-zoom {
	right: 8px;
	bottom: 8px;
}

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

.wp-element-button,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: 44px;
	box-sizing: border-box;
	transition: background-color 0.15s, color 0.15s;
}

.wp-block-button__link:active {
	transform: translateY(1px);
}

.wp-block-button__link[aria-disabled="true"],
.wp-block-button__link.is-disabled {
	background: var(--wp--preset--color--border) !important;
	color: var(--wp--preset--color--muted) !important;
	pointer-events: none;
}

/* Spenden */
.wp-block-button.is-style-donate .wp-block-button__link {
	background-color: var(--wp--preset--color--accent);
	color: #fff;
}

.wp-block-button.is-style-donate .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--contrast);
	color: #fff;
}

.wp-block-button.is-style-donate .wp-block-button__link:focus-visible {
	outline-color: var(--wp--preset--color--contrast);
}

.wp-block-button.is-style-donate .wp-block-button__link:active {
	background-color: var(--suaq-ink-accent);
}

/* Sekundär: core's outline style, drawn as the spec's 2 px ink outline. */
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 2px solid currentColor;
	padding: calc(0.9rem - 2px) calc(1.5rem - 2px);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.wp-block-button.is-style-outline .wp-block-button__link:active {
	background: var(--suaq-ink);
}

/* On green or rust, the outline is white. */
:where(.has-primary-background-color, .has-accent-background-color, .has-contrast-background-color) .wp-block-button.is-style-outline .wp-block-button__link {
	color: #fff;
}

:where(.has-primary-background-color, .has-accent-background-color, .has-contrast-background-color) .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: #fff;
	border-color: #fff;
	color: var(--wp--preset--color--primary);
}

/* On rust bands the main button is white with ink text. */
.has-accent-background-color .wp-block-button:not(.is-style-outline, .is-style-text) .wp-block-button__link {
	background: #fff;
	color: var(--wp--preset--color--contrast);
}

.has-accent-background-color .wp-block-button:not(.is-style-outline, .is-style-text) .wp-block-button__link:hover {
	background: var(--wp--preset--color--contrast);
	color: #fff;
}

/* Textlink: green, underlined, an arrow after it. */
.wp-block-button.is-style-text .wp-block-button__link {
	min-height: 44px;
	padding: 12px 0;
	background: none;
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-thickness: 2px;
	font-size: 1.125rem;
}

.wp-block-button.is-style-text .wp-block-button__link:hover {
	color: var(--wp--preset--color--accent);
	text-decoration-thickness: 3px;
	background: none;
}

.wp-block-button.is-style-text .wp-block-button__link:active {
	color: var(--suaq-ink-accent);
}

@media (max-width: 599px) {
	.wp-block-buttons:not(.suaq-keep-inline) > .wp-block-button:not(.is-style-text) {
		width: 100%;
	}

	.wp-block-buttons:not(.suaq-keep-inline) > .wp-block-button:not(.is-style-text) .wp-block-button__link {
		width: 100%;
	}
}

/* Quote: a big rust „ above italic text. ----------------------------------- */

.wp-block-quote {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-inline: 0;
	padding: 8px 0;
	border: 0;
}

.wp-block-quote::before {
	content: "„";
	display: block;
	height: 48px;
	color: var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--display);
	font-size: 120px;
	font-weight: 700;
	font-style: normal;
	line-height: 0.6;
}

.wp-block-quote p {
	margin: 0;
}

.wp-block-quote cite {
	line-height: 1.3;
}

/* Separator, lists, chips ------------------------------------------------- */

.wp-block-separator {
	border: 0;
	border-top: 2px solid currentColor;
	opacity: 1;
}

.wp-block-list.is-style-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0;
	list-style: none;
}

.wp-block-list.is-style-chips li {
	margin: 0;
}

.wp-block-list.is-style-chips a,
.suaq-chip {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 16px;
	box-sizing: border-box;
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.9375rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
}

.wp-block-list.is-style-chips a:hover,
.suaq-chip:hover,
.suaq-chip[aria-current] {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Breadcrumbs ------------------------------------------------------------- */

.suaq-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.suaq-breadcrumbs li + li::before {
	content: "/";
	margin-right: 10px;
}

.suaq-breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

.suaq-breadcrumbs a:hover {
	color: var(--wp--preset--color--accent);
}

.suaq-breadcrumbs [aria-current] {
	color: var(--wp--preset--color--contrast);
}

/* Page headers ------------------------------------------------------------ */

.suaq-page-head {
	padding-block: 28px 0;
}

.suaq-page-head--plain {
	padding-bottom: clamp(2rem, 4vw, 4rem);
	border-bottom: 2px solid var(--wp--preset--color--contrast);
}

.suaq-page-head--plain > * + * {
	margin-block-start: 1.25rem;
}

.suaq-page-head .wp-block-post-title {
	margin-block: 0.75rem 0;
}

.suaq-page-head .wp-block-post-excerpt,
.suaq-page-head .suaq-lead {
	max-width: 36em;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
}

.suaq-page-head .wp-block-post-excerpt__more-text {
	display: none;
}

/* With a title photo: the print spans the width; title and lead sit on a
   dark fade at its foot. */
.suaq-page-head .suaq-head-print {
	position: relative;
	margin: 22px calc(var(--suaq-gutter) * -0.375) 0;
	padding: 12px;
	background: var(--wp--preset--color--paper);
	box-shadow: var(--suaq-print-shadow);
	--tape-w: 108px;
	--tape-h: 30px;
}

.suaq-head-print::before,
.suaq-head-print::after {
	content: "";
	position: absolute;
	z-index: 2;
	top: calc(var(--tape-h) * -0.25);
	width: calc(var(--tape-w) * 0.9);
	height: var(--tape-h);
	background: var(--suaq-tape);
	clip-path: var(--suaq-tape-clip);
	pointer-events: none;
}

.suaq-head-print::before {
	left: calc(var(--tape-w) * -0.28);
	transform: rotate(-40deg);
}

.suaq-head-print::after {
	right: calc(var(--tape-w) * -0.28);
	transform: rotate(40deg);
}

.suaq-head-print .wp-block-post-featured-image,
.suaq-head-print .wp-block-cover {
	margin: 0;
	aspect-ratio: 21 / 8;
	min-height: 0 !important;
}

.suaq-head-print .wp-block-cover {
	padding: clamp(1.5rem, 3.6vw, 3.25rem);
	align-items: flex-end;
}

.suaq-head-print .wp-block-cover__background {
	background: linear-gradient(180deg, transparent 40%, rgb(0 0 0 / 70%) 100%) !important;
	opacity: 1 !important;
}

.suaq-head-print .wp-block-cover__inner-container {
	display: flex;
	flex-direction: column;
	gap: 18px;
	color: #fff;
	width: 100%;
}

.suaq-head-print .wp-block-cover__inner-container > * {
	margin: 0;
}

.suaq-head-print h1 {
	color: #fff;
}

@media (max-width: 599px) {
	.suaq-head-print .wp-block-cover {
		aspect-ratio: 4 / 5;
	}

	.suaq-page-head .suaq-head-print {
		margin-inline: 0;
		padding: 8px;
		--tape-w: 54px;
		--tape-h: 16px;
	}
}

/* Bands: full-width colour fields with constrained content. ---------------- */

.suaq-band {
	padding-block: clamp(3rem, 1.5rem + 6vw, 6.5rem);
}

.suaq-band--donate h2 {
	color: #fff;
}

/* Hover lift on cards and prints that are links, unless motion is reduced. */
@media (prefers-reduced-motion: no-preference) {
	.suaq-lift {
		transition: transform 0.2s ease;
	}

	.suaq-lift:hover,
	.suaq-lift:focus-within {
		transform: translateY(-3px) rotate(var(--rot, 0deg));
	}
}

/* Utilities ---------------------------------------------------------------- */

.screen-reader-text:not(:focus) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.suaq-placeholder {
	padding: 1rem;
	border: 1px dashed var(--wp--preset--color--border);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

/* Page header without a title photo: grid paper and a 2 px line under it. */
.suaq-page-head:not(:has(.wp-block-cover)) {
	background-color: var(--wp--preset--color--base);
	background-image:
		linear-gradient(var(--suaq-grid-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--suaq-grid-line) 1px, transparent 1px);
	background-size: var(--suaq-grid-size) var(--suaq-grid-size);
	border-bottom: 2px solid var(--wp--preset--color--contrast);
	padding-bottom: clamp(2rem, 4vw, 4.5rem);
}

.suaq-head-print:has(> .suaq-head-plain) {
	margin: 0;
	padding: 0;
	background: none;
	box-shadow: none;
}

.suaq-head-print:has(> .suaq-head-plain)::before,
.suaq-head-print:has(> .suaq-head-plain)::after {
	content: none;
}

.suaq-head-plain {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding-top: clamp(1.5rem, 3vw, 3rem);
}

.suaq-head-plain > * {
	margin: 0 !important;
}

.suaq-page-head .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.suaq-page-head:has(.wp-block-cover) {
	padding-bottom: clamp(2rem, 4vw, 4.5rem);
}

.suaq-head-print:has(> .suaq-head-plain) h1 {
	color: var(--wp--preset--color--contrast);
}

.suaq-page-head h1 {
	hyphens: auto;
	-webkit-hyphens: auto;
}


/* Room before the footer. A page that ends on a full-width colour band
   (the donate band) runs into the footer without a gap, as in the mockups. */
.wp-site-blocks > main,
.wp-site-blocks > .suaq-main {
	padding-bottom: var(--suaq-section);
}

.wp-site-blocks > main:has(> .wp-block-post-content > .alignfull.has-background:last-child),
.wp-site-blocks > main:has(> .alignfull.has-background:last-child),
.wp-site-blocks > main:has(> .wp-block-group:last-child > .alignfull.has-background:last-child),
.wp-site-blocks > main:has(.suaq-band--donate:last-child) {
	padding-bottom: 0;
}

.wp-site-blocks > footer,
.wp-site-blocks > .wp-block-template-part:last-child {
	margin-block-start: 0;
}

/* Gallery captions on the old pages are whole sentences with photo credits:
   set them as small serif text, not as the uppercase label of a single print. */
.wp-block-gallery.has-nested-images figure.wp-block-image > figcaption.wp-element-caption {
	display: block;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.45;
	letter-spacing: 0;
	text-transform: none;
	color: var(--wp--preset--color--muted);
	text-align: start;
}

/* On phones a gallery with captions is one print per row, so the sentences
   under the photos stay readable. */
@media (max-width: 599px) {
	.wp-block-gallery.has-nested-images:has(figcaption) {
		columns: 1;
	}
}

/* A print never splits across two gallery columns: as an inline block it
   cannot be fragmented, whatever the browser does with break-inside. Its
   tape and shadow stay in its own column, and the gallery's height includes
   every print, so nothing hangs over the next block. */
.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
	display: inline-block;
	vertical-align: top;
	width: calc(100% - 8px) !important;
	margin: 14px 4px 30px;
	-webkit-column-break-inside: avoid;
	page-break-inside: avoid;
	break-inside: avoid;
}

.wp-block-gallery.has-nested-images {
	padding-bottom: 8px;
}

/* Gallery style «Scrapbook»: prints pasted loosely across the width, at
   different sizes and angles, each with its story on a kraft label stuck
   half over the print. For galleries whose captions are sentences. */
.wp-block-gallery.has-nested-images.is-style-scrapbook {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: clamp(1rem, 2.5vw, 2.5rem);
	row-gap: clamp(2.5rem, 5vw, 4.5rem);
	align-items: start;
	columns: auto;
	padding-block: clamp(1.5rem, 3vw, 3rem) clamp(2rem, 4vw, 4rem);
}

.wp-block-gallery.is-style-scrapbook figure.wp-block-image:not(#individual-image) {
	display: flex;
	flex-direction: column;
	width: auto !important;
	margin: 0;
	padding-bottom: var(--print-pad);
	--print-pad: 12px;
	--tape-w: 108px;
	--tape-h: 30px;
}

/* Five positions, repeating: big left, smaller right and lower, small
   inset, wide right, middle. */
.wp-block-gallery.is-style-scrapbook figure.wp-block-image:nth-of-type(5n + 1) { grid-column: 1 / span 5; --rot: -2deg; }
.wp-block-gallery.is-style-scrapbook figure.wp-block-image:nth-of-type(5n + 2) { grid-column: 7 / span 4; margin-top: clamp(2rem, 6vw, 6rem); --rot: 1.8deg; }
.wp-block-gallery.is-style-scrapbook figure.wp-block-image:nth-of-type(5n + 3) { grid-column: 2 / span 4; --rot: 1.2deg; }
.wp-block-gallery.is-style-scrapbook figure.wp-block-image:nth-of-type(5n + 4) { grid-column: 7 / span 5; margin-top: clamp(1rem, 3vw, 3rem); --rot: -1.4deg; }
.wp-block-gallery.is-style-scrapbook figure.wp-block-image:nth-of-type(5n + 5) { grid-column: 4 / span 5; --rot: 2.2deg; }

/* An odd one out at the end sits in the middle. */
.wp-block-gallery.is-style-scrapbook figure.wp-block-image:last-child:nth-of-type(5n + 1) {
	grid-column: 4 / span 5;
}

.wp-block-gallery.is-style-scrapbook figure.wp-block-image img {
	width: 100% !important;
	height: auto !important;
	max-height: 30rem;
	object-fit: cover !important;
}

/* The story: a kraft label stuck over the foot of the print. */
.wp-block-gallery.is-style-scrapbook figure.wp-block-image > figcaption.wp-element-caption {
	position: relative;
	z-index: 3;
	align-self: flex-end;
	width: 88%;
	margin: -1.75rem -1.25rem -1.5rem 0;
	padding: 14px 18px 15px;
	background: var(--wp--preset--color--kraft);
	color: var(--wp--preset--color--contrast);
	box-shadow: 0 2px 3px rgb(35 39 31 / 18%), 0 10px 18px -12px rgb(35 39 31 / 45%);
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.9375rem;
	font-style: italic;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: 0;
	text-transform: none;
	text-align: start;
	transform: rotate(calc(var(--rot) * -1.4));
}

.wp-block-gallery.is-style-scrapbook figure.wp-block-image:nth-of-type(even) > figcaption.wp-element-caption {
	align-self: flex-start;
	margin: -1.75rem 0 -1.5rem -1.25rem;
	background: var(--wp--preset--color--paper);
	border-left: 3px solid var(--wp--preset--color--accent);
}

/* The labels are paper too: tape on every second one. */
.wp-block-gallery.is-style-scrapbook figure.wp-block-image:nth-of-type(3n) > figcaption.wp-element-caption::before {
	content: "";
	position: absolute;
	top: -12px;
	right: 18%;
	width: 64px;
	height: 20px;
	background: var(--suaq-tape);
	clip-path: var(--suaq-tape-clip);
	transform: rotate(-6deg);
}

@media (max-width: 781px) {
	.wp-block-gallery.has-nested-images.is-style-scrapbook {
		grid-template-columns: repeat(6, minmax(0, 1fr));
		row-gap: 3rem;
	}

	.wp-block-gallery.is-style-scrapbook figure.wp-block-image:nth-of-type(odd) { grid-column: 1 / span 6 !important; margin-top: 0 !important; margin-right: 6%; }
	.wp-block-gallery.is-style-scrapbook figure.wp-block-image:nth-of-type(even) { grid-column: 1 / span 6 !important; margin-top: 0 !important; margin-left: 8%; }

	.wp-block-gallery.is-style-scrapbook figure.wp-block-image > figcaption.wp-element-caption,
	.wp-block-gallery.is-style-scrapbook figure.wp-block-image:nth-of-type(even) > figcaption.wp-element-caption {
		width: 92%;
		margin-right: -0.5rem;
		margin-left: -0.5rem;
	}
}

/* Long page titles: one step down, a second for very long ones. They stay
   Barlow caps but read as a sentence, not a poster. */
h1.wp-block-post-title.is-title-long {
	font-size: clamp(2.5rem, 1.6rem + 3.6vw, 5rem);
	line-height: 0.92;
}

h1.wp-block-post-title.is-title-very-long {
	font-size: clamp(2rem, 1.4rem + 2.2vw, 3.5rem);
	line-height: 0.98;
	max-width: 24em;
}

/* Vertical rhythm -----------------------------------------------------------
   One scale for the whole site (theme.json custom.space):
   - flow    (1.25rem)   between paragraphs and list items of running text;
   - block   (32–64 px)  around anything that is not running text: headings
                         that start a section, images, galleries, columns,
                         tables, quotes, buttons, and every block of the
                         content model (lists of projects, trees, …);
   - section (48–104 px) around full-width colour bands, from the page
                         header to the content, and from the content to
                         the footer.
   The rules hold for the top level of page content and of constrained
   groups (pattern sections), so a block gets the same room wherever it is. */

:root {
	--suaq-flow: var(--wp--custom--space--flow, 1.25rem);
	--suaq-block: var(--wp--custom--space--block, var(--wp--preset--spacing--50));
	--suaq-section: var(--wp--custom--space--section, var(--wp--preset--spacing--60));
}

:where(main) :is(.wp-block-post-content, .wp-block-group.is-layout-constrained, .wp-block-column) > * {
	margin-block: 0;
}

:where(main) :is(.wp-block-post-content, .wp-block-group.is-layout-constrained, .wp-block-column) > * + * {
	margin-block-start: var(--suaq-flow);
}

/* Anything that is not running text, and whatever follows it. */
:where(main) :is(.wp-block-post-content, .wp-block-group.is-layout-constrained, .wp-block-column) > :not(p, ul, ol, h4, h5, h6, .wp-block-paragraph, .wp-block-list, .alignfull.has-background, .suaq-band) + *,
:where(main) :is(.wp-block-post-content, .wp-block-group.is-layout-constrained, .wp-block-column) > * + :not(p, ul, ol, h4, h5, h6, .wp-block-paragraph, .wp-block-list, .alignfull.has-background, .suaq-band) {
	margin-block-start: var(--suaq-block);
}

/* A heading belongs to what follows it. */
:where(main) :is(.wp-block-post-content, .wp-block-group.is-layout-constrained, .wp-block-column) > :is(h2, h3, h4, .wp-block-heading) + :is(*, .x) {
	margin-block-start: var(--suaq-flow);
}

:where(main) :is(.wp-block-post-content, .wp-block-group.is-layout-constrained, .wp-block-column) > :is(h4, h5, h6):not(:first-child) {
	margin-block-start: calc(var(--suaq-flow) * 1.6);
}

/* Full-width colour bands are sections. */
:where(main) :is(.wp-block-post-content, .wp-block-group.is-layout-constrained) > :is(.alignfull.has-background, .suaq-band):not(:first-child),
:where(main) :is(.wp-block-post-content, .wp-block-group.is-layout-constrained) > :is(.alignfull.has-background, .suaq-band) + * {
	margin-block-start: var(--suaq-section);
}

:where(main) :is(.wp-block-post-content, .wp-block-group.is-layout-constrained) > :is(.alignfull.has-background, .suaq-band) + :is(.alignfull.has-background, .suaq-band) {
	margin-block-start: 0;
}

/* From the page header to the content. */
:where(main) .suaq-page-head,
:where(main) .suaq-page-head:has(.wp-block-cover),
:where(main) .suaq-page-head:not(:has(.wp-block-cover)) {
	padding-bottom: var(--suaq-block);
}

:where(main) :is(.suaq-page-head, .wp-block-template-part:has(> .suaq-page-head)) + .wp-block-post-content > :first-child,
:where(main) .wp-block-post-content > .suaq-page-head + * {
	margin-block-start: var(--suaq-block);
}

/* A section band right after the header sits flush. */
:where(main) .wp-block-post-content > .suaq-page-head + :is(.alignfull.has-background, .suaq-band) {
	margin-block-start: 0;
}

.wp-block-columns.alignwide {
	column-gap: clamp(1.5rem, 4vw, 4rem);
	row-gap: var(--suaq-block);
}

/* A long page title is shortened in the breadcrumbs; the full title is the H1 below. */
.suaq-breadcrumbs li:last-child span {
	display: inline-block;
	max-width: 32ch;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	vertical-align: bottom;
}

/* Group style «Sprechblase»: a comic speech bubble on paper, ink outline,
   a tail toward whoever is talking. */
.wp-block-group.is-style-speech {
	position: relative;
	z-index: 5;
	box-sizing: border-box;
	max-width: 23rem !important;
	padding: 22px 28px 20px;
	background: var(--wp--preset--color--paper);
	border: 2.5px solid var(--wp--preset--color--contrast);
	border-radius: 28px;
	box-shadow: 6px 8px 0 rgb(35 39 31 / 14%);
	transform: rotate(-2deg);
}

.wp-block-group.is-style-speech > * {
	margin: 0 !important;
}

.wp-block-group.is-style-speech > * + * {
	margin-top: 0.6rem !important;
}

/* The tail: an ink triangle with a paper one inside it. */
.wp-block-group.is-style-speech::before,
.wp-block-group.is-style-speech::after {
	content: "";
	position: absolute;
	bottom: 22%;
	left: -52px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 18px 54px 18px 0;
	border-color: transparent var(--wp--preset--color--contrast) transparent transparent;
	transform: rotate(22deg);
	transform-origin: right center;
}

.wp-block-group.is-style-speech::after {
	left: -45px;
	border-width: 14px 47px 14px 0;
	border-color: transparent var(--wp--preset--color--paper) transparent transparent;
	margin-bottom: 3px;
}

.suaq-speech__shout {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.375rem);
	font-weight: 700;
	line-height: 0.95;
	text-transform: uppercase;
}

.wp-block-group.is-style-speech p:not([class]) {
	font-size: 1.0625rem;
	line-height: 1.5;
}

.suaq-speech__sign {
	color: var(--wp--preset--color--muted);
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

@media (prefers-reduced-motion: no-preference) {
	.wp-block-group.is-style-speech {
		animation: suaq-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 0.3s both;
	}

	@keyframes suaq-pop {
		from {
			opacity: 0;
			transform: rotate(-2deg) scale(0.6) translateX(-20px);
		}
	}
}

/* In the page photo: the bubble sits beside the orangutan's face, which is
   about a third in from the left and halfway up the 21:8 print. */
@media (min-width: 782px) {
	.wp-block-post-content > .suaq-speech--head:first-child {
		--photo-w: min(82rem, 100vw - 2 * var(--suaq-gutter));
		--photo-h: calc(var(--photo-w) * 8 / 21);
		margin-top: calc(-0.8 * var(--photo-h) - clamp(2rem, 4vw, 4.5rem)) !important;
		margin-left: calc(50% - var(--photo-w) / 2 + var(--photo-w) * 0.43) !important;
		margin-right: auto !important;
		margin-bottom: calc(0.8 * var(--photo-h) - 15rem) !important;
	}
}

/* On a phone the bubble hangs from the foot of the photo, tail up. */
@media (max-width: 781px) {
	.wp-block-post-content > .suaq-speech--head:first-child {
		margin-top: -1.5rem !important;
		margin-left: 8% !important;
		margin-right: var(--suaq-gutter) !important;
	}

	.wp-block-group.is-style-speech.suaq-speech--head::before,
	.wp-block-group.is-style-speech.suaq-speech--head::after {
		bottom: auto;
		top: -40px;
		left: 14%;
		border-width: 0 16px 40px 16px;
		border-color: transparent transparent var(--wp--preset--color--contrast) transparent;
		transform: none;
	}

	.wp-block-group.is-style-speech.suaq-speech--head::after {
		top: -33px;
		left: calc(14% + 3.5px);
		border-width: 0 12.5px 34px 12.5px;
		border-color: transparent transparent var(--wp--preset--color--paper) transparent;
		margin: 0;
	}
}

/* The contact form below, on a white print with its tab. */
.suaq-contact-card {
	max-width: 44rem !important;
	margin-top: var(--wp--preset--spacing--50) !important;
}

.suaq-contact-card > .is-style-tab {
	margin-bottom: 0;
}

.suaq-contact-card .wp-block-gravityforms-form,
.suaq-contact-card .gform_wrapper {
	margin-top: 0 !important;
	padding: clamp(20px, 3vw, 36px);
	background: var(--wp--preset--color--paper);
	box-shadow: var(--wp--preset--shadow--print);
}

/* A long bare URL in running text (a PDF link, a DOI) breaks where it
   must instead of pushing the page wider than a phone. */
:where(main) :is(p, li, dd, td, figcaption, blockquote) a {
	overflow-wrap: anywhere;
}
