/* ============================================================
   Craftizen — block sections
   Loaded on every page that is NOT one of the eleven designed
   ones, and into the editor canvas so what you drag matches
   what ships.

   Everything here styles *core* blocks through a cz-b- class.
   Nothing is positioned absolutely and nothing depends on a
   fixed canvas: sections stack, wrap and reflow, which is what
   makes them safe to rearrange in the editor.
   ============================================================ */

:root {
	--czb-brown: #57330d;
	--czb-rust: #91321f;
	--czb-cream: #f9efe2;
	--czb-sand: #e3dbb5;
	--czb-ink: #1e1e1e;
	--czb-ease: cubic-bezier(.22, .61, .36, 1);
	--czb-radius: 18px;
	/* the gutter the designed pages use, so a block page lines up with them */
	--czb-pad: clamp(24px, 7.4vw, 56px);
}

/* ---------- the page shell ---------- */

.cz-blocks .cz-blocks-main {
	font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--czb-ink);
	/* clears the fixed nav the chrome puts at the top */
	padding-top: 100px;
}

.cz-blocks-main > :where(*) {
	margin-block: 0;
}

/* Core gives alignfull a negative margin only inside a constrained layout;
   this main is a plain block, so full-width sections are made to bleed here. */
.cz-blocks-main .alignfull {
	margin-inline: 0;
	width: 100%;
}

.cz-blocks-main .alignwide,
.cz-blocks-main > .wp-block-group:not(.alignfull),
.cz-blocks-main > .wp-block-columns:not(.alignfull) {
	max-width: 1240px;
	margin-inline: auto;
	box-sizing: border-box;
}

/* The gutter goes only on blocks sitting directly in the page flow. An
   alignwide nested inside a full-width group is already inside that group's
   padding, and padding it again cost ~56px a side — enough to drop the
   impact grid from two tiles across to one on a phone. */
.cz-blocks-main > .alignwide,
.cz-blocks-main > .wp-block-group:not(.alignfull),
.cz-blocks-main > .wp-block-columns:not(.alignfull) {
	padding-inline: var(--czb-pad);
}

/* a constrained group already pads itself; don't pad it twice */
.cz-blocks-main .alignfull > .wp-block-group__inner-container,
.cz-blocks-main .alignfull.wp-block-group {
	box-sizing: border-box;
}

.cz-blocks-main :where(p) {
	line-height: 1.6;
}

.cz-blocks-main :where(h1, h2, h3, h4) {
	font-family: Raleway, sans-serif;
	font-weight: 600;
	line-height: 1.1;
	color: var(--czb-brown);
	letter-spacing: -0.01em;
}

/* ---------- hero ---------- */

.cz-b-hero {
	align-items: center;
}

.cz-b-hero-h {
	text-align: center;
	max-width: 18ch;
	margin-inline: auto;
	text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
}

/* ---------- statement band ---------- */

.cz-b-band h2 {
	color: #fff;
	max-width: 24ch;
	margin-inline: auto;
	line-height: 1.18;
}

/* ---------- intro ---------- */

.cz-b-intro p {
	max-width: 56ch;
	margin-inline: auto;
	line-height: 1.5;
}

/* ---------- programme cards ---------- */

.cz-b-prog-grid {
	gap: clamp(14px, 2vw, 24px);
}

.cz-b-prog-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	transition: translate .35s var(--czb-ease), box-shadow .35s ease;
}

.cz-b-prog-card > .wp-block-buttons {
	margin-top: auto;
	padding-top: clamp(14px, 2vw, 22px);
}

.cz-b-prog-card h3 {
	line-height: 1.12;
}

@media (hover: hover) and (pointer: fine) {
	.cz-b-prog-card:hover {
		translate: 0 -4px;
		box-shadow: 0 18px 34px -18px rgba(87, 51, 13, .45);
	}
}

/* ---------- impact tiles ---------- */

/* A grid rather than columns: tiles wrap on their own, so adding or
   removing one in the editor never leaves a broken row. */
.cz-b-stats {
	display: grid;
	/* The track minimum is a variable so the same auto-fit grid gives five
	   across on desktop and two on a phone, which is what the designed Home
	   page does. auto-fit alone cannot do both from one number. */
	--czb-tile: 220px;
	grid-template-columns: repeat(auto-fit, minmax(var(--czb-tile), 1fr));
	gap: clamp(12px, 1.6vw, 22px);
	margin-top: clamp(24px, 4vw, 44px);
}

.cz-b-stat {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: clamp(130px, 15vw, 190px);
}

.cz-b-stat-n {
	font-family: Raleway, sans-serif;
	font-weight: 600;
	font-size: clamp(28px, 3.4vw, 46px);
	line-height: 1.05;
	margin: 0 0 .35em;
	font-variant-numeric: tabular-nums;
}

.cz-b-stat-l {
	margin: 0;
	line-height: 1.3;
	font-weight: 600;
}

/* ---------- footprint ---------- */

