/*
Theme Name: Music for the Many
Theme URI: https://music4themany.com/
Author: Music for the Many
Description: Block theme for Music for the Many — equal musical opportunities for our children. Registered Charity no. 1185526.
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
Version: 1.22.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: music-for-the-many
Tags: full-site-editing, block-patterns, block-themes, education, charity
*/

/* Poster energy: hard edges, huge type, yellow + red. Banners full-bleed; copy in container. */

:root {
	--m4tm-wide: var(--wp--style--global--wide-size, 72rem);
	--m4tm-gutter: var(--wp--preset--spacing--50, 2rem);
	--m4tm-header-bar: 3.1rem;
	--m4tm-logo-size: clamp(4.75rem, 10vw, 6.25rem);
	--m4tm-measure: 55ch;
	--m4tm-pink: #ffb8ba;
	--m4tm-on-dark: var(--wp--preset--color--paper, #fffbed);
}

/* ===== BASE ===== */

body {
	background-color: var(--wp--preset--color--paper, #fffbed);
}

h1,
h2,
h3,
h4,
.wp-block-post-title,
.wp-block-query-title {
	text-wrap: balance;
	letter-spacing: -0.02em;
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif);
	font-weight: 600;
}

h1.wp-block-heading,
h2.wp-block-heading {
	line-height: 0.95;
	text-transform: lowercase;
}

/* ===== HEADER ===== */

.m4tm-header {
	background: var(--wp--preset--color--paper, #fffbed);
	border-bottom: 5px solid var(--wp--preset--color--ink, #130e0f);
	position: sticky;
	top: 0;
	z-index: 300;
	overflow: visible;
	padding-block: 0.35rem !important;
	min-height: var(--m4tm-header-bar);
}

.m4tm-header .wp-block-group,
.m4tm-header .wp-block-navigation,
.m4tm-header .wp-block-navigation__container {
	overflow: visible;
}

.m4tm-header > .wp-block-group.alignwide {
	align-items: center;
	min-height: 2.4rem;
}

.m4tm-logo-link {
	display: block;
	position: relative;
	z-index: 2;
	flex-shrink: 0;
	width: var(--m4tm-logo-size);
	height: 2.4rem;
	overflow: visible;
	line-height: 0;
	text-decoration: none;
}

.m4tm-logo {
	display: block;
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	width: var(--m4tm-logo-size);
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border: 3px solid var(--wp--preset--color--ink, #130e0f);
	box-shadow: 3px 3px 0 var(--wp--preset--color--red, #a53032);
}

.m4tm-header .wp-block-navigation {
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif);
	font-size: clamp(0.9rem, 1.35vw, 1.05rem);
	font-weight: 600;
	letter-spacing: 0.01em;
	z-index: 301;
}

.m4tm-header .wp-block-navigation-item__content {
	font-family: inherit;
	font-weight: inherit;
}

.m4tm-header .wp-block-navigation a {
	color: var(--wp--preset--color--ink, #130e0f) !important;
	text-decoration: none;
	padding: 0.15rem 0;
	border-bottom: 3px solid transparent;
}

.m4tm-header .wp-block-navigation a:hover,
.m4tm-header .wp-block-navigation .current-menu-item > a,
.m4tm-header .wp-block-navigation .current-menu-ancestor > a {
	color: var(--wp--preset--color--red, #a53032) !important;
	border-bottom-color: var(--wp--preset--color--red, #a53032);
}

.m4tm-header .wp-block-navigation__submenu-container {
	background: var(--wp--preset--color--ink, #130e0f) !important;
	border: 3px solid var(--wp--preset--color--paper, #fffbed) !important;
	border-radius: 0 !important;
	box-shadow: 6px 6px 0 var(--wp--preset--color--red, #a53032);
	padding: 0.5rem !important;
	z-index: 400 !important;
}

.m4tm-header .wp-block-navigation__submenu-container a {
	color: var(--wp--preset--color--paper, #fffbed) !important;
}

.m4tm-header .wp-block-navigation__submenu-container a:hover {
	color: var(--wp--preset--color--yellow, #edc032) !important;
	border-bottom-color: var(--wp--preset--color--yellow, #edc032);
}

/* Logged-in editors: sit below the admin bar instead of under it. */
.admin-bar .m4tm-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .m4tm-header {
		top: 46px;
	}
}

/* ----- Mobile overlay menu -----
   Core resets the dropdown background inside the open overlay, so the dark
   submenu styling above must not apply there: paper panel, ink text, left
   aligned, children indented under a red rule. */

.m4tm-header .wp-block-navigation__responsive-container-open,
.m4tm-header .wp-block-navigation__responsive-container-close {
	color: var(--wp--preset--color--ink, #130e0f) !important;
}

.m4tm-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--paper, #fffbed) !important;
	color: var(--wp--preset--color--ink, #130e0f) !important;
	padding: 4.5rem var(--m4tm-gutter, 2rem) 2rem !important;
	font-size: 1.15rem;
}

.m4tm-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.m4tm-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: flex-start !important;
	justify-content: flex-start !important;
	text-align: left;
	gap: 0.85rem;
}

.m4tm-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	width: 100%;
	align-items: flex-start;
}

.m4tm-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 1.35rem;
	font-weight: 600;
}

.m4tm-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	position: static !important;
	width: 100% !important;
	margin: 0.5rem 0 0.75rem !important;
	padding: 0.15rem 0 0.15rem 1rem !important;
	background: transparent !important;
	border: 0 !important;
	border-left: 4px solid var(--wp--preset--color--red, #a53032) !important;
	box-shadow: none !important;
	gap: 0.45rem;
}

.m4tm-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	font-size: 1.1rem;
	font-weight: 500;
}

.m4tm-header .wp-block-navigation__responsive-container.is-menu-open a,
.m4tm-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container a {
	color: var(--wp--preset--color--ink, #130e0f) !important;
	border-bottom-color: transparent;
}

.m4tm-header .wp-block-navigation__responsive-container.is-menu-open a:hover,
.m4tm-header .wp-block-navigation__responsive-container.is-menu-open .current-menu-item > a,
.m4tm-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container a:hover {
	color: var(--wp--preset--color--red, #a53032) !important;
	border-bottom-color: var(--wp--preset--color--red, #a53032);
}

.m4tm-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-icon {
	display: none;
}

/* ===== HERO ===== */

.m4tm-hero {
	--m4tm-hero-gradient: linear-gradient(
		115deg,
		rgb(10 8 8 / 0.92) 0%,
		rgb(19 14 15 / 0.72) 40%,
		rgb(165 48 50 / 0.25) 70%,
		rgb(255 251 237 / 0.12) 100%
	);
	position: relative;
	z-index: 1;
	min-height: 100svh;
	margin-top: calc(-1 * var(--m4tm-header-bar));
	display: grid;
	align-items: end;
	color: var(--wp--preset--color--yellow, #edc032);
	background-color: var(--wp--preset--color--ink, #130e0f);
	background-image: var(--m4tm-hero-gradient), var(--m4tm-hero, none);
	background-size: cover;
	background-position: 40% center;
	border-bottom: 5px solid var(--wp--preset--color--yellow, #edc032);
}

/* Home: the photo is a real <img> (the Home page’s featured image). It is
   taken out of flow and clipped to the hero, so the hero stays viewport
   height whatever size the image is; the gradient and copy stack on top. */
.m4tm-hero:has(> .m4tm-hero__photo) {
	overflow: hidden;
	background-image: none;
	isolation: isolate;
}

.m4tm-hero > .m4tm-hero__photo,
.m4tm-hero:has(> .m4tm-hero__photo)::before {
	position: absolute;
	inset: 0;
	margin: 0 !important;
	max-width: none !important;
	pointer-events: none;
}

.m4tm-hero > .m4tm-hero__photo {
	z-index: 0;
	overflow: hidden;
}

.m4tm-hero > .m4tm-hero__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 40% center;
	border: 0;
	border-radius: 0;
}

.m4tm-hero:has(> .m4tm-hero__photo)::before {
	content: "";
	z-index: 1;
	background-image: var(--m4tm-hero-gradient);
}

.m4tm-hero:has(> .m4tm-hero__photo) > .m4tm-hero__inner {
	position: relative;
	z-index: 2;
}

.m4tm-photo-hero {
	min-height: min(48svh, 26rem);
	width: 100vw;
	max-width: 100vw !important;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.m4tm-hero__inner {
	width: 100%;
	max-width: var(--m4tm-wide);
	justify-self: center;
	/* Breathing room under the buttons, whatever the template's inline padding says. */
	padding-top: clamp(3.5rem, 9vh, 6rem) !important;
	padding-bottom: clamp(3.5rem, 9vh, 6rem) !important;
}

.m4tm-hero__eyebrow {
	display: inline-block;
	margin: 0 0 0.85rem;
	padding: 0.35rem 0.7rem;
	background: var(--wp--preset--color--paper, #fffbed);
	color: var(--wp--preset--color--ink, #130e0f) !important;
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif);
	font-size: clamp(1rem, 2vw, 1.25rem);
	font-weight: 600;
	line-height: 1;
	text-transform: lowercase;
	border: 3px solid var(--wp--preset--color--ink, #130e0f);
	box-shadow: 4px 4px 0 var(--wp--preset--color--red, #a53032);
}

.m4tm-hero__title,
.m4tm-photo-hero .wp-block-post-title,
.m4tm-page-hero .wp-block-post-title {
	margin: 0 !important;
	max-width: 16ch;
	color: var(--wp--preset--color--yellow, #edc032) !important;
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif) !important;
	font-weight: 600 !important;
	line-height: 0.9 !important;
	letter-spacing: -0.03em;
	text-align: left !important;
	text-transform: lowercase;
	text-shadow:
		4px 4px 0 var(--wp--preset--color--red, #a53032),
		7px 7px 0 rgb(0 0 0 / 0.3);
}

.m4tm-hero__title {
	font-size: clamp(2.75rem, 8vw, 5.75rem) !important;
}

.m4tm-photo-hero .m4tm-hero__title,
.m4tm-photo-hero .wp-block-post-title {
	max-width: 22ch;
	font-size: clamp(2.25rem, 6vw, 4.25rem) !important;
}

/* Inner pages default to a title strip. Photo is opt-in (Photo hero template). */
.m4tm-page-title,
.m4tm-hero.m4tm-page-hero {
	min-height: 0;
	margin-top: 0;
	display: block;
	color: inherit;
	background-color: var(--wp--preset--color--paper, #fffbed);
	background-image: none;
}

.m4tm-hero.m4tm-page-hero {
	border-bottom: 5px solid var(--wp--preset--color--ink, #130e0f);
}

.m4tm-page-title,
.m4tm-page-title.wp-block-group,
.m4tm-page-title .m4tm-page-title__inner {
	border: 0 !important;
	box-shadow: none !important;
}

.m4tm-page-title + .wp-block-separator,
.m4tm-page-title + hr {
	display: none !important;
}

.m4tm-page-title__inner {
	max-width: var(--m4tm-wide, 72rem);
	margin-inline: auto;
	padding-top: calc(var(--m4tm-logo-size) - 1.5rem + var(--wp--preset--spacing--40, 1.25rem)) !important;
}

.m4tm-page-title .wp-block-post-title,
.m4tm-page-title .wp-block-heading,
.m4tm-page-title .wp-block-query-title,
.m4tm-hero.m4tm-page-hero .m4tm-hero__title,
.m4tm-hero.m4tm-page-hero .wp-block-post-title,
.m4tm-hero.m4tm-page-hero .wp-block-heading,
.m4tm-hero.m4tm-page-hero .wp-block-query-title {
	margin: 0 !important;
	max-width: 22ch;
	color: var(--wp--preset--color--red, #a53032) !important;
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif) !important;
	font-weight: 600 !important;
	font-size: clamp(2.25rem, 6vw, 4.25rem) !important;
	line-height: 0.9 !important;
	letter-spacing: -0.03em;
	text-align: left !important;
	text-transform: lowercase;
	text-shadow: none;
}

.m4tm-hero__lede {
	margin: 1.25rem 0 0 !important;
	max-width: 38ch;
	color: var(--wp--preset--color--paper, #fffbed) !important;
	font-size: clamp(1.05rem, 2vw, 1.25rem) !important;
	line-height: 1.45;
	font-weight: 600;
}

.m4tm-hero__actions {
	margin-top: 1.75rem !important;
	gap: 0.85rem !important;
}

/* ===== FULL-WIDTH BANDS (text stays constrained) ===== */

.m4tm-band,
.m4tm-panel--yellow,
.m4tm-panel--ink,
.m4tm-band--yellow,
.m4tm-band--red {
	width: 100%;
	max-width: none;
}

.m4tm-band--ink,
.m4tm-panel--ink {
	background: var(--wp--preset--color--ink, #130e0f);
	color: var(--wp--preset--color--paper, #fffbed);
	border-block: 5px solid var(--wp--preset--color--yellow, #edc032);
}

.m4tm-band--ink p,
.m4tm-band--ink a,
.m4tm-panel--ink p,
.m4tm-panel--ink a {
	color: var(--wp--preset--color--paper, #fffbed) !important;
}

.m4tm-panel--yellow,
.m4tm-band--yellow {
	background: var(--wp--preset--color--yellow, #edc032);
	color: var(--wp--preset--color--ink, #130e0f);
	border-block: 5px solid var(--wp--preset--color--red, #a53032);
	box-shadow: none;
	border-inline: 0;
	border-radius: 0;
}

.m4tm-panel--yellow .wp-block-heading,
.m4tm-band--yellow .wp-block-heading {
	color: var(--wp--preset--color--red, #a53032) !important;
	font-weight: 600 !important;
	font-size: clamp(1.75rem, 4vw, 2.6rem) !important;
	line-height: 0.95 !important;
}

.m4tm-band--yellow p,
.m4tm-band--yellow a {
	color: var(--wp--preset--color--ink, #130e0f) !important;
}

.m4tm-band--red {
	background: var(--wp--preset--color--red, #a53032);
	color: var(--wp--preset--color--paper, #fffbed);
	border-block: 5px solid var(--wp--preset--color--ink, #130e0f);
}

.m4tm-band--red .wp-block-heading {
	color: var(--wp--preset--color--yellow, #edc032) !important;
	font-size: clamp(1.75rem, 4vw, 2.6rem) !important;
	line-height: 0.95 !important;
	text-align: left !important;
	margin-left: 0 !important;
}

.m4tm-band--red p,
.m4tm-band--red a {
	color: var(--wp--preset--color--paper, #fffbed) !important;
}

.m4tm-band--ink .wp-block-heading,
.m4tm-panel--ink .wp-block-heading {
	color: var(--wp--preset--color--yellow, #edc032) !important;
	text-align: left !important;
	margin-left: 0 !important;
}

/* ===== PAGE BODY / MEASURE ===== */

.m4tm-page-no-title {
	padding-top: calc(var(--m4tm-header-bar) + 5rem) !important;
}

.wp-block-post-content > p,
.wp-block-post-content > ul,
.wp-block-post-content > ol,
.wp-block-post-content > hr,
.m4tm-page-body > .wp-block-group > p,
.m4tm-page-body > .wp-block-group > ul,
.m4tm-page-body > .wp-block-group > ol {
	max-width: var(--m4tm-measure);
}

/* ===== BUTTONS ===== */

.m4tm-button .wp-block-button__link,
.wp-block-button__link,
.wp-block-file .wp-block-file__button {
	display: inline-block;
	padding: 0.95rem 1.6rem !important;
	background: var(--wp--preset--color--paper, #fffbed) !important;
	color: var(--wp--preset--color--ink, #130e0f) !important;
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif) !important;
	font-weight: 500 !important;
	font-size: clamp(1.05rem, 1.8vw, 1.25rem) !important;
	letter-spacing: 0;
	text-decoration: none !important;
	text-transform: lowercase;
	border-radius: 0 !important;
	border: 3px solid var(--wp--preset--color--ink, #130e0f) !important;
	box-shadow: 5px 5px 0 var(--wp--preset--color--red, #a53032);
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.m4tm-button .wp-block-button__link:hover,
.wp-block-button__link:hover,
.wp-block-file .wp-block-file__button:hover {
	transform: translate(-2px, -2px);
	box-shadow: 7px 7px 0 var(--wp--preset--color--red, #a53032);
	background: var(--wp--preset--color--white, #fff) !important;
}

.m4tm-band--ink .wp-block-button__link,
.m4tm-panel--ink .wp-block-button__link {
	box-shadow: 5px 5px 0 var(--m4tm-pink, #ffb8ba);
}

.m4tm-band--ink .wp-block-button__link:hover,
.m4tm-panel--ink .wp-block-button__link:hover {
	box-shadow: 7px 7px 0 var(--wp--preset--color--red, #a53032);
}

.m4tm-band--red .wp-block-button__link {
	box-shadow: 5px 5px 0 var(--wp--preset--color--yellow, #edc032);
}

.m4tm-band--red .wp-block-button__link:hover {
	box-shadow: 7px 7px 0 var(--wp--preset--color--yellow, #edc032);
}

/* Secondary on dark hero — solid yellow so it stays readable */
.m4tm-button--on-dark .wp-block-button__link {
	background: var(--wp--preset--color--paper, #fffbed) !important;
	color: var(--wp--preset--color--ink, #130e0f) !important;
	border-color: var(--wp--preset--color--ink, #130e0f) !important;
}

/* ===== CARDS ===== */

.m4tm-card,
.m4tm-project-card,
.m4tm-team-card {
	height: 100%;
	background: transparent;
	border: 3px solid var(--wp--preset--color--ink, #130e0f);
	border-radius: 0;
	box-shadow: 6px 6px 0 var(--m4tm-pink, #ffb8ba);
	padding: 1rem;
	overflow: hidden;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.m4tm-card:hover,
.m4tm-project-card:hover,
.m4tm-team-card:hover {
	transform: translate(-3px, -3px);
	box-shadow: 9px 9px 0 var(--wp--preset--color--red, #a53032);
}

.m4tm-project-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: var(--wp--preset--spacing--40, 1.25rem);
	row-gap: var(--wp--preset--spacing--60, 3rem);
}

.m4tm-project-card {
	padding: 0 0 1rem;
	background: var(--wp--preset--color--paper, #fffbed);
}

.m4tm-project-card p:last-child {
	margin-bottom: 0;
	padding-bottom: 0.25rem;
}

.m4tm-project-card h3,
.m4tm-project-card p {
	padding-inline: 1rem;
}

.m4tm-project-card__media,
.m4tm-card .wp-block-post-featured-image,
.wp-block-post-template .wp-block-post-featured-image {
	aspect-ratio: 4 / 3;
	margin: 0 0 0.75rem;
	overflow: hidden;
	border: 0;
	border-radius: 0;
	background: var(--wp--preset--color--ink, #130e0f);
}

.m4tm-project-card__media a,
.m4tm-card .wp-block-post-featured-image a,
.wp-block-post-template .wp-block-post-featured-image a {
	display: block;
	height: 100%;
}

.m4tm-project-card__media img,
.m4tm-card .wp-block-post-featured-image img,
.wp-block-post-template .wp-block-post-featured-image img,
.m4tm-project-card img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	object-position: center;
	border: 0;
	border-radius: 0;
}

.m4tm-card .wp-block-post-featured-image:not(:has(img)) {
	display: none;
}

.m4tm-team-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40, 1.25rem);
}

@media (min-width: 782px) {
	.m4tm-team-grid {
		grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
	}
}

.m4tm-team-card {
	height: auto;
	aspect-ratio: 1;
	align-self: start;
	min-width: 0;
	padding: 0.85rem;
}

.m4tm-team-card__link {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 0.4rem;
	width: 100%;
	height: 100%;
	min-width: 0;
	color: var(--wp--preset--color--ink, #130e0f);
	text-decoration: none;
}

.m4tm-team-card__photo {
	flex: 0 0 auto;
	align-self: center;
	width: 58%;
	aspect-ratio: 1;
	margin: 0;
	overflow: hidden;
	border-radius: 50%;
	border: 3px solid var(--wp--preset--color--ink, #130e0f);
	background: var(--wp--preset--color--yellow-soft, #fffbed);
}

.m4tm-team-card__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	border-radius: 0;
}

.m4tm-team-card h3 {
	margin: 0;
	max-width: 100%;
	font-size: clamp(1.05rem, 2.2vw, 1.35rem);
	line-height: 1.1;
	text-align: left;
	text-wrap: balance;
	color: var(--wp--preset--color--red, #a53032);
}

.m4tm-team-card p {
	margin: 0;
	max-width: 100%;
	flex: 1 1 auto;
	min-height: 0;
	font-size: 0.85rem;
	line-height: 1.3;
	text-align: left;
	color: var(--wp--preset--color--ink, #130e0f);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ===== TEAM PORTRAIT ===== */

.m4tm-team-portrait {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) minmax(12rem, 20rem);
	gap: var(--wp--preset--spacing--60, 3rem) var(--wp--preset--spacing--50, 2rem);
	align-items: start;
}

.m4tm-team-portrait__photo,
.m4tm-team-portrait .wp-block-post-featured-image {
	position: sticky;
	top: calc(var(--m4tm-header-bar) + 1.25rem);
	width: 100%;
	max-width: 20rem;
	margin: 0;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 50%;
	border: 3px solid var(--wp--preset--color--ink, #130e0f);
	background: var(--wp--preset--color--yellow, #edc032);
	box-shadow: 6px 6px 0 var(--wp--preset--color--red, #a53032);
}

.m4tm-team-portrait .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	border-radius: 0;
}

.m4tm-team-portrait:not(:has(img)) {
	grid-template-columns: minmax(0, 1fr);
}

/* ===== HUB LINK TILES ===== */

.m4tm-masonry,
.m4tm-hub {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40, 1.25rem);
}

.m4tm-hub--help {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.m4tm-link-tile,
a.m4tm-link-tile {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 0.5rem;
	min-height: 11rem;
	padding: 1.5rem 1.6rem;
	background: var(--wp--preset--color--yellow, #edc032);
	color: var(--wp--preset--color--ink, #130e0f);
	text-decoration: none !important;
	border: 3px solid var(--wp--preset--color--ink, #130e0f);
	border-radius: 0;
	box-shadow: 6px 6px 0 var(--wp--preset--color--red, #a53032);
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.m4tm-link-tile:hover,
a.m4tm-link-tile:hover {
	transform: translate(-3px, -3px);
	box-shadow: 9px 9px 0 var(--wp--preset--color--red, #a53032);
}

.m4tm-link-tile .wp-block-heading,
.m4tm-link-tile h2,
.m4tm-link-tile h3 {
	margin: 0 !important;
	color: var(--wp--preset--color--red, #a53032) !important;
	font-weight: 600 !important;
	font-size: clamp(1.6rem, 3.5vw, 2.35rem) !important;
	line-height: 0.95 !important;
	text-transform: lowercase;
}

.m4tm-link-tile p {
	margin: 0;
	max-width: none;
	color: var(--wp--preset--color--ink, #130e0f) !important;
	font-size: 1.05rem;
	line-height: 1.4;
}

.m4tm-link-tile--lg {
	grid-column: 1 / -1;
	min-height: 16rem;
}

.m4tm-link-tile--schools {
	grid-column: 1 / -1;
	min-height: 18rem;
	background: var(--wp--preset--color--red, #a53032);
	border-color: var(--wp--preset--color--ink, #130e0f);
	box-shadow: 6px 6px 0 var(--wp--preset--color--ink, #130e0f);
}

.m4tm-link-tile--schools .wp-block-heading,
.m4tm-link-tile--schools h2 {
	color: var(--wp--preset--color--yellow, #edc032) !important;
	font-size: clamp(2.1rem, 5vw, 3.5rem) !important;
}

.m4tm-link-tile--schools p {
	color: var(--wp--preset--color--paper, #fffbed) !important;
	max-width: 36ch;
}

.m4tm-archive-hero {
	min-height: min(48svh, 26rem);
}

.m4tm-archive-hero .m4tm-hero__title,
.m4tm-archive-hero .wp-block-query-title,
.m4tm-archive-hero .wp-block-heading {
	max-width: 22ch;
}

[data-project-group="past"] {
	margin-top: var(--wp--preset--spacing--70, 4.5rem);
}

[data-project-group="past"] > h2 {
	margin-block: 0 var(--wp--preset--spacing--50, 2rem);
}

/* ===== FEATURED EVENT ===== */

.m4tm-event-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	margin-top: var(--wp--preset--spacing--50, 2rem);
	max-width: var(--m4tm-wide, 72rem);
	background: var(--wp--preset--color--paper, #fffbed);
	color: var(--wp--preset--color--ink, #130e0f);
	border: 3px solid var(--wp--preset--color--ink, #130e0f);
	box-shadow: 6px 6px 0 var(--wp--preset--color--red, #a53032);
	overflow: hidden;
}

.m4tm-event-card.has-photo {
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.m4tm-event-card__media {
	display: block;
	min-height: 14rem;
	background: var(--wp--preset--color--ink, #130e0f);
}

.m4tm-event-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	border-radius: 0;
}

.m4tm-event-card__body {
	padding: 1.5rem 1.75rem 1.75rem;
}

.m4tm-event-card__body > * {
	max-width: var(--m4tm-measure);
}

.m4tm-event-card__eyebrow {
	display: inline-block;
	margin: 0 0 0.85rem !important;
	padding: 0.3rem 0.6rem;
	background: var(--wp--preset--color--yellow, #edc032);
	color: var(--wp--preset--color--ink, #130e0f) !important;
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif);
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1;
	text-transform: lowercase;
	border: 3px solid var(--wp--preset--color--ink, #130e0f);
}

.m4tm-event-card__date {
	margin: 0 !important;
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif);
	font-weight: 600;
	color: var(--wp--preset--color--red, #a53032) !important;
}

.m4tm-event-card__title {
	margin: 0.25rem 0 0.5rem !important;
	font-size: clamp(1.6rem, 3.5vw, 2.35rem) !important;
	line-height: 0.95 !important;
	text-transform: lowercase;
}

.m4tm-event-card__title a {
	color: var(--wp--preset--color--ink, #130e0f) !important;
	text-decoration: none;
}

.m4tm-event-card__title a:hover {
	color: var(--wp--preset--color--red, #a53032) !important;
}

.m4tm-event-card__venue {
	margin: 0 0 0.75rem !important;
	font-weight: 600;
}

.m4tm-event-card__excerpt {
	margin: 0 0 1.25rem !important;
}

.m4tm-event-card .wp-block-buttons {
	margin: 0;
}

/* Yellow band on Home: the card is paper on yellow. */
.m4tm-band--yellow .m4tm-event-card p,
.m4tm-band--yellow .m4tm-event-card a {
	color: inherit;
}

.m4tm-whats-on-lead {
	padding-bottom: var(--wp--preset--spacing--50, 2rem);
}

.m4tm-whats-on-lead > .wp-block-group {
	max-width: var(--m4tm-wide, 72rem);
	margin-inline: auto;
}

.m4tm-whats-on-intro > p,
.m4tm-whats-on-intro > ul,
.m4tm-whats-on-intro > ol {
	max-width: var(--m4tm-measure);
}

/* ===== SITEMAP ===== */

.m4tm-sitemap {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: var(--wp--preset--spacing--50, 2rem) var(--wp--preset--spacing--60, 3rem);
	margin-top: var(--wp--preset--spacing--50, 2rem);
}

.m4tm-sitemap__section h2 {
	margin: 0 0 0.75rem;
	font-size: clamp(1.6rem, 3vw, 2rem) !important;
}

.m4tm-sitemap ul {
	margin: 0;
	padding-left: 1.1rem;
}

.m4tm-sitemap li {
	margin-block: 0.3rem;
}

.m4tm-sitemap ul ul {
	margin-top: 0.3rem;
}

/* ===== QUOTE / FOOTER ===== */

.wp-block-quote,
.wp-block-quote.is-style-plain,
.wp-block-quote.alignwide,
.wp-block-quote.alignfull {
	border: 3px solid var(--wp--preset--color--ink, #130e0f);
	border-left-width: 0.85rem;
	background: var(--wp--preset--color--paper, #fffbed);
	border-radius: 0;
	padding: 1.5rem 1.75rem;
	width: 100%;
	max-width: var(--m4tm-measure) !important;
	box-sizing: border-box;
	margin-inline: 0 auto !important;
	font-size: clamp(1.2rem, 2.5vw, 1.55rem);
	font-weight: 700;
	box-shadow: 6px 6px 0 var(--wp--preset--color--red, #a53032);
}

.wp-block-quote p,
.wp-block-quote cite {
	max-width: var(--m4tm-measure);
}

.m4tm-testimonial,
.wp-block-group:has(> .m4tm-testimonial),
.m4tm-card:has(.m4tm-testimonial),
.m4tm-card:has(.wp-block-quote) {
	border: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
}

.m4tm-testimonial {
	max-width: var(--m4tm-wide, 72rem);
	margin-inline: auto;
	padding-inline: 0 !important;
	box-sizing: border-box;
}

.m4tm-testimonial.alignwide,
.m4tm-testimonial.alignfull {
	width: 100% !important;
	max-width: var(--m4tm-wide, 72rem) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.m4tm-testimonial .wp-block-quote,
.m4tm-card .wp-block-quote {
	margin-inline: 0 auto;
	max-width: var(--m4tm-measure);
}

.wp-block-quote cite {
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif);
	font-style: normal;
	font-weight: 500;
	color: var(--wp--preset--color--red, #a53032);
	font-size: 1.25rem;
}

.m4tm-footer {
	background: var(--wp--preset--color--ink, #130e0f);
	color: var(--wp--preset--color--paper, #fffbed);
	border-top: 5px solid var(--wp--preset--color--yellow, #edc032) !important;
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif);
}

.m4tm-footer,
.m4tm-footer p,
.m4tm-footer a,
.m4tm-footer li,
.m4tm-footer .wp-block-heading {
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif) !important;
}

.m4tm-footer,
.m4tm-footer p,
.m4tm-footer a,
.m4tm-footer li {
	color: var(--wp--preset--color--paper, #fffbed) !important;
}

.m4tm-footer .wp-block-heading {
	color: var(--wp--preset--color--yellow, #edc032) !important;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
}

.m4tm-footer a:hover {
	color: var(--wp--preset--color--yellow, #edc032) !important;
}

.m4tm-footer-links {
	list-style: none;
	padding-left: 0;
	margin: 0;
}

.m4tm-footer-links li {
	margin-block: 0.4rem;
}

.m4tm-footer-links a {
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none;
	border-bottom: 2px solid transparent;
}

.m4tm-footer-links a:hover {
	border-bottom-color: var(--wp--preset--color--yellow, #edc032);
}

main .wp-block-heading:not(.m4tm-hero__title) {
	font-size: clamp(2rem, 5vw, 3.25rem);
}

@media (max-width: 781px) {
	:root {
		--m4tm-logo-size: 4.25rem;
	}

	.m4tm-logo-link,
	.m4tm-logo {
		width: var(--m4tm-logo-size);
	}

	.m4tm-hero__title,
	.m4tm-photo-hero .wp-block-post-title {
		text-shadow:
			3px 3px 0 var(--wp--preset--color--red, #a53032),
			5px 5px 0 rgb(0 0 0 / 0.3);
	}

	.wp-block-post-template.is-layout-grid,
	.m4tm-project-grid,
	.m4tm-masonry,
	.m4tm-hub,
	.m4tm-hub--help,
	.m4tm-team-portrait {
		grid-template-columns: 1fr !important;
	}

	.m4tm-team-portrait__photo,
	.m4tm-team-portrait .wp-block-post-featured-image {
		display: none;
	}

	.m4tm-link-tile--lg,
	.m4tm-link-tile--schools {
		grid-column: auto;
	}

	.m4tm-event-card.has-photo {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.m4tm-button .wp-block-button__link,
	.wp-block-button__link,
	.m4tm-card,
	.m4tm-project-card,
	.m4tm-team-card,
	.m4tm-link-tile,
	a.m4tm-link-tile {
		transition: none;
	}
}

/* ===== HELP GUIDES (logged-in editors only) ===== */

.m4tm-help__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 18rem;
	gap: var(--wp--preset--spacing--60, 3rem) var(--wp--preset--spacing--70, 4.5rem);
	align-items: start;
}

.m4tm-help__body .wp-block-post-content > * {
	max-width: var(--m4tm-measure);
}

.m4tm-help__body h2 {
	margin-top: 2rem;
}

.m4tm-help__body ol li,
.m4tm-help__body ul li {
	margin-block: 0.4rem;
}

.m4tm-help__nav {
	position: sticky;
	top: calc(var(--m4tm-header-bar) + 1.5rem);
	padding: 1.25rem 1.5rem;
	border: 3px solid var(--wp--preset--color--ink, #130e0f);
	box-shadow: 6px 6px 0 var(--m4tm-pink, #ffb8ba);
}

.m4tm-help__nav h2 {
	margin: 0 0 0.75rem;
	font-size: 1.25rem !important;
}

.m4tm-guides {
	margin: 0;
	padding-left: 1.4rem;
}

.m4tm-guides li {
	margin-block: 0.5rem;
}

.m4tm-guides li.current > a {
	color: var(--wp--preset--color--ink, #130e0f);
	font-weight: 700;
	text-decoration: none;
}

.m4tm-guides__when {
	display: block;
	font-size: 0.9rem;
	color: var(--wp--preset--color--ink-muted, #5c3a3c);
}

.m4tm-help__nav .m4tm-guides__when {
	display: none;
}

@media (max-width: 781px) {
	.m4tm-help__layout {
		grid-template-columns: 1fr;
	}

	.m4tm-help__nav {
		position: static;
	}
}
