/*
Theme Name: MM
Theme URI: https://massimilianomaggio.com/
Author: Calicchia Design
Description: Block theme for Massimiliano Maggio, luxury pool and game tables made in Italy.
Version: 2.0.0
Requires at least: 7.1
Tested up to: 7.1
Requires PHP: 8.3
License: Proprietary
Text Domain: mm
*/

/* Metric-matched fallbacks: no layout shift when the web fonts swap in. */
@font-face {
	font-family: "Jost Fallback";
	src: local("Arial"), local("ArialMT");
	size-adjust: 95.9%;
	ascent-override: 111.5%;
	descent-override: 39.1%;
	line-gap-override: 0%;
}

@font-face {
	font-family: "Marcellus Fallback";
	src: local("Georgia");
	size-adjust: 103.7%;
	ascent-override: 93.9%;
	descent-override: 27%;
	line-gap-override: 0%;
}

/*
 * Semantic colours. Blocks use only these, never the presets directly, so any block works
 * inside a dark section (.is-dark, or the "Section dark" style of core/group).
 */
:root {
	--mm-bg: var(--wp--preset--color--bg);
	--mm-surface: var(--wp--preset--color--surface);
	--mm-fg: var(--wp--preset--color--text);
	--mm-fg-2: var(--wp--preset--color--text-2);
	--mm-fg-3: var(--wp--preset--color--text-3);
	--mm-line: var(--wp--preset--color--line);
	--mm-line-strong: var(--wp--preset--color--line-strong);
	--mm-accent: var(--wp--preset--color--accent);
	--mm-accent-hover: var(--wp--preset--color--accent-strong);
	--mm-on-accent: var(--wp--preset--color--on-accent);
	--mm-soft: var(--wp--preset--color--accent-soft);
	--mm-focus: 2px solid var(--mm-fg);

	/* Near-square corners (UI v2.1): 2px on controls and small items, 5px on photos, panels and
	   slabs. "pill" is a historical name: it is the radius of every control, no longer a pill. */
	--mm-r-sm: var(--wp--custom--radius--sm);
	--mm-r-lg: var(--wp--custom--radius--lg);
	--mm-r-pill: var(--wp--custom--radius--pill);
	--mm-radius: var(--mm-r-lg);
	--mm-ease: var(--wp--custom--ease);
	--mm-ease-out: var(--wp--custom--ease-out);
	--mm-duration: var(--wp--custom--duration);
	--mm-header-h: var(--wp--custom--header-height);
	--mm-display: var(--wp--preset--font-family--marcellus);
	--mm-display-text: var(--wp--preset--font-family--marcellus);
	--mm-sans: var(--wp--preset--font-family--jost);

	color-scheme: light;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

.is-dark,
.is-style-section-dark,
.mm-glass--dark {
	--mm-bg: var(--wp--custom--dark--bg);
	--mm-surface: var(--wp--custom--dark--surface);
	--mm-fg: var(--wp--custom--dark--text);
	--mm-fg-2: var(--wp--custom--dark--text-2);
	--mm-fg-3: var(--wp--custom--dark--text-3);
	--mm-line: var(--wp--custom--dark--line);
	--mm-line-strong: var(--wp--custom--dark--line-strong);
	--mm-accent: var(--wp--custom--dark--accent);
	--mm-accent-hover: var(--wp--custom--dark--accent-hover);
	--mm-on-accent: var(--wp--custom--dark--on-accent);
	--mm-soft: var(--wp--custom--dark--soft);
	color-scheme: dark;
}

.is-dark,
.is-style-section-dark {
	background-color: var(--mm-bg);
	color: var(--mm-fg);
}

/* Light glass can sit inside a dark section: it brings the light colours back. */
.mm-glass--light {
	--mm-bg: var(--wp--preset--color--bg);
	--mm-surface: var(--wp--preset--color--surface);
	--mm-fg: var(--wp--preset--color--text);
	--mm-fg-2: var(--wp--preset--color--text-2);
	--mm-fg-3: var(--wp--preset--color--text-3);
	--mm-line: var(--wp--preset--color--line);
	--mm-line-strong: var(--wp--preset--color--line-strong);
	--mm-accent: var(--wp--preset--color--accent);
	--mm-accent-hover: var(--wp--preset--color--accent-strong);
	--mm-on-accent: var(--wp--preset--color--on-accent);
	--mm-soft: var(--wp--preset--color--accent-soft);
	color-scheme: light;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-padding-top: calc(var(--mm-header-h) + 1rem);
}

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

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

p,
li {
	max-width: var(--wp--custom--measure);
	text-wrap: pretty;
}

/* Component lists (role="list") lay out their own items: no reading measure there. */
[role="list"] > li {
	max-width: none;
}

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

a {
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

::selection {
	background: var(--mm-fg);
	color: var(--mm-bg);
}

/* Visible focus everywhere, never removed; it follows the element's own radius. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: var(--mm-focus);
	outline-offset: 3px;
}

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

/* The skip link is the one WordPress adds to block themes (#wp-skip-link): restyled here.
   Core's focus rule resets clip-path but not clip, so any clip: rect() left by another
   .screen-reader-text rule would keep the link invisible on focus. */
:root .skip-link.screen-reader-text:focus {
	clip: auto !important;
	position: fixed;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 100;
	padding: 0.75rem 1.25rem;
	border-radius: var(--mm-r-pill);
	background: var(--mm-bg);
	box-shadow: var(--wp--preset--shadow--float);
	color: var(--mm-fg);
	font-family: var(--mm-sans);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	line-height: 1.2;
}

/* Buttons: pills, at least 48px tall, with a physical press. */
.wp-element-button,
.wp-block-button__link,
.mm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 48px;
	transition: background-color var(--mm-duration) var(--mm-ease), border-color var(--mm-duration) var(--mm-ease), color var(--mm-duration) var(--mm-ease), transform 140ms var(--mm-ease);
}

.mm-btn {
	padding: 0.85rem 1.6rem;
	border: 1px solid var(--mm-accent);
	border-radius: var(--mm-r-pill);
	background: var(--mm-accent);
	color: var(--mm-on-accent);
	font-family: var(--mm-sans);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	letter-spacing: 0.01em;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.mm-btn:hover {
	border-color: var(--mm-accent-hover);
	background: var(--mm-accent-hover);
	color: var(--mm-on-accent);
}

.mm-btn--ghost {
	border-color: currentColor;
	background: transparent;
	color: inherit;
}

.mm-btn--ghost:hover {
	border-color: var(--mm-fg);
	background: var(--mm-fg);
	color: var(--mm-bg);
}

.wp-element-button:active,
.wp-block-button__link:active,
.mm-btn:active {
	transform: scale(0.98);
}

/* Text link with an underline that draws in on hover. */
.mm-link,
.mm-link-arrow {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: inherit;
	font-family: var(--mm-sans);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	text-decoration: none;
	background: linear-gradient(currentColor, currentColor) no-repeat left calc(50% + 0.85em) / 100% 1px;
	transition: background-size 400ms var(--mm-ease-out);
}

.mm-link:hover,
.mm-link-arrow:hover {
	background-size: 0 1px;
	background-position: right calc(50% + 0.85em);
}

/* Small meta labels: the only place uppercase is used, kept rare. */
.mm-meta {
	font-family: var(--mm-sans);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--mm-fg-2);
}

.mm-lede {
	font-size: var(--wp--preset--font-size--md);
	line-height: 1.5;
	color: var(--mm-fg-2);
}

.mm-display {
	margin: 0;
	font-family: var(--mm-display);
	font-size: var(--wp--preset--font-size--display);
	font-weight: 400;
	line-height: 0.98;
	letter-spacing: -0.02em;
}

/*
 * Frosted glass, only on elements that sit over photos or dark sections: header, menus,
 * captions on photos, dialogs and banners. Solid where blur is unsupported or the visitor
 * asks for less transparency, so text contrast never depends on the photo underneath.
 */
.mm-glass--light,
.mm-glass--dark {
	border: 1px solid;
	-webkit-backdrop-filter: blur(18px) saturate(140%);
	backdrop-filter: blur(18px) saturate(140%);
	box-shadow: var(--wp--preset--shadow--float);
}

.mm-glass--light {
	border-color: rgb(255 255 255 / 0.6);
	background: rgb(255 255 255 / 0.74);
	color: var(--wp--preset--color--text);
	box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.7), var(--wp--preset--shadow--float);
}

