/* Middlemarch Explore Menu - OffGROUND */

:root {
	--mm-navy: #1a2552;
	--mm-navy-deep: #131b36;
	--mm-sand: #d3c8ac;
	--mm-cream: #f5f4ef;
	--mm-line: rgba(211, 200, 172, 0.28);
	--mm-serif: "Libertinus Serif", Georgia, "Times New Roman", serif;
	--mm-sans: "Libertinus Sans", "Helvetica Neue", Arial, sans-serif;
	--mm-gutter: max(16px, min(4.2vw, 60px));
	--mm-admin: 0px;
	--mm-ease: cubic-bezier(0.76, 0, 0.24, 1);
}

body.admin-bar { --mm-admin: 32px; }
@media (max-width: 782px) { body.admin-bar { --mm-admin: 46px; } }

/* ---------- Theme header replaced by the plugin header (all pages) ---------- */
#header { display: none !important; }

/* shared sizing so the header, the popup top bar and the hero line up */
:root {
	--mm-bar-pad: max(18px, min(3.4vw, 40px));
	--mm-bar-logo: max(150px, min(19vw, 280px));
	--mm-hpad: max(20px, min(5.5vh, 56px)); /* homepage hero top/bottom padding */
}

/* ---------- Header on all pages except the homepage ---------- */
.mm-site-header {
	position: relative;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: var(--mm-bar-pad) var(--mm-gutter);
	background: var(--mm-navy);
	color: #fff;
	border-bottom: 1px solid rgba(211, 200, 172, 0.18);
}
.mm-site-header__logo { display: block; flex: none; width: var(--mm-bar-logo); line-height: 0; }
.mm-site-header__logo img { display: block; width: 100%; height: auto; }
.mm-site-header__logo:focus-visible { outline: 1px solid var(--mm-sand); outline-offset: 8px; }