.cz-b-foot-grid {
	gap: clamp(20px, 4vw, 48px);
	margin-top: clamp(20px, 3vw, 36px);
}

.cz-b-map img {
	width: 100%;
	height: auto;
}

/* ---------- logo rows (awards, donors) ---------- */

/* Declared flex here rather than left to the block's own layout attribute:
   WordPress generates that rule into a per-block .wp-container-* class at
   render time, so the row would collapse anywhere that class is missing —
   a pattern preview, a cached page, or an export. */
.cz-b-logos {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: clamp(18px, 3vw, 44px);
	margin-top: clamp(24px, 4vw, 44px);
	align-items: center;
}

.cz-b-logos .wp-block-image {
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cz-b-logos img {
	height: auto;
	max-height: 90px;
	width: auto;
	object-fit: contain;
	transition: scale .3s var(--czb-ease), opacity .3s ease;
}

@media (hover: hover) and (pointer: fine) {
	.cz-b-logos:hover img { opacity: .45; }
	.cz-b-logos img:hover { opacity: 1; scale: 1.06; }
}

/* ---------- closing CTA ---------- */

.cz-b-partner {
	gap: 0;
	margin-block: 0;
}

.cz-b-partner-ph {
	margin: 0;
	height: 100%;
}

.cz-b-partner-ph img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cz-b-partner-tx h2 {
	margin-top: 0;
}

/* ---------- buttons ---------- */

.cz-blocks-main .wp-element-button,
.cz-blocks-main .wp-block-button__link {
	font-family: Raleway, sans-serif;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	font-size: 13px;
	transition: translate .3s var(--czb-ease), background-color .3s ease;
}

.cz-blocks-main .wp-element-button:hover {
	translate: 0 -2px;
}

.cz-blocks-main .is-style-outline .wp-block-button__link {
	border: 1.5px solid currentColor;
	background: transparent;
	color: var(--czb-brown);
}

/* ---------- phones ---------- */

@media (max-width: 781px) {
	.cz-blocks .cz-blocks-main { padding-top: 76px; }

	.cz-b-stats { --czb-tile: 140px; }

	/* core already stacks columns here; make the CTA photo lead */
	.cz-b-partner { flex-direction: column; }
	.cz-b-partner-ph img { aspect-ratio: 16 / 10; }

	.cz-b-hero-h { font-size: clamp(32px, 9vw, 46px); }
}

/* ---------- the editor canvas ---------- */

/* The editor has no nav above the content, so the clearance the front end
   needs would read as a large empty gap at the top of the canvas. */
.editor-styles-wrapper .cz-blocks-main,
.block-editor-writing-flow .cz-blocks-main { padding-top: 0; }

.editor-styles-wrapper {
	font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--czb-ink);
}

.editor-styles-wrapper :where(h1, h2, h3, h4) {
	font-family: Raleway, sans-serif;
	font-weight: 600;
	color: var(--czb-brown);
}

/* ============================================================
   Section library — the archetypes the ten inner pages are
   built from. Same rule as above: flow layout only, so any of
   these can be dragged into any order.
   ============================================================ */

/* ---------- page hero: panel beside a photograph ---------- */