.mm-glass--dark {
	--mm-fg-2: #e0e0e0;
	border-color: rgb(255 255 255 / 0.14);
	background: rgb(10 10 10 / 0.7);
	color: var(--mm-fg);
	box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08), var(--wp--preset--shadow--float);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.mm-glass--light {
		background: rgb(255 255 255 / 0.97);
	}

	.mm-glass--dark {
		background: rgb(10 10 10 / 0.94);
	}
}

@media (prefers-reduced-transparency: reduce) {
	.mm-glass--light,
	.mm-glass--dark {
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}

	.mm-glass--light {
		background: rgb(255 255 255 / 0.97);
	}

	.mm-glass--dark {
		background: rgb(10 10 10 / 0.94);
	}
}

/* Rounded media frame: the image scales a touch on hover, the frame stays put. */
:where(.mm-media) {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--mm-r-lg);
	background: var(--mm-surface);
	isolation: isolate;
}

/* Hairline edge, so photos shot on white keep their shape on a white page. */
:where(.mm-media)::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mm-fg) 7%, transparent);
	pointer-events: none;
}

:where(.mm-media) img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 900ms var(--mm-ease-out);
}

a:hover > :where(.mm-media) img,
a:focus-visible > :where(.mm-media) img,
:where(.mm-media):hover img {
	transform: scale(1.03);
}

/* Links styled as components never take the default link underline. */
.mm-btn,
.mm-link,
.mm-link-arrow,
.mm-card {
	text-decoration: none;
}

/* Shared product card (featured products, related products, grids). */
:where(.mm-card) {
	display: grid;
	gap: 1rem;
	color: inherit;
	text-decoration: none;
}