/* ---------- Explore button (hero + popup close share this) ---------- */
.mm-explore-btn {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 10px 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff;
	font-family: var(--mm-sans);
	font-size: 15px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.mm-explore-btn:hover,
.mm-explore-btn:focus { background: transparent; color: #fff; }
.mm-explore-btn:focus-visible { outline: 1px solid var(--mm-sand); outline-offset: 6px; }
.mm-explore-btn .mm-burger,
.mm-explore-btn .mm-x { fill: currentColor; flex: none; }
.mm-explore-btn .mm-burger rect { transition: transform 0.35s var(--mm-ease); transform-origin: right center; }
.mm-explore-btn:hover .mm-burger rect:nth-child(2) { transform: scaleX(0.6); }
.mm-explore-btn:hover .mm-burger rect:nth-child(3) { transform: scaleX(0.8); }

.mm-explore-btn--hero {
	position: fixed;
	z-index: 900;
	/* button content top = hero logo top (button has 10px inner padding) */
	top: calc(var(--mm-admin) + var(--mm-hpad) - 10px);
	right: var(--mm-gutter);
}
/* Past the navy hero the button keeps its exact position and look, it only inverts
   against what is behind it (dark on light sections, sand on navy ones). */
.mm-past-hero .mm-explore-btn--hero { mix-blend-mode: difference; }
.mm-explore-open .mm-explore-btn--hero { opacity: 0; pointer-events: none; }

/* ---------- Popup ---------- */
html.mm-explore-open { overflow: hidden; }
html.mm-explore-open body { padding-right: var(--mm-sbw, 0px); }

.mm-explore {
	--mm-ox: calc(100% - 60px);
	--mm-oy: 60px;
	position: fixed;
	top: 0; right: 0; bottom: 0; left: 0;
	z-index: 100000; /* above admin bar + popups */
	overflow-y: auto;
	overscroll-behavior: contain;
	background:
		url("mm-monogram-faint.webp") no-repeat right -6vw bottom -8vh / min(64vw, 1000px) auto,
		var(--mm-navy);
	color: #fff;
	clip-path: circle(0px at var(--mm-ox) var(--mm-oy));
	visibility: hidden;
	transition: clip-path 0.75s var(--mm-ease), visibility 0s linear 0.75s;
}
.mm-explore[hidden] { display: none; }
.mm-explore.is-open {
	clip-path: circle(150vmax at var(--mm-ox) var(--mm-oy));
	visibility: visible;
	transition: clip-path 0.85s var(--mm-ease), visibility 0s;
}

.mm-explore__inner {
	position: relative;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	padding: calc(var(--mm-admin) + var(--mm-bar-pad)) var(--mm-gutter) max(28px, min(5vw, 64px));
	box-sizing: border-box;
}

.mm-explore__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}
.mm-explore__logo { display: block; width: var(--mm-bar-logo); line-height: 0; }
.mm-explore__logo img { display: block; width: 100%; height: auto; }
.mm-explore__logo:focus-visible { outline: 1px solid var(--mm-sand); outline-offset: 8px; }

.mm-explore__body {
	flex: 1;
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
	gap: max(32px, min(6vw, 120px));
	align-items: end;
	padding-top: max(28px, min(6vh, 96px));
}

/* nav list */
.mm-explore__list,
.mm-explore__sub { list-style: none; margin: 0; padding: 0; }
.mm-explore__list { border-top: 1px solid var(--mm-line); counter-reset: none; }

.mm-explore__item {
	border-bottom: 1px solid var(--mm-line);
	opacity: 0;
	transform: translateY(22px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}
.mm-explore.is-open .mm-explore__item {
	opacity: 1;
	transform: none;
	transition: opacity 0.7s ease calc(0.28s + var(--i, 0) * 0.055s), transform 0.8s var(--mm-ease) calc(0.28s + var(--i, 0) * 0.055s);
}

.mm-explore__link {
	position: relative;
	display: flex;
	align-items: baseline;
	gap: 0;
	padding: max(8px, min(1.3vh, 18px)) 0;
	color: #fff;
	text-decoration: none;
}
.mm-explore__text {
	font-family: var(--mm-serif);
	font-size: max(28px, min(min(3.6vw, 5.4vh), 54px));
	font-weight: 400;
	line-height: 1.05;
	letter-spacing: 0.005em;
	order: 2;
	transition: color 0.3s ease;
}
/* hover / focus / current: a short sand rule slides in before the title */
.mm-explore__link::after {
	content: "";
	order: 1;
	flex: none;
	align-self: center;
	width: 0;
	height: 1px;
	margin-right: 0;
	background: var(--mm-sand);
	transition: width 0.55s var(--mm-ease), margin-right 0.55s var(--mm-ease);
}
.mm-explore__link:hover,
.mm-explore__link:focus { color: #fff; }
.mm-explore__link:hover .mm-explore__text,
.mm-explore__link:focus-visible .mm-explore__text { color: var(--mm-cream); }
.mm-explore__link:hover::after,
.mm-explore__link:focus-visible::after,
.mm-explore__link[aria-current="page"]::after { width: max(22px, min(2.4vw, 40px)); margin-right: max(12px, min(1.2vw, 18px)); }
.mm-explore__link:focus-visible { outline: none; }
.mm-explore__link[aria-current="page"] .mm-explore__text { font-style: italic; color: var(--mm-sand); }

.mm-explore__sub {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 28px;
	margin: -4px 0 0;
	padding: 0 0 max(12px, min(1.6vh, 18px));
}
.mm-explore__sub a {
	font-family: var(--mm-sans);
	font-size: 12px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.72);
	text-decoration: none;
	transition: color 0.25s ease;
}
.mm-explore__sub a:hover,
.mm-explore__sub a:focus-visible,
.mm-explore__sub a[aria-current="page"] { color: var(--mm-sand); }
.mm-explore__sub a:focus-visible { outline: 1px solid var(--mm-sand); outline-offset: 4px; }

/* aside */
.mm-explore__aside {
	display: grid;
	gap: 28px;
	padding-bottom: 6px;
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}
.mm-explore.is-open .mm-explore__aside {
	opacity: 1;
	transform: none;
	transition: opacity 0.8s ease 0.6s, transform 0.9s var(--mm-ease) 0.6s;
}
.mm-explore__label {
	margin: 0 0 8px;
	font-family: var(--mm-sans);
	font-size: 11px;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--mm-sand);
}
.mm-explore__value {
	margin: 0;
	font-family: var(--mm-serif);
	font-size: max(17px, min(1.35vw, 20px));
	line-height: 1.45;
	color: #fff;
}
.mm-explore__value a { color: #fff; text-decoration: none; border-bottom: 1px solid var(--mm-line); transition: border-color 0.25s ease; }
.mm-explore__value a:hover,
.mm-explore__value a:focus-visible { color: #fff; border-color: var(--mm-sand); outline: none; }
.mm-explore__tagline {
	margin: 12px 0 0;
	padding-top: 24px;
	border-top: 1px solid var(--mm-line);
	font-family: var(--mm-serif);
	font-style: italic;
	font-size: max(16px, min(1.25vw, 19px));
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.7);
	max-width: 34ch;
}

/* ---------- Popup: tablet / mobile ---------- */
@media (max-width: 900px) {
	.mm-explore__body { grid-template-columns: 1fr; align-items: start; gap: 44px; padding-top: 36px; }
	.mm-explore__aside { grid-template-columns: 1fr 1fr; gap: 24px; }
	.mm-explore__tagline { grid-column: 1 / -1; margin-top: 0; }
	.mm-explore { background-size: 120vw auto; background-position: right -34vw bottom -4vh; }
}
@media (max-width: 520px) {
	.mm-explore__aside { grid-template-columns: 1fr; }
	.mm-explore__text { font-size: 30px; }
	.mm-explore__sub { gap: 8px 22px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.mm-explore,
	.mm-explore.is-open { clip-path: none; transition: opacity 0.2s ease, visibility 0s; opacity: 0; }
	.mm-explore.is-open { opacity: 1; }
	.mm-explore__item,
	.mm-explore__aside,
	.mm-explore.is-open .mm-explore__item,
	.mm-explore.is-open .mm-explore__aside { transition: none; transform: none; opacity: 1; }
}

/* =====================================================================
 * Homepage hero (classes set on the blocks in the Home page editor):
 *   .mm-hero         hero Columns block (navy, full height)
 *   .mm-hero__col    its single Column
 *   .mm-hero__logo   wordmark (Columns block with the logo image)
 *   .mm-hero__title  H1 heading block
 *   .mm-hero__stats  stats Columns block
 *   .mm-hero__mark   M monogram Image block
 * ===================================================================== */
.mm-hero.stk-block-columns {
	background-color: var(--mm-navy) !important;
	background-image: none !important;
	min-height: calc(100vh - var(--mm-admin)) !important;
	min-height: calc(100svh - var(--mm-admin)) !important;
}
.mm-hero.stk-block-columns > .stk-row { width: 100%; }
.mm-hero .mm-hero__col.stk-block-column {
	padding: var(--mm-hpad) var(--mm-gutter) !important;
	width: 100%;
	flex: 1 1 100% !important;
	max-width: 100% !important;
}
.mm-hero .mm-hero__col > .stk-column-wrapper > .stk-inner-blocks {
	display: grid !important;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
	grid-template-rows: auto minmax(0, 1fr) auto;
	grid-template-areas:
		"logo  logo"
		"title mark"
		"stats .";
	column-gap: max(24px, min(3vw, 64px));
	row-gap: max(14px, min(2.4vh, 32px));
	min-height: calc(100vh - var(--mm-admin) - 2 * var(--mm-hpad));
	min-height: calc(100svh - var(--mm-admin) - 2 * var(--mm-hpad));
	align-items: center;
}
.mm-hero .mm-hero__col > .stk-column-wrapper > .stk-inner-blocks > * { margin: 0 !important; min-width: 0; }

/* wordmark */
.mm-hero .mm-hero__logo { grid-area: logo; align-self: start; }
.mm-hero .mm-hero__logo .stk-block-column,
.mm-hero .mm-hero__logo .stk-column-wrapper { padding: 0 !important; margin: 0 !important; }
.mm-hero .mm-hero__logo .stk-img-wrapper {
	/* ~46% of the width like the design, but never taller than ~13% of the screen */
	width: min(46vw, 75vh) !important;
	max-width: 100%;
	height: auto !important;
}
.mm-hero .mm-hero__logo img { width: 100% !important; height: auto !important; object-fit: contain !important; }

/* M monogram: absolutely placed inside its grid area so it scales with the hero and never pushes/overlaps rows */
.mm-hero .mm-hero__col > .stk-column-wrapper > .stk-inner-blocks > .mm-hero__mark {
	grid-area: mark;
	align-self: stretch;
	position: relative;
	min-height: 280px;
	/* run almost to the right edge of the screen, like the design */
	margin-right: calc(-1 * var(--mm-gutter) + 1.2vw) !important;
}
.mm-hero .mm-hero__mark img {
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	object-fit: contain;
	object-position: right center;
}

/* headline */
.mm-hero .mm-hero__title { grid-area: title; align-self: center; max-width: none !important; }
.mm-hero .mm-hero__title .stk-block-heading__text,
.mm-hero .mm-hero__title h1 {
	max-width: 15em !important;
	font-size: max(30px, min(2.75vw, 52px)) !important;
	line-height: 1.22 !important;
	margin: 0 !important;
}

/* stats: one row, identical type for all three numbers */
.mm-hero .mm-hero__stats { grid-area: stats; align-self: end; }
.mm-hero .mm-hero__stats .stk-block-column,
.mm-hero .mm-hero__stats .stk-column-wrapper { padding-left: 0 !important; padding-right: 0 !important; }
.mm-hero .mm-hero__stats .stk-block-columns .stk-row {
	display: flex !important;
	flex-wrap: nowrap !important;
	justify-content: flex-start;
	gap: max(20px, min(4vw, 72px));
}
.mm-hero .mm-hero__stats .stk-block-columns .stk-row > .stk-block-column {
	flex: 0 1 auto !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0;
}
.mm-hero .mm-hero__stats h3 {
	font-family: var(--mm-serif) !important;
	font-size: max(26px, min(2.3vw, 42px)) !important;
	font-weight: 700 !important;
	line-height: 1.1 !important;
	white-space: nowrap;
}
.mm-hero .mm-hero__stats h3 strong { font-weight: inherit; }
.mm-hero .mm-hero__stats .stk-block-text,
.mm-hero .mm-hero__stats .stk-block-text p { white-space: nowrap; }

/* tablet + mobile: stack logo, M, headline, stats */
@media (max-width: 900px) {
	/* stacked layout: logo sits below the button, so the button goes back to the bar position */
	.mm-explore-btn--hero { top: calc(var(--mm-admin) + var(--mm-bar-pad)); }
	.mm-hero .mm-hero__col > .stk-column-wrapper > .stk-inner-blocks {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto auto auto auto;
		grid-template-areas: "logo" "mark" "title" "stats";
		row-gap: max(26px, min(5vw, 44px));
		align-items: start;
		/* room for the fixed Explore button above the logo */
		padding-top: 48px;
	}
	.mm-hero .mm-hero__logo .stk-img-wrapper { width: min(100%, 640px) !important; }
	.mm-hero .mm-hero__col > .stk-column-wrapper > .stk-inner-blocks > .mm-hero__mark {
		min-height: 0;
		margin-right: 0 !important;
		justify-self: center;
		width: min(100%, 71vh);
		width: min(100%, 50svh * 1.42);
	}
	.mm-hero .mm-hero__mark img { position: static; height: auto !important; aspect-ratio: 1542 / 1084; }
	.mm-hero .mm-hero__title .stk-block-heading__text,
	.mm-hero .mm-hero__title h1 { font-size: max(26px, min(6.6vw, 40px)) !important; }
	/* stats: three equal columns with hairline dividers, labels may wrap to two lines */
	.mm-hero .mm-hero__stats .stk-block-columns .stk-row {
		display: grid !important;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		align-items: stretch;
		gap: 0;
	}
	.mm-hero .mm-hero__stats .stk-block-columns .stk-row > .stk-block-column {
		padding: 2px 6px !important;
		text-align: center;
	}
	/* numbers on one line, labels hang from the top */
	.mm-hero .mm-hero__stats .stk-block-columns .stk-row > .stk-block-column .stk-column-wrapper,
	.mm-hero .mm-hero__stats .stk-block-columns .stk-row > .stk-block-column .stk-inner-blocks {
		justify-content: flex-start !important;
		align-items: center !important;
		height: 100%;
	}
	.mm-hero .mm-hero__stats .stk-block-columns .stk-row > .stk-block-column + .stk-block-column {
		border-left: 1px solid var(--mm-line);
	}
	.mm-hero .mm-hero__stats h3 { font-size: max(24px, min(6.4vw, 34px)) !important; margin-bottom: 6px !important; }
	.mm-hero .mm-hero__stats .stk-block-text,
	.mm-hero .mm-hero__stats .stk-block-text p {
		white-space: normal;
		line-height: 1.55 !important;
		text-align: center !important;
		font-size: max(9px, min(2.6vw, 10px)) !important;
		letter-spacing: 0.14em !important;
		word-break: keep-all;
		overflow-wrap: normal;
		hyphens: none;
	}
	/* the manual line break in the headline only makes sense on desktop */
	.mm-hero .mm-hero__title br { display: none; }
}
@media (max-width: 520px) {
	:root { --mm-hpad: 22px; }
}
@media (max-width: 370px) {
	.mm-hero .mm-hero__stats .stk-block-text,
	.mm-hero .mm-hero__stats .stk-block-text p { letter-spacing: 0.06em !important; }
	.mm-hero .mm-hero__stats .stk-block-columns .stk-row > .stk-block-column { padding: 2px 3px !important; }
}

/* =====================================================================
 * Inner pages, mobile: cards/panels size to their content.
 * Desktop min-heights (used to make side-by-side panels equal) leave big
 * empty gaps once the panels stack. Only nested blocks are reset; full-width
 * sections (heroes etc.) keep their heights.
 * ===================================================================== */
@media (max-width: 767px) {
	body:not(.mm-front) .entry-content .stk-block-columns .stk-block-columns,
	body:not(.mm-front) .entry-content .stk-block-columns .stk-block-column .stk-container {
		min-height: 0 !important;
	}
}


/* ---------- Popup: Email Us button (aside) - matches the Contact section button ---------- */
.mm-explore__email {
	display: inline-block;
	padding: 12px 16px;
	border-radius: 3px;
	background: var(--mm-sand);
	color: var(--mm-navy-deep);
	font-family: var(--mm-sans);
	font-size: 20px;
	font-weight: 400;
	line-height: 1.2;
	text-decoration: none;
	transition: opacity 0.25s ease;
}
.mm-explore__email:hover,
.mm-explore__email:focus-visible { color: var(--mm-navy-deep); opacity: 0.85; outline: none; }
@media (max-width: 900px) {
	.mm-explore__block--email { grid-column: 1 / -1; }
}


/* ---------- Floating Explore button: readable pill on mobile / tablet once past the hero ---------- */
@media (max-width: 900px) {
	.mm-explore-btn--hero {
		border-radius: 3px;
		transition: background-color 0.35s ease, padding 0.35s ease, margin 0.35s ease, box-shadow 0.35s ease, opacity 0.3s ease;
	}
	.mm-past-hero .mm-explore-btn--hero,
	.mm-past-hero .mm-explore-btn--hero:hover,
	.mm-past-hero .mm-explore-btn--hero:focus {
		mix-blend-mode: normal;
		padding: 10px 14px;
		margin-right: -14px;
		background: rgba(26, 37, 82, 0.9);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
		box-shadow: 0 0 0 1px rgba(211, 200, 172, 0.22), 0 8px 24px rgba(19, 27, 54, 0.22);
		color: #fff;
	}
}

/* ---------- Popup: fit the whole menu on short desktop / laptop screens ---------- */
@media (min-width: 901px) and (max-height: 960px) {
	.mm-explore__inner { padding-bottom: max(20px, min(3vh, 32px)); }
	.mm-explore__body { padding-top: max(14px, min(2.6vh, 32px)); }
	.mm-explore__link { padding: max(5px, min(0.9vh, 9px)) 0; }
	.mm-explore__text { font-size: max(26px, min(min(3.2vw, 4.9vh), 46px)); }
	.mm-explore__sub { gap: 4px 24px; margin-top: -2px; padding-bottom: max(8px, min(1.1vh, 12px)); }
	.mm-explore__aside { gap: 22px; }
}