.cz-b-hero2 { gap: 0; margin-block: 0; }
.cz-b-hero2-ph { margin: 0; }
.cz-b-hero2-ph .wp-block-image,
.cz-b-hero2-ph img { margin: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cz-b-hero2-tx h1 { margin-top: 0; }

/* ---------- the workhorse: photograph beside a colour panel ---------- */

.cz-b-ov { gap: 0; margin-block: 0; }
.cz-b-ov-ph { margin: 0; }
.cz-b-ov-ph .wp-block-image,
.cz-b-ov-ph img { margin: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cz-b-ov-tx h2 { margin-top: 0; }
.cz-b-ov-tx p { line-height: 1.6; }

/* ---------- closing band ---------- */

.cz-b-ctaband h2 { max-width: 22ch; margin-inline: auto; }
.cz-b-ctaband p { max-width: 54ch; margin-inline: auto; }

/* ---------- programme band ---------- */

.cz-b-pband-ph img { border-radius: 14px; }
.cz-b-pband-in { max-width: 760px; margin-inline: auto; }

/* ---------- year cards ---------- */

.cz-b-yr-grid { gap: clamp(12px, 2vw, 22px); }
.cz-b-yr-card { height: 100%; }
.cz-b-yr-card h3 { margin-top: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .5em; }
.cz-b-yr-when {
	font-family: "Open Sans", sans-serif;
	font-size: .55em;
	font-weight: 600;
	opacity: .85;
}
/* figure on the left, label on the right — the same shape the designed page
   uses, and the reason those cards are no longer three times too tall */
.cz-b-yr-row {
	display: flex;
	align-items: baseline;
	gap: .6em;
	margin: 0 0 .55em;
	line-height: 1.3;
}
.cz-b-yr-row strong {
	font-family: Raleway, sans-serif;
	font-size: clamp(22px, 3vw, 32px);
	line-height: 1.05;
	flex: 0 0 auto;
}

/* ---------- numbered timeline ---------- */

.cz-b-steps {
	--czb-rail: clamp(32px, 8vw, 44px);
	position: relative;
	padding-left: var(--czb-rail);
	display: grid;
	gap: clamp(22px, 5vw, 32px);
	margin-top: clamp(24px, 4vw, 40px);
}
.cz-b-steps::before {
	content: "";
	position: absolute;
	left: 5px; top: 8px; bottom: 8px;
	width: 2px;
	border-radius: 2px;
	background: rgba(145, 50, 31, .2);
}
.cz-b-step { position: relative; }
.cz-b-step::before {
	content: "";
	position: absolute;
	left: calc(-1 * var(--czb-rail));
	top: 9px;
	width: 12px; height: 12px;
	border-radius: 50%;
	background: var(--czb-rust);
}
.cz-b-step-h {
	margin: 0;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: .5em;
	align-items: baseline;
}
.cz-b-step-n { font-family: Raleway, sans-serif; color: var(--czb-rust); }
.cz-b-step-b { margin: clamp(6px, 1.6vw, 10px) 0 0; max-width: min(56ch, 100%); }

/* ---------- press cards ---------- */

.cz-b-press-grid { gap: clamp(14px, 2vw, 24px); }
.cz-b-press-card { height: 100%; }
.cz-b-press-ph { margin: 0 0 clamp(12px, 2vw, 18px); overflow: hidden; border-radius: 10px; }
.cz-b-press-ph img { width: 100%; height: auto; display: block; transition: scale .6s var(--czb-ease); }
.cz-b-press-card h3 { margin: 0 0 .3em; }
.cz-b-press-card p { margin: 0; }

@media (hover: hover) and (pointer: fine) {
	.cz-b-press-card:hover .cz-b-press-ph img { scale: 1.05; }
}

/* ---------- team ---------- */

/* auto-fit, so adding or removing a person never leaves a broken row */
.cz-b-people {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: clamp(20px, 3vw, 36px);
	margin-top: clamp(24px, 4vw, 44px);
}
.cz-b-person-ph { margin: 0 0 12px; }
.cz-b-person-ph img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.cz-b-person-n, .cz-b-person-r { margin: 0; line-height: 1.3; }
.cz-b-person-r { margin-top: 2px; }

/* ---------- vision / mission / values ---------- */

.cz-b-vmv h2 { margin-bottom: .2em; }
.cz-b-vmv-p { max-width: min(42ch, 100%); margin-inline: auto; }
.cz-b-values {
	list-style: none;
	padding: 0;
	text-align: center;
	line-height: 1.9;
}

/* ---------- ticked list ---------- */

.cz-b-ticklist {
	list-style: none;
	padding: 0;
	max-width: min(52ch, 100%);
	margin: clamp(20px, 3vw, 32px) auto 0;
	display: grid;
	gap: clamp(8px, 1.6vw, 14px);
}
.cz-b-ticklist li {
	position: relative;
	padding-left: 2em;
	line-height: 1.45;
}
/* the tick is drawn, not an image, so it takes the text colour */
.cz-b-ticklist li::before {
	content: "";
	position: absolute;
	left: .25em; top: .34em;
	width: .6em; height: .95em;
	border: solid var(--czb-rust);
	border-width: 0 2.5px 2.5px 0;
	rotate: 45deg;
}

/* ---------- questions ---------- */

.cz-b-faq-item {
	border-bottom: 1px solid rgba(87, 51, 13, .18);
	padding: clamp(12px, 2vw, 18px) 0;
	max-width: min(62ch, 100%);
	margin-inline: auto;
}
.cz-b-faq-item summary {
	cursor: pointer;
	font-family: Raleway, sans-serif;
	font-weight: 600;
	color: var(--czb-brown);
	font-size: clamp(16px, 2vw, 19px);
	list-style-position: outside;
}
.cz-b-faq-item p { margin: .7em 0 0; }

/* ---------- quote ---------- */

.cz-b-quote-q {
	max-width: min(26ch, 100%);
	margin-inline: auto;
	font-family: Raleway, sans-serif;
	line-height: 1.25;
}

/* ---------- catalogue cards ---------- */

.cz-b-cat-grid { gap: clamp(14px, 2vw, 26px); }
.cz-b-cat-card { height: 100%; }
.cz-b-cat-card .wp-block-image { margin: 0 0 clamp(10px, 2vw, 16px); }
.cz-b-cat-card img { width: 100%; height: auto; display: block; }
.cz-b-cat-card p { margin: 0; }

/* ---------- phones ---------- */

@media (max-width: 781px) {
	/* core stacks columns here; the photo leads in every split section */
	.cz-b-hero2, .cz-b-ov { flex-direction: column; }
	.cz-b-hero2-ph img, .cz-b-ov-ph img { aspect-ratio: 16 / 10; }
	.cz-b-ov-ph { order: -1; }

	.cz-b-people { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
	.cz-b-yr-row strong { font-size: clamp(20px, 6vw, 28px); }
}