:where(.mm-card) :where(.mm-media) {
	aspect-ratio: 4 / 5;
}

.mm-card__title {
	margin: 0;
	font-family: var(--mm-display-text);
	font-size: var(--wp--preset--font-size--md);
	font-weight: 400;
	line-height: 1.2;
}

.mm-card:hover .mm-card__title,
.mm-card:focus-visible .mm-card__title {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.mm-card__meta {
	margin: 0.25rem 0 0;
	color: var(--mm-fg-2);
	font-size: var(--wp--preset--font-size--sm);
}

/*
 * Page frame. The header template part is the sticky element (a sticky child of a wrapper
 * as tall as itself would never stick). On pages that open with a dark cover it overlaps it.
 */
:root {
	--mm-gap: clamp(0.5rem, 0.9vw, 0.875rem);
	--mm-slab-r: var(--mm-r-lg);
}

/* The header is exactly --mm-header-h tall (the bar sits in it with a small margin), so the
   pull-up over a cover and the scroll padding use the real height. */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 50;
	height: var(--mm-header-h);
	margin: 0;
}

.mm-has-cover .wp-site-blocks > header.wp-block-template-part {
	margin-bottom: calc(-1 * var(--mm-header-h));
}

/* Covers are dark slabs inset from the viewport on all four sides, as on the home (the layout
   rule that zeroes the first child's top margin would otherwise glue them to the top edge). */
:root .mm-has-cover :is(.mm-product-hero.mm-slab, .mm-cover.is-dark) {
	margin-top: var(--mm-gap);
}

/* No block gap between the parts of the page (the quote bar part sits between main and footer). */
.wp-site-blocks > * {
	margin-block-start: 0;
}

/*
 * Dark slabs: dark sections are rounded panels inset from the viewport edge, so nothing on
 * the page is a hard rectangle. Light sections stay open on the white page.
 */
.mm-slab {
	border-radius: var(--mm-slab-r);
}

.mm-slab.alignfull {
	margin-left: calc(var(--wp--style--root--padding-left) * -1 + var(--mm-gap)) !important;
	margin-right: calc(var(--wp--style--root--padding-right) * -1 + var(--mm-gap)) !important;
}

.mm-main--front .wp-block-post-content > * {
	margin-block: 0;
}

.mm-main--front .wp-block-post-content > * + * {
	margin-block-start: var(--mm-gap);
}

.mm-main--front .wp-block-post-content > .mm-slab:first-child {
	margin-block-start: var(--mm-gap);
}

/* Inner width of full-bleed sections. */
:where(.mm-wrap) {
	width: 100%;
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
	padding-inline: var(--wp--preset--spacing--50);
}

/* One page gutter: <main> carries it (root padding). Wide theme blocks placed directly in it
   drop their own side padding, which doubled the gutter on phones. Blocks that paint their own
   surface keep theirs: dark slabs and the room-fit panel. */
:root .has-global-padding > :is(.alignwide, .alignfull)[class*="wp-block-mm-"]:not(.mm-slab, .is-dark, .mm-room-fit) {
	padding-inline: 0;
}

/* Sections: generous vertical rhythm. */
.mm-main {
	padding-bottom: 0;
}

.mm-main:not(.mm-main--front) {
	padding-bottom: var(--wp--preset--spacing--80);
}

/*
 * Section rhythm on inner pages (the home stacks its sections at the slab gap). A dark slab is
 * spacing-80 away from a light section, as light sections are from each other; a slab right
 * after another slab sits at the slab gap, like stacked panels. The block gap of the layout
 * (1.25rem) used to win here and glued slabs to the section above.
 */
:root .mm-main:not(.mm-main--front) > .mm-slab:not(:first-child),
:root .mm-main:not(.mm-main--front) > .wp-block-post-content > .mm-slab:not(:first-child) {
	margin-block-start: var(--wp--preset--spacing--80);
}

:root .mm-main:not(.mm-main--front) .mm-slab + .mm-slab {
	margin-block-start: var(--mm-gap);
}

/* The page ends at spacing-80 above the footer, or at the slab gap when it ends on a slab. */
:root .mm-main:not(.mm-main--front) > :last-child,
:root .mm-main:not(.mm-main--front) > .wp-block-post-content:last-child > :last-child {
	margin-block-end: 0 !important;
}

.mm-main:not(.mm-main--front):has(> .mm-slab:last-child, > .wp-block-post-content:last-child > .mm-slab:last-child) {
	padding-bottom: 0;
}

:where(.mm-section) {
	padding-block: var(--wp--preset--spacing--80);
}

.mm-section-title {
	margin: 0 0 var(--wp--preset--spacing--60);
	font-family: var(--mm-display);
	font-size: var(--wp--preset--font-size--xl);
	font-weight: 400;
	line-height: 1.02;
	letter-spacing: -0.02em;
}

/* Quote section (product pages, contact): intro on the left, the form on a solid panel. */
.mm-quote {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--50);
	max-width: var(--wp--style--global--wide-size);
	margin: var(--wp--preset--spacing--80) auto 0 !important;
	padding: var(--wp--preset--spacing--50);
	border-radius: var(--mm-r-lg);
	background: var(--mm-surface);
	scroll-margin-top: calc(var(--mm-header-h) + 1rem);
}

.mm-quote__intro .mm-section-title {
	margin-bottom: var(--wp--preset--spacing--40);
}

.mm-quote__direct {
	color: var(--mm-fg-2);
	font-size: var(--wp--preset--font-size--sm);
}

.mm-quote__direct a {
	color: var(--mm-fg);
}

.mm-quote .mm-form-wrap {
	margin-block: 0;
}

@media (min-width: 1080px) {
	.mm-quote {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		gap: var(--wp--preset--spacing--70);
		padding: var(--wp--preset--spacing--70);
	}
}

/*
 * Motion. Scroll-driven, CSS only; where unsupported the content is simply static.
 * .mm-reveal       fades and rises in as it enters the viewport
 * .mm-reveal-mask  photo uncovered by a shrinking rounded mask
 * .mm-parallax     image drifts slower than the page (covers only)
 * .mm-lines > *    title lines rise in one after another on load (set --i per line)
 */
@media (prefers-reduced-motion: no-preference) {
	.mm-lines > * {
		display: block;
		animation: mm-line-in 1s var(--mm-ease-out) both;
		animation-delay: calc(var(--i, 0) * 90ms + 80ms);
	}

	@supports (animation-timeline: view()) {
		.mm-reveal {
			animation: mm-reveal linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 45%;
		}

		.mm-reveal-mask {
			animation: mm-mask linear both;
			animation-timeline: view();
			animation-range: entry 0% cover 35%;
		}

		.mm-reveal-mask img {
			animation: mm-mask-img linear both;
			animation-timeline: view();
			animation-range: entry 0% cover 35%;
		}

		.mm-parallax img {
			animation: mm-parallax linear both;
			animation-timeline: view();
			animation-range: cover 0% cover 100%;
		}
	}
}

@keyframes mm-line-in {
	from {
		opacity: 0.01;
		transform: translateY(0.45em);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes mm-reveal {
	from {
		opacity: 0;
		transform: translateY(1.5rem);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes mm-mask {
	from {
		clip-path: inset(10% 6% 10% 6% round var(--mm-r-lg));
	}
	to {
		clip-path: inset(0 0 0 0 round var(--mm-r-lg));
	}
}

/* The individual scale property, not transform: the hover zoom on photos (transform: scale)
   still works on top of it. With transform the animation, filled forwards, won. */
@keyframes mm-mask-img {
	from {
		scale: 1.08;
	}
	to {
		scale: 1;
	}
}

@keyframes mm-parallax {
	from {
		transform: translateY(-6%) scale(1.12);
	}
	to {
		transform: translateY(6%) scale(1.12);
	}
}

/*
 * Page transitions (src/transition, GSAP). A curtain of dark stripes closes over the page on the
 * way out and opens on the next page. A product card photo flies into the product hero; any
 * other link shows the monogram on the curtain. The next page is born covered: the boot script
 * in the head sets html.pt-cover before the first paint, so nothing shows between the pages.
 * Layers: veil 8999, curtain 9000, monogram 9001, flying photo 10000, all above header, menu
 * and banner. At rest the layers are hidden, not just transparent; the script shows them.
 */

/* The scrollbar never comes and goes: the centre of the screen is the same on both pages. */
html {
	scrollbar-gutter: stable;
}

/* The page blurs behind the card as it starts to fly, before the stripes come in. */
.pt-veil {
	position: fixed;
	inset: 0;
	z-index: 8999;
	visibility: hidden;
	opacity: 0;
	background: rgb(10 10 10 / 0.22);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	pointer-events: none;
}

@media (prefers-reduced-transparency: reduce) {
	.pt-veil {
		background: rgb(10 10 10 / 0.5);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.pt-veil {
		background: rgb(10 10 10 / 0.5);
	}
}

/* A pixel past every edge: at fractional device pixel ratios the last column stayed uncovered. */
.pt-curtain {
	position: fixed;
	inset: -1px;
	z-index: 9000;
	display: flex;
	visibility: hidden;
	pointer-events: none;
}

.pt-stripe {
	flex: 1 1 0;
	height: 100%;
	background: var(--wp--custom--dark--bg);
	transform: scaleY(0);
	transform-origin: 50% 100%;
}

/* Overlap by a pixel: fractional stripe widths would leave hairlines between them. */
.pt-stripe + .pt-stripe {
	margin-left: -1px;
}

.pt-mark {
	position: fixed;
	inset: 0;
	z-index: 9001;
	display: grid;
	place-items: center;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
}

/* The monogram is a dark PNG: white on the curtain until the vector logo arrives. */
.pt-mark img {
	width: min(32vw, 17.5rem);
	height: auto;
	filter: invert(1);
}

.pt-flight {
	position: fixed;
	inset: 0;
	z-index: 10000;
	pointer-events: none;
}

.pt-flight:empty {
	display: none;
}

/*
 * The photo in flight: the real card on the way out, copies on the way in (the card photo over
 * the hero photo, then the hero's scrim). Transparent: a photo not yet decoded shows the
 * curtain, never a lighter box.
 */
.pt-flight > * {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	margin: 0;
	border-radius: var(--mm-r-lg);
	background: transparent;
	animation: none;
}

.pt-flight img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	animation: none;
}

.pt-flight__scrim {
	position: absolute;
	inset: 0;
	opacity: 0;
}

html.pt-cover {
	background: var(--wp--custom--dark--bg);
}

.pt-cover .pt-curtain {
	visibility: visible;
}

.pt-cover .pt-stripe {
	transform: none;
}

.pt-cover:is([data-pt-arrive="logo"], [data-pt-arrive="back"]) .pt-mark {
	visibility: visible;
	opacity: 1;
}

/*
 * Arrival: every animation waits at its start until the page is revealed, then plays from the
 * beginning (the staggered delays of title lines included). Not the scroll-driven ones: held
 * before their timeline starts, the cover parallax would jump at release. Not the consent
 * banner: paused at opacity 0 it would block the page unseen.
 */
html.pt-hold body *:not(.pt-curtain, .pt-curtain *, .pt-mark, .pt-mark *, .pt-flight, .pt-flight *, .pt-veil, .mm-consent, .mm-consent *),
html.pt-hold body *:not(.pt-curtain, .pt-curtain *, .pt-mark, .pt-mark *, .pt-flight, .pt-flight *, .pt-veil, .mm-consent, .mm-consent *)::before,
html.pt-hold body *:not(.pt-curtain, .pt-curtain *, .pt-mark, .pt-mark *, .pt-flight, .pt-flight *, .pt-veil, .mm-consent, .mm-consent *)::after {
	animation-play-state: paused !important;
}

html.pt-hold body :is(.mm-reveal, .mm-reveal-mask, .mm-reveal-mask img, .mm-parallax img) {
	animation-play-state: running !important;
}

/* Elements that come in once the page is revealed (src/transition/index.ts, release()). */
html.pt-hold [data-pt-enter] {
	visibility: hidden;
}

/* Safety net: if the transition script never runs, the curtain opens on its own. */
.pt-cover:not([data-pt-run]) :is(.pt-curtain, .pt-mark, .pt-flight) {
	animation: pt-failsafe 0.4s 4s both;
}

html.pt-cover:not([data-pt-run]) {
	animation: pt-failsafe-bg 0s 4s both;
}

@keyframes pt-failsafe {
	to {
		visibility: hidden;
		opacity: 0;
	}
}

@keyframes pt-failsafe-bg {
	to {
		background: transparent;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/*
 * Forms, consent banner and embeds (mm-core modules forms and consent).
 * The modules ship neutral styles on the presets; the theme gives them the v2 look here.
 * `:root` raises specificity above the module CSS whatever the load order.
 */
:root {
	/* Variables the module CSS was written against (UI v1 names). */
	--wp--custom--radius: var(--mm-r-sm);
	--wp--custom--focus: var(--mm-focus);
}

:root .mm-form-wrap {
	max-width: 44rem;
}

:root .mm-form fieldset {
	padding: var(--wp--preset--spacing--50);
	border-color: var(--mm-line);
	border-radius: var(--mm-r-lg);
}

:root .mm-form legend {
	font-family: var(--mm-display-text);
	font-weight: 400;
}

:root .mm-form .mm-field__label {
	font-weight: 500;
}

:root .mm-form .mm-field input:not([type="checkbox"]),
:root .mm-form .mm-field select {
	min-height: 52px;
	padding: 0 1.25rem;
	border-color: var(--mm-line-strong);
	border-radius: var(--mm-r-pill);
	background: var(--mm-bg);
}

:root .mm-form .mm-field textarea {
	padding: 1rem 1.25rem;
	border-color: var(--mm-line-strong);
	border-radius: var(--mm-r-lg);
	background: var(--mm-bg);
}

:root .mm-form .mm-field input:focus-visible,
:root .mm-form .mm-field select:focus-visible,
:root .mm-form .mm-field textarea:focus-visible {
	border-color: var(--mm-fg);
}

:root .mm-form__submit,
:root .mm-embed__load,
:root .mm-consent__btn {
	min-height: 48px;
	padding: 0.85rem 1.6rem;
	border: 1px solid var(--mm-accent);
	border-radius: var(--mm-r-pill);
	background: var(--mm-accent);
	color: var(--mm-on-accent);
	font-weight: 500;
	transition: background-color var(--mm-duration) var(--mm-ease), transform 140ms var(--mm-ease);
}

:root .mm-form__submit:hover,
:root .mm-embed__load:hover,
:root .mm-consent__btn:hover {
	border-color: var(--mm-accent-hover);
	background: var(--mm-accent-hover);
}

:root .mm-form__submit:active,
:root .mm-embed__load:active,
:root .mm-consent__btn:active {
	transform: scale(0.98);
}

:root .mm-form__summary,
:root .mm-form__success {
	border-radius: var(--mm-r-lg);
}

:root .mm-form__success {
	border-color: var(--mm-fg);
	background: var(--mm-surface);
}

:root .mm-catalogue__cover img {
	border-color: var(--mm-line);
	border-radius: var(--mm-r-sm);
}

:root .mm-embed {
	padding: var(--wp--preset--spacing--50);
	border: 0;
	border-radius: var(--mm-r-lg);
	background: var(--mm-surface);
}

:root .mm-embed iframe {
	border-radius: var(--mm-r-lg);
}

/* The placeholder follows the section it sits in (dark sections included). */
:root .mm-embed,
:root .mm-embed__note {
	color: var(--mm-fg-2);
}

/*
 * Consent banner: a dark glass panel, buttons of equal weight. As a modal it sits in the middle
 * of a dimmed, blurred page; on the policy pages it floats at the bottom and the page stays
 * usable, so the policy can be read before choosing.
 */
:root .mm-consent {
	border-radius: var(--mm-slab-r);
	color: var(--mm-fg);
}

:root .mm-consent:modal {
	width: min(38rem, calc(100% - 2 * var(--mm-gap)));
	max-height: calc(100dvh - 2 * var(--mm-gap) - env(safe-area-inset-bottom));
}

:root .mm-consent:not(:modal) {
	right: var(--mm-gap);
	bottom: calc(var(--mm-gap) + env(safe-area-inset-bottom));
	left: var(--mm-gap);
	max-width: 46rem;
}

:root .mm-consent::backdrop {
	background: rgb(10 10 10 / 0.42);
	-webkit-backdrop-filter: blur(10px) saturate(120%);
	backdrop-filter: blur(10px) saturate(120%);
}

@media (prefers-reduced-transparency: reduce) {
	:root .mm-consent::backdrop {
		background: rgb(10 10 10 / 0.72);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
}

@media (prefers-reduced-motion: no-preference) {
	:root .mm-consent:modal {
		animation: mm-consent-in 420ms var(--mm-ease-out) both;
	}

	:root .mm-consent:modal::backdrop {
		animation: mm-consent-fade 420ms var(--mm-ease-out) both;
	}
}

@keyframes mm-consent-in {
	from {
		opacity: 0;
		translate: 0 1rem;
		scale: 0.98;
	}
}

@keyframes mm-consent-fade {
	from {
		opacity: 0;
	}
}

:root .mm-consent:modal .mm-consent__title {
	padding-right: 3rem;
	font-size: var(--wp--preset--font-size--lg);
	line-height: 1.1;
}

/* Accept and reject side by side at exactly the same width; "Customise" on its own line. */
:root .mm-consent__layer[data-mm-layer="1"] .mm-consent__actions {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.6rem;
}

:root .mm-consent__layer[data-mm-layer="1"] .mm-consent__link {
	grid-column: 1 / -1;
	justify-self: center;
}

:root .mm-consent:not(.mm-glass--dark) {
	--mm-bg: var(--wp--custom--dark--bg);
	--mm-fg: var(--wp--custom--dark--text);
	--mm-fg-2: #e0e0e0;
	--mm-line: rgb(255 255 255 / 0.16);
	--mm-accent: var(--wp--custom--dark--accent);
	--mm-accent-hover: var(--wp--custom--dark--accent-hover);
	--mm-on-accent: var(--wp--custom--dark--on-accent);
	border: 1px solid rgb(255 255 255 / 0.14);
	background: rgb(16 16 16 / 0.84);
	-webkit-backdrop-filter: blur(22px) saturate(160%);
	backdrop-filter: blur(22px) saturate(160%);
	box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08), var(--wp--preset--shadow--float);
}

@media (prefers-reduced-transparency: reduce) {
	:root .mm-consent:not(.mm-glass--dark) {
		background: rgb(16 16 16 / 0.97);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
}

:root .mm-consent__inner {
	padding: var(--wp--preset--spacing--50);
}

:root .mm-consent__title {
	font-family: var(--mm-display-text);
	font-size: var(--wp--preset--font-size--md);
	font-weight: 400;
}

:root .mm-consent__text,
:root .mm-consent__option label {
	color: var(--mm-fg-2);
}

:root .mm-consent__option strong,
:root .mm-consent__close {
	color: var(--mm-fg);
}

:root .mm-consent__text a,
:root .mm-consent__link {
	color: var(--mm-fg);
}

:root .mm-consent__btn {
	flex: 1 1 10rem;
}

:root .mm-consent__close {
	border-radius: var(--mm-r-pill);
}

/* The banner moves focus to its title on open: a heading, not a control, so no ring. */
:root .mm-consent__title:focus-visible {
	outline: none;
}

:root .mm-consent__option input,
:root .mm-form .mm-field--check input,
:root .mm-catalogue input {
	accent-color: var(--mm-fg);
}

/*
 * Editorial content: story pages, news articles, legal pages. Applies to post content laid out
 * by the constrained layout (42rem column, wide 82rem).
 */
.wp-block-post-content > p,
.wp-block-post-content > ul,
.wp-block-post-content > ol {
	font-size: 1.125rem;
	line-height: 1.7;
}

/* Long URLs and cookie names wrap instead of widening the page. */
.wp-block-post-content {
	overflow-wrap: break-word;
}

.wp-block-post-content code,
.wp-block-post-content a {
	overflow-wrap: anywhere;
}

.wp-block-post-content > .mm-lede,
.wp-block-post-content > p.mm-lede {
	color: var(--mm-fg-2);
	font-family: var(--mm-display);
	font-size: var(--wp--preset--font-size--lg);
	line-height: 1.3;
}

.wp-block-post-content > h2 {
	margin-top: var(--wp--preset--spacing--70);
	font-size: var(--wp--preset--font-size--xl);
	line-height: 1.04;
}

.wp-block-post-content > h3 {
	margin-top: var(--wp--preset--spacing--60);
}

.wp-block-post-content > * + * {
	margin-block-start: 1.4rem;
}

/* Pull quote: large Marcellus (no italic face: set upright), the opening mark hanging. */
.wp-block-quote.is-style-pull {
	max-width: 52rem;
	margin-block: var(--wp--preset--spacing--70);
	margin-inline: auto;
	padding: 0;
	border: 0;
}

.wp-block-quote.is-style-pull p {
	margin: 0;
	text-indent: -0.42em;
	font-family: var(--mm-display);
	font-size: var(--wp--preset--font-size--xl);
	font-style: normal;
	line-height: 1.12;
	text-wrap: balance;
}

/* On phones the long quotes ran to ten lines at xl. */
@media (max-width: 599px) {
	.wp-block-quote.is-style-pull p {
		font-size: var(--wp--preset--font-size--lg);
		line-height: 1.16;
	}
}

.wp-block-quote.is-style-pull p::before {
	content: "\201C";
}

.wp-block-quote.is-style-pull p:last-of-type::after {
	content: "\201D";
}

.wp-block-quote.is-style-pull cite {
	display: block;
	margin-top: var(--wp--preset--spacing--40);
	color: var(--mm-fg-2);
	font-family: var(--mm-sans);
	font-size: var(--wp--preset--font-size--sm);
	font-style: normal;
}

/* Images: rounded; "bleed" runs to the wide width. */
.wp-block-post-content .wp-block-image img {
	border-radius: var(--mm-r-lg);
}

.wp-block-image.is-style-bleed {
	max-width: var(--wp--style--global--wide-size) !important;
	margin-block: var(--wp--preset--spacing--70) !important;
}

.wp-block-image.is-style-bleed img {
	width: 100%;
}

.wp-block-image figcaption,
.wp-element-caption {
	margin-top: 0.75rem;
	color: var(--mm-fg-2);
	font-size: var(--wp--preset--font-size--xs);
	text-align: left;
}

/* Text beside a photo, five to seven. */
.wp-block-columns.mm-cols-5-7 {
	max-width: var(--wp--style--global--wide-size) !important;
	gap: var(--wp--preset--spacing--60);
	align-items: center !important;
	margin-block: var(--wp--preset--spacing--70) !important;
}

@media (min-width: 782px) {
	.wp-block-columns.mm-cols-5-7 > .wp-block-column:first-child {
		flex-basis: 41.66% !important;
	}

	.wp-block-columns.mm-cols-5-7 > .wp-block-column:last-child {
		flex-basis: 58.33% !important;
	}
}

/* A dark section inside the flow: a slab running to the wide width. */
.wp-block-group.is-style-section-dark {
	max-width: calc(var(--wp--style--global--wide-size) + 2 * var(--wp--preset--spacing--60)) !important;
	margin-block: var(--wp--preset--spacing--70) !important;
	padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--60);
	border-radius: var(--mm-slab-r);
}

.wp-block-group.is-style-section-dark > * {
	max-width: 42rem;
	margin-inline: auto;
}

/* Buttons from content: pills; the outline style follows the text colour. */
.wp-block-button.is-style-outline .wp-block-button__link {
	border-color: currentColor;
	background: transparent;
	color: var(--mm-fg);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--mm-fg);
	color: var(--mm-bg);
}

/* Tables in content (legal pages, specs in posts). */
/* Wide tables scroll inside their own frame on phones instead of widening the page. */
.wp-block-post-content .wp-block-table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
}

.wp-block-post-content .wp-block-table table {
	min-width: 32rem;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--sm);
}

.wp-block-post-content .wp-block-table th,
.wp-block-post-content .wp-block-table td {
	padding: 0.7rem 1rem 0.7rem 0;
	border: 0;
	border-bottom: 1px solid var(--mm-line);
	text-align: left;
	vertical-align: top;
}

.wp-block-post-content .wp-block-table thead th {
	border-bottom-color: var(--mm-fg);
	color: var(--mm-fg-2);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Families on the game tables page: each one a chapter. */
.mm-family {
	margin-block: var(--wp--preset--spacing--80) 0 !important;
}

.mm-family > h2 {
	font-size: var(--wp--preset--font-size--xl);
	line-height: 1.02;
}

.mm-family > .mm-grid {
	padding-inline: 0;
}

/* Article (single post) and generic page heads. */
.mm-article__head,
.mm-page__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40);
	margin-bottom: var(--wp--preset--spacing--60) !important;
}

.mm-article__meta {
	gap: 0.4rem 1rem;
	color: var(--mm-fg-2);
	font-size: var(--wp--preset--font-size--xs);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.mm-article__meta a {
	color: inherit;
	text-decoration: none;
}

.mm-article__meta .wp-block-post-date {
	color: inherit;
	font-size: inherit;
}

.mm-article__title,
.mm-page__title {
	max-width: 22ch;
	margin: 0;
	font-size: clamp(2.5rem, 1.4rem + 4vw, 5.5rem) !important;
	line-height: 1.02;
	letter-spacing: -0.02em;
}

.mm-article__standfirst p {
	max-width: 46ch;
	margin: 0;
	color: var(--mm-fg-2);
	font-family: var(--mm-display);
	font-size: var(--wp--preset--font-size--lg);
	line-height: 1.3;
}

.mm-article__image {
	margin-bottom: var(--wp--preset--spacing--60) !important;
}

.mm-article__image img {
	border-radius: var(--mm-r-lg);
}

.mm-article__tags {
	margin-top: var(--wp--preset--spacing--60) !important;
	color: var(--mm-fg-2);
	font-size: var(--wp--preset--font-size--sm);
}

.mm-article__tags a {
	color: inherit;
}

/* 404 and search. */
.mm-404 {
	padding-bottom: var(--wp--preset--spacing--80) !important;
}

.mm-404__inner {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	padding-block: var(--wp--preset--spacing--60);
}

.mm-404__title {
	max-width: 14ch;
	margin: 0;
	font-size: var(--wp--preset--font-size--display) !important;
	line-height: 0.98;
}

.mm-404__links {
	gap: 0.5rem;
}

.mm-search .wp-block-search__inside-wrapper {
	gap: 0.5rem;
	max-width: 36rem;
	padding: 0;
	border: 0;
}

.mm-search .wp-block-search__input {
	min-height: 52px;
	padding: 0 1.25rem;
	border: 1px solid var(--mm-line-strong);
	border-radius: var(--mm-r-pill);
	background: var(--mm-bg);
	color: var(--mm-fg);
	font: inherit;
}

.mm-search .wp-block-search__button {
	min-height: 52px;
	margin: 0;
	padding: 0 1.5rem;
	border: 1px solid var(--mm-accent);
	border-radius: var(--mm-r-pill);
	background: var(--mm-accent);
	color: var(--mm-on-accent);
	font-weight: 500;
}

.mm-news-page .mm-search {
	margin-bottom: var(--wp--preset--spacing--50) !important;
}

/* Catalogue choice as cards: cover, title, description, size; the checkbox on the cover. */
:root .mm-catalogues {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
	gap: var(--wp--preset--spacing--30);
}

:root .mm-catalogues .mm-catalogue {
	position: relative;
	display: block;
}

:root .mm-catalogue input {
	position: absolute;
	top: 1rem;
	right: 1rem;
	left: auto;
	z-index: 1;
	width: 1.4rem;
	height: 1.4rem;
	margin: 0;
}

:root .mm-catalogue label {
	display: grid;
	gap: 0.3rem;
	height: 100%;
	padding: 0.6rem 0.6rem 1rem;
	border: 1px solid var(--mm-line);
	border-radius: var(--mm-r-lg);
	background: var(--mm-bg);
	transition: border-color var(--mm-duration) var(--mm-ease), box-shadow var(--mm-duration) var(--mm-ease);
}

:root .mm-catalogue input:checked + label {
	border-color: var(--mm-fg);
	box-shadow: 0 0 0 1px var(--mm-fg);
}

:root .mm-catalogue__cover img {
	max-width: none;
	aspect-ratio: 4 / 3;
	margin-bottom: 0.4rem;
	object-fit: cover;
	border: 0;
}

:root .mm-catalogue__title {
	font-family: var(--mm-display-text);
	font-size: var(--wp--preset--font-size--md);
	line-height: 1.2;
}

/* A note in legal pages (draft status, reviews pending). */
.mm-legal-note {
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	border-radius: var(--mm-r-lg);
	background: var(--mm-surface);
	font-size: var(--wp--preset--font-size--sm) !important;
}

/* After a page cover, the content starts one generous step lower. */
.wp-block-post-content > .mm-cover + * {
	margin-block-start: var(--wp--preset--spacing--70) !important;
}

/* Offices and dealers (contact page). */
.mm-offices {
	margin-block: var(--wp--preset--spacing--80) 0 !important;
}

.mm-offices__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
}

.mm-offices__col {
	display: grid;
	align-content: start;
	gap: var(--wp--preset--spacing--40);
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--mm-fg);
}

.mm-offices .mm-office__region {
	margin: 0;
	color: var(--mm-fg-2);
	font-family: var(--mm-sans);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.mm-office h3 {
	margin: 0 0 0.4rem;
	font-size: var(--wp--preset--font-size--md);
}

.mm-office p {
	margin: 0;
	color: var(--mm-fg-2);
	font-size: var(--wp--preset--font-size--sm) !important;
	line-height: 1.6 !important;
}

@media (min-width: 700px) {
	.mm-offices__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1080px) {
	.mm-offices__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}
