/*
 * Decorative flourishes.
 *
 * Loaded after style.css (see inc/enqueue.php). style.css stays structural;
 * everything ornamental lives here so the two can be worked on independently.
 *
 * Design brief: this is a content-poor site — no performance photography, no
 * audio yet, several genuinely empty archives. The visual interest therefore
 * has to come from type, rule work, colour and structure rather than imagery.
 * Reference points are vintage blues gig posters and letterpress signage:
 * confident, a bit worn, hand-set rather than slick.
 *
 * Contents
 *   1.  Tokens and surface-aware colour
 *   2.  Paper grain
 *   3.  Rule work
 *   4.  Section and page headings
 *   5.  The shark as a graphic device
 *   6.  Bands and poster frames
 *   7.  Cards
 *   8.  Gig list
 *   9.  Empty states
 *   10. Long-form reading
 *   11. Links, buttons and focus
 *   12. Shark bite
 *   13. Track cards
 *   14. Signage devices
 *   15. Print and forced colours
 */

/* ======================================================================
 * 1. Tokens and surface-aware colour
 * ====================================================================== */

/*
 * Brass is the brand accent, but #a8712a only reaches 3.78:1 on Cream and
 * 3.34:1 on Sand — below the 4.5:1 WCAG AA minimum for normal-size text. It is
 * fine for rules, borders and large display type, and NOT fine for the eyebrow
 * headings, tagline and gig dates that currently use it.
 *
 * `--mts-brass-text` is the text-safe brass. It resolves to a deepened brass
 * (#8a5c1f — 5.26:1 on Cream, 4.65:1 on Sand) on light surfaces and flips to
 * Brass Light (#d3a04a — 8.01:1 on Stage Black) on dark ones, so the same rule
 * stays legible whichever surface a block lands on. Anything that paints brass
 * onto small text should use this token rather than --wp--preset--color--primary.
 */
:root {
	--mts-brass-text: var(--wp--custom--brass--text, #8a5c1f);
	--mts-rule: color-mix(in srgb, var(--wp--preset--color--primary) 55%, transparent);
	--mts-rule-strong: var(--wp--preset--color--primary);
	--mts-hairline: color-mix(in srgb, var(--wp--preset--color--contrast) 14%, transparent);
	--mts-shark: url("../images/shark-ink.png");
	--mts-shark-rule: url("../images/shark-brass.png");
}

/* Dark surfaces: flip the brass and the shark mark. */
:where(
	.wp-block-group.is-style-stage,
	.has-surface-dark-background-color,
	.has-contrast-background-color,
	footer.wp-block-group
) {
	--mts-brass-text: var(--wp--preset--color--primary-light);
	--mts-rule: color-mix(in srgb, var(--wp--preset--color--primary-light) 55%, transparent);
	--mts-rule-strong: var(--wp--preset--color--primary-light);
	--mts-hairline: color-mix(in srgb, var(--wp--preset--color--base) 22%, transparent);
	--mts-shark: url("../images/shark-cream.png");
}

/*
 * Fallback for browsers without color-mix(). The rules degrade to solid brass,
 * which is a slightly heavier hairline but perfectly acceptable.
 */
@supports not (color: color-mix(in srgb, red 50%, transparent)) {
	:root {
		--mts-rule: var(--wp--preset--color--primary);
		--mts-hairline: var(--wp--preset--color--base-2);
	}
}

/* Brass text colour now lives in style.css and reads --mts-brass-text
 * directly, so the override that used to sit here is no longer needed. */

/* ======================================================================
 * 2. Paper grain
 * ====================================================================== */

/*
 * A single tiled SVG turbulence pattern laid over the whole page at 3%. It
 * reads as paper tooth rather than as a texture, and it is what stops the
 * large flat areas of Cream from looking like an unstyled default.
 *
 * Generated in the browser (no binary asset, ~400 bytes) and desaturated with
 * feColorMatrix so it stays neutral grey rather than tinting the palette.
 *
 * Contrast impact is negligible: a 3% mid-grey veil moves Ink on Cream from
 * 16.35:1 to ~15.9:1 and Brass Deep on Cream from 5.26:1 to ~5.937:1 — both
 * still comfortably above AA. pointer-events is off so it never intercepts a
 * click, and it is removed for print and forced-colours.
 */
:root {
	--mts-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E");
}

body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 9998;
	pointer-events: none;
	background-image: var(--mts-grain);
	opacity: 0.03;
}

/* ======================================================================
 * 3. Rule work
 * ====================================================================== */

/*
 * The brass rule was rendering centred and detached — core centres separators
 * with `margin-left/right: auto`, and style.css caps it at 5rem, so it floated
 * in the middle of the column with nothing to attach to. It reads as a layout
 * bug. Anchor it to the start of the text column instead, where it works as a
 * section marker under a heading.
 *
 * Getting it there is fiddly: WordPress's constrained-layout CSS sets
 * `margin-left: auto !important; margin-right: auto !important` on every child
 * of a constrained group, which no amount of specificity will beat. Rather
 * than answering with more `!important`, let the element span the full column
 * and paint only the first 4.5rem of it with a background gradient. The auto
 * margins then have nothing to centre and the rule lands where it should.
 */
/*
 * Core sets `width: 100px` on separators via
 * `.wp-block-separator:not(.is-style-wide):not(.is-style-dots)` — specificity
 * (0,3,0). Every custom separator style here has to clear that bar to span the
 * column, hence the otherwise-redundant `:not(.is-style-wide)`, which brings
 * these selectors to (0,3,1).
 *
 * `width: auto` lets the box fill its container and `max-width` caps it at the
 * global content size — which is what the constrained layout would have done
 * on its own. The result lines up with the headings above it instead of
 * spanning the full wide container.
 */
hr.wp-block-separator.is-style-brass:not(.is-style-wide),
hr.wp-block-separator.is-style-double:not(.is-style-wide),
hr.wp-block-separator.is-style-shark:not(.is-style-wide) {
	width: auto;
	max-width: var(--wp--style--global--content-size);
}

hr.wp-block-separator.is-style-brass {
	height: 3px;
	border: 0;
	opacity: 1;
	background-color: transparent;
	background-image: var(--wp--preset--gradient--brass-sweep);
	background-repeat: no-repeat;
	background-size: 4.5rem 100%;
	background-position: left center;
}

[dir="rtl"] hr.wp-block-separator.is-style-brass {
	background-position: right center;
}

/*
 * A brass rule straight after a heading is that heading's underline, not a
 * separate block. Pull it up tight against the heading and let the generous
 * block gap fall after it, so the pair reads as one unit.
 */
.wp-block-heading + hr.wp-block-separator.is-style-brass {
	margin-block-start: 0.7rem;
	margin-block-end: var(--wp--preset--spacing--40);
}

/* Honour an explicit centre alignment if the client sets one. */
hr.wp-block-separator.is-style-brass.aligncenter {
	background-position: center;
}

/*
 * Double rule — a thick/thin pair, the classic letterpress section break.
 * Registered as a block style so it is pickable from the sidebar.
 */
hr.wp-block-separator.is-style-double {
	margin-inline: 0;
	max-width: none;
	height: 0;
	border: 0;
	border-top: 3px solid var(--mts-rule-strong);
	border-bottom: 1px solid var(--mts-rule-strong);
	padding-block-start: 3px;
	opacity: 1;
	background: none;
}

/*
 * Shark divider — the mark centred in a hairline, used to break long stretches
 * of text. This is the motif doing structural work rather than sitting in the
 * corner as a logo.
 */
hr.wp-block-separator.is-style-shark {
	position: relative;
	max-width: none;
	margin-block: var(--wp--preset--spacing--50);
	margin-inline: 0;
	height: 0;
	border: 0;
	border-top: 1px solid var(--mts-hairline);
	opacity: 1;
	background: none;
	overflow: visible;
}

hr.wp-block-separator.is-style-shark::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 2.75rem;
	height: 2.75rem;
	transform: translate(-50%, -50%);
	background-color: var(--wp--preset--color--base);
	background-image: var(--mts-shark-rule);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 1.75rem auto;
	border-radius: 50%;
}

/* On a dark band the knockout disc has to match that surface, not Cream. */
:where(
	.wp-block-group.is-style-stage,
	.has-surface-dark-background-color,
	footer.wp-block-group
) hr.wp-block-separator.is-style-shark::after {
	background-color: var(--wp--preset--color--surface-dark);
}

/* ======================================================================
 * 4. Section and page headings
 * ====================================================================== */

/*
 * Every page title gets a short brass rule above it. It costs nothing, needs
 * no editor action, and it is the single cheapest way to make a page read as
 * designed rather than as a default H1 sitting on a blank field.
 */
.wp-block-post-title:not(.has-background)::before,
.wp-block-query-title::before,
/* The shop front is the one section title that is a plain heading block rather
   than a post or query title, so it needs naming here or it loses the rule. */
.mts-shop-header__title::before,
.wp-block-heading.is-style-marquee::before,
.wp-block-heading.is-style-rule-above::before {
	content: "";
	display: block;
	width: 3.5rem;
	height: 3px;
	margin-block-end: var(--wp--preset--spacing--30);
	background: var(--wp--preset--gradient--brass-sweep);
}

/*
 * Titles inside a query loop are list items, not page titles — a rule above
 * each one would read as a divider between posts. Reset them.
 */
.wp-block-post-template .wp-block-post-title::before {
	content: none;
}

/* An eyebrow immediately before a marquee already marks the section. */
.is-style-eyebrow + .wp-block-heading.is-style-marquee::before {
	display: none;
}

/*
 * Marquee headings are the main visual event on a page with no photography.
 * Push the scale contrast further than the default and tighten the setting so
 * it reads as hand-set poster type rather than a large web heading.
 */
.wp-block-heading.is-style-marquee {
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 0.9;
	text-transform: uppercase;
	text-wrap: balance;
}

/*
 * Eyebrow — small, wide-tracked, brass. Given a leading tick so it reads as a
 * label attached to the section rather than a floating line of small caps.
 */
.wp-block-heading.is-style-eyebrow,
p.is-style-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.7em;
}

.wp-block-heading.is-style-eyebrow::before,
p.is-style-eyebrow::before {
	content: "";
	flex: 0 0 auto;
	width: 1.5rem;
	height: 2px;
	background: currentColor;
}

/* Centred eyebrows (used inside centred CTA bands) get a tick on both sides. */
.wp-block-heading.is-style-eyebrow.has-text-align-center,
p.is-style-eyebrow.has-text-align-center {
	justify-content: center;
}

.wp-block-heading.is-style-eyebrow.has-text-align-center::after,
p.is-style-eyebrow.has-text-align-center::after {
	content: "";
	flex: 0 0 auto;
	width: 1.5rem;
	height: 2px;
	background: currentColor;
}

/* ======================================================================
 * 5. The shark as a graphic device
 * ====================================================================== */

/*
 * A large, very low-opacity shark bleeding off the right edge of dark bands.
 * On the home page hero this fills what is otherwise a big empty rectangle of
 * Stage Black, and it does it with an asset the site already ships.
 *
 * Decorative only — no meaning is carried by it, it is not announced to
 * assistive technology, and it sits behind the content at 6% so it cannot
 * affect text contrast.
 */
.wp-block-group.is-style-stage {
	position: relative;
	isolation: isolate;
	overflow: hidden;
}

/*
 * Kept fully inside the band rather than bled off the edge: a cropped
 * silhouette reads as a rendering artifact, a contained one reads as a
 * watermark. Sized off the band's own height so it stays proportionate
 * whether the band is a tall hero or a short call to action.
 */
.wp-block-group.is-style-stage::before {
	content: "";
	position: absolute;
	z-index: -1;
	top: 50%;
	right: clamp(1rem, 4vw, 4rem);
	width: min(32vw, 20rem);
	aspect-ratio: 1;
	transform: translateY(-50%);
	background-image: url("../images/shark-cream.png");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.045;
	pointer-events: none;
	/* The mark has a flat base; fade it out so it dissolves into the band
	   rather than ending on a hard horizontal edge. */
	-webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 96%);
	mask-image: linear-gradient(to bottom, #000 50%, transparent 96%);
}

/* Below the breakpoint the watermark would sit under the text — drop it.
   781, not 782: core stacks wp:columns at max-width: 781px, so 782 was one
   pixel of desktop layout wearing mobile rules. */
@media (max-width: 781px) {
	.wp-block-group.is-style-stage::before {
		display: none;
	}
}

/*
 * Blockquote mark. The theme already has a brass left border on quotes; add
 * the shark as the quote mark so pull quotes carry the motif too.
 */
.wp-block-quote:not(.is-style-testimonial) {
	position: relative;
}

.wp-block-quote.is-style-testimonial::before {
	content: "";
	display: block;
	width: 2.25rem;
	height: 2.25rem;
	margin: 0 auto var(--wp--preset--spacing--20);
	background-image: var(--mts-shark);
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.55;
}

/* ======================================================================
 * 6. Bands and poster frames
 * ====================================================================== */

/*
 * Band — a Sand-coloured full-bleed section. Alternating Cream and Sand is
 * what gives a long, image-free page its rhythm. Registered as a block style
 * so the client can toggle it per section from the sidebar.
 */
.wp-block-group.is-style-band {
	background-color: var(--wp--preset--color--base-2);
	border-block: 1px solid var(--mts-hairline);
}

/* A band with no padding set still needs breathing room. */
.wp-block-group.is-style-band:not([style*="padding"]) {
	padding-block: var(--wp--preset--spacing--60);
}

/*
 * Poster frame — a double brass rule around a section, the way a gig poster
 * boxes its billing. Useful for pulling a single important block (a booking
 * note, a price list) out of the flow without needing an image.
 */
.wp-block-group.is-style-poster {
	position: relative;
	padding: var(--wp--preset--spacing--50);
	border: 3px solid var(--mts-rule-strong);
	outline: 1px solid var(--mts-rule-strong);
	outline-offset: 4px;
}

/* Keep the outer hairline from being clipped at the edge of the viewport. */
.wp-block-group.is-style-poster {
	margin-inline: 5px;
}

/* ======================================================================
 * 7. Cards
 * ====================================================================== */

/*
 * Cards get a brass top edge that fills in on hover — a considered state
 * change that does not rely on colour alone (the border weight and shadow
 * change too) and does not move layout.
 */
.wp-block-group.is-style-card {
	position: relative;
	overflow: hidden;
	transition:
		box-shadow var(--wp--custom--transition--base),
		border-color var(--wp--custom--transition--base);
}

.wp-block-group.is-style-card::before {
	content: "";
	position: absolute;
	inset-block-start: 0;
	inset-inline: 0;
	height: 3px;
	background: var(--wp--preset--gradient--brass-sweep);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform var(--wp--custom--transition--base);
}

.wp-block-group.is-style-card:hover,
.wp-block-group.is-style-card:focus-within {
	border-color: var(--mts-rule-strong);
	box-shadow: var(--wp--preset--shadow--lifted);
}

.wp-block-group.is-style-card:hover::before,
.wp-block-group.is-style-card:focus-within::before {
	transform: scaleX(1);
}

/*
 * style.css already carries a global prefers-reduced-motion block that zeroes
 * transition durations. This additionally removes the sweep itself, so the
 * brass edge simply appears rather than animating in.
 */
@media (prefers-reduced-motion: reduce) {
	.wp-block-group.is-style-card::before {
		transition: none;
	}

	.wp-block-group.is-style-card:hover::before,
	.wp-block-group.is-style-card:focus-within::before {
		transform: none;
	}
}

/* ======================================================================
 * 8. Gig list
 * ====================================================================== */

/*
 * The gig row is the closest thing this site has to a listing, so it earns a
 * little detail: a brass tick that grows on hover, and a Sand wash across the
 * row. Both the tick and the wash change together, so the affordance is not
 * carried by colour alone.
 */
.mts-gig {
	position: relative;
	transition: background-color var(--wp--custom--transition--base);
}

.mts-gig::before {
	content: "";
	position: absolute;
	inset-block: 0;
	inset-inline-start: calc(var(--wp--preset--spacing--20) * -1);
	width: 3px;
	background: var(--mts-rule-strong);
	transform: scaleY(0);
	transform-origin: center top;
	transition: transform var(--wp--custom--transition--base);
}

.mts-gig:hover,
.mts-gig:focus-within {
	background-color: var(--wp--preset--color--base-2);
}

.mts-gig:hover::before,
.mts-gig:focus-within::before {
	transform: scaleY(1);
}

@media (prefers-reduced-motion: reduce) {
	.mts-gig::before {
		transition: none;
	}

	.mts-gig:hover::before,
	.mts-gig:focus-within::before {
		transform: none;
	}
}

/* Tabular figures keep the date column optically aligned row to row. */
.mts-gig__date {
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
}

/* ======================================================================
 * 9. Empty states
 * ====================================================================== */

/*
 * Several archives are legitimately empty — there are no gigs booked and no
 * tracks uploaded. Rendered as a bare paragraph that looks like a bug. This
 * turns emptiness into something that looks deliberate: a Sand plate, double
 * brass rules, the shark mark, and the copy set in the display face.
 *
 * Applies to core's query-no-results wrapper, so it covers every archive and
 * search result automatically without touching the copy in any template.
 */
/*
 * The thick/thin double rule is drawn with a 3px border plus a 1px gradient
 * layer, rather than with ::before/::after — those are needed for the shark
 * mark, and the plate's first child is an eyebrow heading that already uses
 * its own ::before for the eyebrow tick.
 */
.wp-block-query-no-results {
	position: relative;
	margin-block: var(--wp--preset--spacing--50);
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
	background-color: var(--wp--preset--color--base-2);
	background-image:
		linear-gradient(var(--mts-rule-strong), var(--mts-rule-strong)),
		linear-gradient(var(--mts-rule-strong), var(--mts-rule-strong));
	background-repeat: no-repeat;
	background-size: 100% 1px, 100% 1px;
	background-position: 0 5px, 0 calc(100% - 5px);
	border-block: 3px solid var(--mts-rule-strong);
	text-align: center;
}

/*
 * The shark mark sits above the copy. Decorative, so it is a background on a
 * pseudo-element rather than an <img> — nothing for a screen reader to
 * announce, and no meaning is lost without it.
 */
.wp-block-query-no-results::before {
	content: "";
	display: block;
	width: 3rem;
	height: 3rem;
	margin: 0 auto var(--wp--preset--spacing--30);
	background-image: var(--mts-shark);
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.35;
}

.wp-block-query-no-results > :last-child {
	margin-block-end: 0;
}

/* The eyebrow label above the message. */
.wp-block-query-no-results .is-style-eyebrow {
	justify-content: center;
	margin-block-end: var(--wp--preset--spacing--20);
}

.wp-block-query-no-results p {
	max-width: 34rem;
	margin-inline: auto;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 300;
	line-height: 1.4;
	text-wrap: balance;
	color: var(--wp--preset--color--contrast);
}

/*
 * Midnight Blue on Sand is 9.34:1 — the link stays the strongest thing here.
 *
 * Buttons are excluded deliberately: they carry their own background from
 * theme.json (Ink), and recolouring their label to Midnight Blue dropped them
 * to roughly 1.5:1 — effectively invisible.
 */
.wp-block-query-no-results a:where(:not(.wp-element-button):not(.wp-block-button__link)) {
	color: var(--wp--preset--color--secondary);
	text-underline-offset: 0.18em;
	text-decoration-thickness: 2px;
}

.wp-block-query-no-results a:where(:not(.wp-element-button):not(.wp-block-button__link)):hover {
	color: var(--wp--preset--color--accent);
}

/*
 * The plate sits on Sand, so the button needs a little separation from it.
 * Cream on Ink is 17.22:1.
 */
.wp-block-query-no-results .wp-block-buttons {
	margin-block-start: var(--wp--preset--spacing--40);
}

/* ======================================================================
 * 10. Long-form reading
 * ====================================================================== */

/*
 * Drop cap. Deliberately hung off core's own `has-drop-cap` class rather than
 * a bespoke one, so the client sets it with the toggle already in the
 * paragraph sidebar and nothing new has to be explained.
 *
 * Brass on Cream is 3.78:1, which is below AA for body text but above the 3:1
 * threshold for large text — and at ~4.5rem this is unambiguously large. The
 * letter is also still present in the text flow, so no content depends on it.
 */
.has-drop-cap:not(:focus)::first-letter {
	float: left;
	margin-inline-end: 0.08em;
	margin-block-start: 0.06em;
	padding-inline-end: 0.06em;
	font-family: var(--wp--preset--font-family--display);
	font-size: 4.6em;
	font-weight: 600;
	line-height: 0.76;
	color: var(--wp--preset--color--primary);
	text-transform: uppercase;
}

/*
 * Lead paragraph — the standfirst under a title. Registered as a block style
 * so it is a sidebar choice rather than a manual font-size override.
 */
p.is-style-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
	color: var(--wp--preset--color--contrast-2);
	text-wrap: pretty;
}

/*
 * Numbered section markers for the long-form template. The counter is on the
 * template wrapper, so it only runs on pages the client has actually assigned
 * the "Page — Long-form Essay" template to.
 *
 * The number is generated content on a ::before, which assistive technology
 * may or may not announce — either way the heading text itself is unchanged
 * and still carries the full meaning.
 */
.is-longform .wp-block-post-content {
	counter-reset: mts-section;
}

.is-longform .wp-block-post-content > h2 {
	counter-increment: mts-section;
	position: relative;
	padding-block-start: var(--wp--preset--spacing--30);
	border-block-start: 1px solid var(--mts-hairline);
}

.is-longform .wp-block-post-content > h2::before {
	content: counter(mts-section, decimal-leading-zero);
	display: block;
	margin-block-end: 0.35em;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	letter-spacing: 0.18em;
	color: var(--mts-brass-text);
}

/* Long-form measure and rhythm for the essays, which are paragraph-heavy. */
.is-longform .wp-block-post-content > p {
	margin-block-end: 1.1em;
}

/* ======================================================================
 * 11. Links, buttons and focus
 * ====================================================================== */

/*
 * Accent underline: links in running text get a brass underline that thickens
 * and switches to the accent colour on hover. The underline is always present,
 * so the link is never signalled by colour alone.
 */
.wp-block-post-content a:where(:not(.wp-element-button):not(.wp-block-button__link)),
.entry-content a:where(:not(.wp-element-button):not(.wp-block-button__link)) {
	text-decoration-color: var(--mts-rule-strong);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.18em;
	transition:
		text-decoration-color var(--wp--custom--transition--base),
		color var(--wp--custom--transition--base);
}

.wp-block-post-content a:where(:not(.wp-element-button):not(.wp-block-button__link)):hover,
.entry-content a:where(:not(.wp-element-button):not(.wp-block-button__link)):hover {
	text-decoration-color: currentColor;
}

/*
 * Buttons get a slight letterpress press-down on click. Tiny, and the global
 * reduced-motion block in style.css already neutralises the duration.
 */
.wp-element-button:active,
.wp-block-button__link:active {
	transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
	.wp-element-button:active,
	.wp-block-button__link:active {
		transform: none;
	}
}

/*
 * style.css owns the focus ring. Nothing here removes or weakens it — this
 * only guarantees the ring is never painted under the grain overlay or an
 * ornamental pseudo-element.
 */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	position: relative;
	z-index: 1;
}

/* ======================================================================
 * 12. Shark bite
 * ====================================================================== */

/*
 * A bite out of the edge of a container, in any of six positions. Opt-in block
 * styles (see inc/blocks.php) on core/group and core/image — block styles are
 * single-select, so the client picks one edge per block.
 *
 * Two mask layers composited with `exclude` (XOR): a full-coverage rectangle
 * minus a bite-shaped blob. The blob is one cubic curve (the jaw) plus five
 * circles sitting on it (the teeth); the teeth are what stop it reading as a
 * plain scallop.
 *
 * The rim is not decoration. A mask only makes the bite transparent, revealing
 * whatever is behind — fine for Stage Black on Cream (17.22:1), invisible in
 * the cases that matter: Sand on Cream is 1.24:1 and the white card on Cream
 * 1.10:1. The rim is a ::after filled with brass and masked by a *stroked*
 * copy of the same jaw. The container's own mask then eats the inner half of
 * that stroke, leaving the outer half as a rim following the jaw and broken
 * where each tooth punctures it. Because the rim reuses the container's
 * position and size variables it needs no per-position offset maths, and
 * because the colour comes from a custom property rather than being baked into
 * the SVG, the light/dark flip is free.
 *
 * Four orientations are needed (jaw opening down, up, right, left). They are
 * the same artwork rotated inside the SVG, so there is one path to maintain.
 *
 * Width is clamped in vw, not %, so the bite stays a roughly constant physical
 * size instead of growing with its container: ~64px at a 320px viewport (20%
 * of a full-width band) and ~112px at 1400px (a deliberate notch, not a bay).
 */
:root {
	--mts-bite-w: clamp(4rem, 8vw, 7rem);
	--mts-bite-d: calc(var(--mts-bite-w) * 52 / 120);
	/*
	 * Capped at 18% at the point of use, so a container narrower than the
	 * inset plus the bite (a small image, say) still gets the bite inside its
	 * own edge rather than hanging off the end.
	 */
	--mts-bite-inset: clamp(1rem, 6vw, 5rem);
	--mts-bite-i: min(var(--mts-bite-inset), 18%);
	--mts-bite-clear: calc(var(--mts-bite-d) + var(--wp--preset--spacing--30));

	/* Jaw opening down — a bite out of the top edge. */
	--mts-bite-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 52'%3E%3Cg fill='%23000'%3E%3Cpath d='M0 0C0 52 120 52 120 0Z'/%3E%3Ccircle cx='12.5' cy='25' r='7'/%3E%3Ccircle cx='33.8' cy='35.5' r='7'/%3E%3Ccircle cx='60' cy='39' r='7'/%3E%3Ccircle cx='86.2' cy='35.5' r='7'/%3E%3Ccircle cx='107.5' cy='25' r='7'/%3E%3C/g%3E%3C/svg%3E");
	/* Jaw opening up — a bite out of the bottom edge. */
	--mts-bite-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 52'%3E%3Cg fill='%23000' transform='rotate(180 60 26)'%3E%3Cpath d='M0 0C0 52 120 52 120 0Z'/%3E%3Ccircle cx='12.5' cy='25' r='7'/%3E%3Ccircle cx='33.8' cy='35.5' r='7'/%3E%3Ccircle cx='60' cy='39' r='7'/%3E%3Ccircle cx='86.2' cy='35.5' r='7'/%3E%3Ccircle cx='107.5' cy='25' r='7'/%3E%3C/g%3E%3C/svg%3E");
	/* Jaw opening right — a bite out of the left edge. */
	--mts-bite-in-r: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 120'%3E%3Cg fill='%23000' transform='rotate(-90) translate(-120 0)'%3E%3Cpath d='M0 0C0 52 120 52 120 0Z'/%3E%3Ccircle cx='12.5' cy='25' r='7'/%3E%3Ccircle cx='33.8' cy='35.5' r='7'/%3E%3Ccircle cx='60' cy='39' r='7'/%3E%3Ccircle cx='86.2' cy='35.5' r='7'/%3E%3Ccircle cx='107.5' cy='25' r='7'/%3E%3C/g%3E%3C/svg%3E");
	/* Jaw opening left — a bite out of the right edge. */
	--mts-bite-in-l: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 120'%3E%3Cg fill='%23000' transform='rotate(90) translate(0 -52)'%3E%3Cpath d='M0 0C0 52 120 52 120 0Z'/%3E%3Ccircle cx='12.5' cy='25' r='7'/%3E%3Ccircle cx='33.8' cy='35.5' r='7'/%3E%3Ccircle cx='60' cy='39' r='7'/%3E%3Ccircle cx='86.2' cy='35.5' r='7'/%3E%3Ccircle cx='107.5' cy='25' r='7'/%3E%3C/g%3E%3C/svg%3E");

	/* Stroked copies of the jaw, used to mask the brass rim. */
	--mts-rim-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 52'%3E%3Cpath d='M0 0C0 52 120 52 120 0' fill='none' stroke='%23000' stroke-width='5'/%3E%3C/svg%3E");
	--mts-rim-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 52'%3E%3Cpath d='M0 0C0 52 120 52 120 0' fill='none' stroke='%23000' stroke-width='5' transform='rotate(180 60 26)'/%3E%3C/svg%3E");
	--mts-rim-in-r: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 120'%3E%3Cpath d='M0 0C0 52 120 52 120 0' fill='none' stroke='%23000' stroke-width='5' transform='rotate(-90) translate(-120 0)'/%3E%3C/svg%3E");
	--mts-rim-in-l: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 120'%3E%3Cpath d='M0 0C0 52 120 52 120 0' fill='none' stroke='%23000' stroke-width='5' transform='rotate(90) translate(0 -52)'/%3E%3C/svg%3E");
}

/*
 * Everything is gated behind the mask-composite test. If it fails, not one
 * declaration lands and the container is an ordinary rectangle — no half-
 * applied mask, no stray rim. Covers Firefox (standard), Safari 15.4+ (both)
 * and Chrome before 120 (the -webkit- keyword set).
 */
@supports (mask-composite: exclude) or (-webkit-mask-composite: xor) {
	/*
	 * Per-position setup. Each variant only chooses an orientation, a position
	 * and which way round the tile sits; all the masking machinery below is
	 * shared, so adding a position is four lines rather than a new copy.
	 *
	 * Only the mouth is given a length; the other axis is `auto` so the depth
	 * comes from the SVG's own 120:52 ratio and the jaw can never distort.
	 *
	 * The mouth is additionally capped at 55% of the edge it sits on. Without
	 * that cap a bite longer than its container gets clipped by the container
	 * and reads as a slice off the edge rather than a bite — which is exactly
	 * what a side bite did on a short band.
	 */
	.is-style-bite-top-left,
	.is-style-bite-top-right {
		--mts-bite-img: var(--mts-bite-down);
		--mts-bite-rim-img: var(--mts-rim-down);
		--mts-bite-sz: min(var(--mts-bite-w), 55%) auto;
	}

	.is-style-bite-bottom-left,
	.is-style-bite-bottom-right {
		--mts-bite-img: var(--mts-bite-up);
		--mts-bite-rim-img: var(--mts-rim-up);
		--mts-bite-sz: min(var(--mts-bite-w), 55%) auto;
	}

	/* Side bites turn the tile on its end: depth is now horizontal. */
	.is-style-bite-left {
		--mts-bite-img: var(--mts-bite-in-r);
		--mts-bite-rim-img: var(--mts-rim-in-r);
		--mts-bite-sz: auto min(var(--mts-bite-w), 55%);
		--mts-bite-pos: 0 50%;
	}

	.is-style-bite-right {
		--mts-bite-img: var(--mts-bite-in-l);
		--mts-bite-rim-img: var(--mts-rim-in-l);
		--mts-bite-sz: auto min(var(--mts-bite-w), 55%);
		--mts-bite-pos: 100% 50%;
	}

	.is-style-bite-top-left {
		--mts-bite-pos: left var(--mts-bite-i) top 0;
	}

	.is-style-bite-top-right {
		--mts-bite-pos: right var(--mts-bite-i) top 0;
	}

	.is-style-bite-bottom-left {
		--mts-bite-pos: left var(--mts-bite-i) bottom 0;
	}

	.is-style-bite-bottom-right {
		--mts-bite-pos: right var(--mts-bite-i) bottom 0;
	}

	/* The shared mask. Applies to the group box and to the image itself. */
	.wp-block-group[class*="is-style-bite-"],
	.wp-block-image[class*="is-style-bite-"] img {
		-webkit-mask-image: var(--mts-bite-img), linear-gradient(#000, #000);
		mask-image: var(--mts-bite-img), linear-gradient(#000, #000);
		-webkit-mask-repeat: no-repeat, no-repeat;
		mask-repeat: no-repeat, no-repeat;
		-webkit-mask-position: var(--mts-bite-pos), 0 0;
		mask-position: var(--mts-bite-pos), 0 0;
		-webkit-mask-size: var(--mts-bite-sz), 100% 100%;
		mask-size: var(--mts-bite-sz), 100% 100%;
		-webkit-mask-composite: xor, source-over;
		mask-composite: exclude, add;
	}

	.wp-block-group[class*="is-style-bite-"] {
		position: relative;
		isolation: isolate;
	}

	/*
	 * The rim. z-index -1 puts it above the container's own background and
	 * below its content, and the container's mask trims its inner half.
	 * --mts-brass-text is used rather than the lighter rule brass because it
	 * carries the edge properly on Cream (5.26:1) and still flips to Brass
	 * Light on dark surfaces (8.01:1).
	 */
	.wp-block-group[class*="is-style-bite-"]::after {
		content: "";
		position: absolute;
		z-index: -1;
		inset: 0;
		background-color: var(--mts-brass-text);
		-webkit-mask-image: var(--mts-bite-rim-img);
		mask-image: var(--mts-bite-rim-img);
		-webkit-mask-repeat: no-repeat;
		mask-repeat: no-repeat;
		-webkit-mask-position: var(--mts-bite-pos);
		mask-position: var(--mts-bite-pos);
		-webkit-mask-size: var(--mts-bite-sz);
		mask-size: var(--mts-bite-sz);
		pointer-events: none;
	}

	/*
	 * Clearance, which has to follow the bite: a mask clips descendants, so
	 * without it the jaw would eat any text reaching into it. !important is
	 * needed to beat the inline padding the editor writes when the client sets
	 * padding from the sidebar — a container the client can silently make
	 * illegible is not worth the lower specificity.
	 *
	 * Trade-off worth knowing: this normalises the bitten edge rather than only
	 * raising it, so a container given padding larger than the clearance is
	 * brought back down to it on that one edge. The other three sides are left
	 * alone. Clipped text is the worse failure, so it is set this way round.
	 */
	.wp-block-group.is-style-bite-top-left,
	.wp-block-group.is-style-bite-top-right {
		padding-block-start: max(var(--wp--preset--spacing--50), var(--mts-bite-clear)) !important;
	}

	.wp-block-group.is-style-bite-bottom-left,
	.wp-block-group.is-style-bite-bottom-right {
		padding-block-end: max(var(--wp--preset--spacing--50), var(--mts-bite-clear)) !important;
	}

	.wp-block-group.is-style-bite-left {
		padding-inline-start: max(var(--wp--preset--spacing--30), var(--mts-bite-clear)) !important;
	}

	.wp-block-group.is-style-bite-right {
		padding-inline-end: max(var(--wp--preset--spacing--30), var(--mts-bite-clear)) !important;
	}
}

/* ======================================================================
 * 13. Track cards
 * ====================================================================== */

/*
 * Three tracks, none with audio and only one with cover art. The default card
 * — featured image, title, meta line — rendered as a title floating in a white
 * box above a blank paragraph, because the image and the meta were both empty.
 *
 * Rebuilt as a record-sleeve listing: brass head rule, set track number, title
 * in the display face, then recording location and credits as a caption block.
 * Composed around the absence instead of leaving a hole where artwork was meant
 * to go. Cover art is welcome but not required — one track has some and fits.
 */
.mts-track {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	height: 100%;
	padding: var(--wp--preset--spacing--40);
	overflow: hidden;
	background-color: #fff;
	border: 1px solid var(--mts-hairline);
	border-block-start: 3px solid var(--mts-rule-strong);
	transition:
		box-shadow var(--wp--custom--transition--base),
		border-color var(--wp--custom--transition--base);
}

.mts-track:hover,
.mts-track:focus-within {
	border-color: var(--mts-rule-strong);
	box-shadow: var(--wp--preset--shadow--lifted);
}

/*
 * The track number. A counter rather than hand-typed markup, so the client can
 * add, remove or reorder tracks and the numbering simply follows. Reset on
 * every post-template but only incremented on track rows, so no other archive
 * is affected. Ordering is pinned in inc/blocks.php — two tracks share a
 * timestamp, so date alone left the numbering free to swap between requests.
 * 5.78:1 on white.
 */
.wp-block-post-template {
	counter-reset: mts-track;
}

.wp-block-post-template > li.type-mts_track {
	counter-increment: mts-track;
}

.mts-track::before {
	content: counter(mts-track, decimal-leading-zero);
	display: block;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.08em;
	color: var(--mts-brass-text);
	font-variant-numeric: tabular-nums;
}

/*
 * The sleeve. A track with no cover art gets a designed panel in place of one
 * rather than a faint watermark tucked behind the text — an earlier 0.03
 * treatment was invisible enough that the client read the mark as missing.
 *
 * Same 16/9 box the real artwork occupies, so the grid keeps its rhythm either
 * way, and the shark is the subject of it: the mark on Stage Black, lit by a
 * warm radial wash so the panel reads as a lit stage rather than a flat swatch.
 * Decorative, so it is a background rather than an <img> — the track title next
 * to it already carries the meaning.
 */
/*
 * Card media — the sleeve, or real cover art where a track has some. Exactly
 * one of the two is ever visible: core omits the figure entirely when there is
 * no thumbnail, and the sleeve is hidden when there is one.
 *
 * The full bleed is declared once, here, for both. Cancelling the card's
 * padding with a negative margin on a child only holds while that child is
 * there, so the two must never drift apart — if only one carried the bleed,
 * the other would leave the card's padding exposed above it. Keeping it a
 * single shared contract is what stops that being possible.
 *
 * With neither present the card simply keeps its own padding, which is a
 * tidy result rather than a broken one.
 *
 * The three-class selector is deliberate and load-bearing. WordPress prints
 * `:root :where(.is-layout-flow) > :first-child { margin-block-start: 0 }`
 * inline in the head, after this stylesheet, at specificity (0,2,0). The
 * sleeve is the card's first DOM child, so a (0,1,0) or (0,2,0) selector here
 * loses on source order and the sleeve's negative top margin is silently
 * zeroed — which is exactly the reported bug: cards with cover art sat 3px
 * from the card's top edge, cards with the sleeve sat 39px. Cover art escaped
 * only because the figure is never the first DOM child. Going to (0,3,0)
 * outranks core on specificity rather than source order, so it holds wherever
 * WordPress chooses to print its layout CSS, and it covers the figure too in
 * case it ever becomes the first child.
 */
.wp-block-group.mts-track > .mts-track__sleeve,
.wp-block-group.mts-track > .wp-block-post-featured-image {
	margin: calc(var(--wp--preset--spacing--40) * -1)
		calc(var(--wp--preset--spacing--40) * -1) var(--wp--preset--spacing--20);
}

.mts-track__sleeve {
	order: -2;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 9;
	background-color: var(--wp--preset--color--surface-dark);
	background-image: radial-gradient(
		ellipse at 50% 42%,
		rgba(211, 160, 74, 0.22),
		transparent 62%
	);
	border-block-end: 3px solid var(--mts-rule-strong);
}

/*
 * shark-cream.png, not shark-brass.png. Despite the name the "brass" asset is
 * a near-black silhouette (it averages rgb(43,43,43)), so on Stage Black it
 * disappeared; the cream mark averages rgb(237,237,237) and carries the panel.
 * The brass in this sleeve comes from the radial wash behind the mark instead.
 */
.mts-track__sleeve::before {
	content: "";
	width: 42%;
	aspect-ratio: 1;
	background-image: url("../images/shark-cream.png");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.92;
}

/*
 * Real cover art wins when a track has any. Browsers without :has() show the
 * sleeve as well, which is the right way round to fail: every track keeps a
 * mark, and only the one track that has artwork looks doubled up.
 */
@supports selector(:has(*)) {
	.mts-track:has(.wp-block-post-featured-image img) .mts-track__sleeve {
		display: none;
	}
}

/*
 * The hairline under the title is a border rather than a separator block, so
 * there is one less piece of markup for the client to delete by accident and
 * no fight with core's own separator styles.
 */
.mts-track .wp-block-post-title {
	margin: 0;
	padding-block-end: var(--wp--preset--spacing--20);
	border-block-end: 1px solid var(--mts-hairline);
	font-size: var(--wp--preset--font-size--large);
	text-wrap: balance;
}

/*
 * `order` is load-bearing: the track number is a ::before and therefore comes
 * first in flex order, so without this the art's negative top margin rides up
 * over the number and hides it. The bleed itself is declared with the sleeve's,
 * above.
 */
.mts-track .wp-block-post-featured-image {
	order: -1;
}

.mts-track .wp-block-post-featured-image img {
	width: 100%;
	object-fit: cover;
}

/*
 * Recording location — set as a small caps label because on most of these it
 * is the only concrete fact about the recording. 5.78:1 on white.
 */
.mts-track__recorded {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	line-height: 1.35;
	color: var(--mts-brass-text);
}

/* Credits. Slate on white is 8.14:1. */
.mts-track__credits {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
	color: var(--wp--preset--color--contrast-2);
}

/*
 * Bindings return an empty string when the meta is unset, and core still
 * renders the empty paragraph. Collapse them so a track with no recording
 * location does not carry a mystery gap.
 */
.mts-track__recorded:empty,
.mts-track__credits:empty {
	display: none;
}

/*
 * The card's state plate. Two mutually exclusive versions on the same chassis,
 * pinned to the bottom of the card so they line up across a grid row: "Watch"
 * when the track has a video or audio embed on the single, and "no recording
 * yet" when there is genuinely nothing.
 *
 * Both are labels, not controls. The card title is already the link to the
 * track, and a second target for the same destination inside one card is worse
 * than a plate that simply reports the state — which is what the badge has
 * always done.
 */
.mts-track__media,
.mts-track__pending {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin: auto 0 0;
	padding: 0.5rem 0.75rem;
	border-inline-start: 3px solid var(--mts-rule-strong);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	line-height: 1.2;
}

/* Ink on Sand is 14.44:1. */
.mts-track__pending {
	background-color: var(--wp--preset--color--base-2);
	color: var(--wp--preset--color--contrast);
}

/*
 * The playable state gets the Stage Black plate, so it reads as the active
 * one against the passive Sand badge and ties back to the sleeve above it.
 * Cream on Stage Black is 17.22:1.
 */
/*
 * This is now an <a> to the track rather than a bound paragraph — it was
 * styled as a plate with a play triangle, so it looked pressable and was not.
 * Being a link means it inherits the underline theme.json puts on
 * elements.link, which is wrong on a control: the plate and the triangle are
 * the affordance, and the underline reads as a mistake on top of them.
 *
 * Cream on Stage Black is 17.22:1, so removing the underline does not leave
 * the link identified by colour alone against the page — it is a filled plate,
 * not body text. The focus ring in style.css is untouched.
 */
.mts-track__media {
	background-color: var(--wp--preset--color--surface-dark);
	color: var(--wp--preset--color--base);
	text-decoration: none;
}

.mts-track__media:hover,
.mts-track__media:focus-visible {
	color: var(--wp--preset--color--base);
	text-decoration: none;
}

/* A play triangle drawn with borders — no asset, and it scales with the text. */
.mts-track__media::before {
	content: "";
	flex: 0 0 auto;
	width: 0;
	height: 0;
	border-block: 0.42rem solid transparent;
	border-inline-start: 0.66rem solid var(--wp--preset--color--primary-light);
	border-inline-end: 0;
}

.mts-track__pending::before {
	content: "";
	flex: 0 0 auto;
	width: 1.5rem;
	height: 1.5rem;
	background-image: var(--mts-shark);
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.9;
}

/*
 * Which state a card is in.
 *
 * Three possibilities: an uploaded audio file (a real player on the card — it
 * is cheap, private and needs no third party), an embed on the single ("Watch"
 * or "Listen", set by the binding), or nothing at all.
 *
 * The empty-binding collapse is plain :empty, so it needs no :has(). The badge
 * is the only part that has to reason about the other two, and it is hidden
 * until proven necessary: a browser without :has() then shows neither plate
 * rather than both, which is a quiet omission instead of a card claiming there
 * is a video and no recording at the same time.
 */
.mts-track__audio {
	display: none;
	margin-block-start: auto;
}

.mts-track__media:empty {
	display: none;
}

.mts-track__pending {
	display: none;
}

@supports selector(:has(*)) {
	.mts-track__audio:has(audio[src]) {
		display: block;
	}

	.mts-track:not(:has(.mts-track__media:not(:empty), audio[src])) .mts-track__pending {
		display: flex;
	}
}

.mts-track__audio audio {
	width: 100%;
}

/*
 * The embed on a single track (inc/embeds.php). It arrives as a bare provider
 * iframe carrying fixed width and height attributes: core's own responsive
 * sizing for `is-type-video` keys off a `wp-block-embed__wrapper` that this
 * markup does not have, so the ratio is supplied here instead.
 *
 * The ratio is a custom property rather than a literal because the wrapper
 * always says `is-type-video`, including for SoundCloud, Bandcamp and Spotify,
 * which are short audio players and look absurd at 16/9. Overriding the
 * property per provider is then a one-line change rather than a new rule.
 *
 * Behind it, the same lit Stage Black plate the sleeve uses, so the space is
 * on-brand while the provider loads instead of a white gap or a black box.
 */
.mts-track__embed {
	--mts-embed-ratio: 16 / 9;
	position: relative;
	margin-block: var(--wp--preset--spacing--40);
	background-color: var(--wp--preset--color--surface-dark);
	background-image: radial-gradient(
		ellipse at 50% 42%,
		rgba(211, 160, 74, 0.22),
		transparent 62%
	);
	border-block: 3px solid var(--mts-rule-strong);
}

.mts-track__embed::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: url("../images/shark-cream.png");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 24% auto;
	opacity: 0.3;
}

.mts-track__embed :where(iframe) {
	position: relative;
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--mts-embed-ratio);
	border: 0;
}

/* Audio providers are not 16/9; let the provider's own height stand. */
.mts-track__embed:is(
	[class*="soundcloud"],
	[class*="bandcamp"],
	[class*="spotify"]
) {
	--mts-embed-ratio: auto;
}

/* ======================================================================
 * 14. Signage devices
 * ====================================================================== */

/*
 * Three more opt-in block styles, all drawn with gradients and masks rather
 * than images. The reference is the same as the rest of the file: gig posters,
 * ticket stubs and the bulb-lit signage outside a club.
 */

/*
 * Corner brackets — four brass Ls, the way a poster crops its billing. Eight
 * gradient layers rather than pseudo-elements, which keeps ::before/::after
 * free for whatever else the client stacks on the block.
 */
.wp-block-group.is-style-brackets {
	--mts-brk: var(--mts-rule-strong);
	--mts-brk-g: linear-gradient(var(--mts-brk), var(--mts-brk));
	--mts-brk-len: 1.75rem;
	--mts-brk-w: 2px;
	padding: var(--wp--preset--spacing--40);
	background-image:
		var(--mts-brk-g), var(--mts-brk-g), var(--mts-brk-g), var(--mts-brk-g),
		var(--mts-brk-g), var(--mts-brk-g), var(--mts-brk-g), var(--mts-brk-g);
	background-repeat: no-repeat;
	background-size:
		var(--mts-brk-len) var(--mts-brk-w), var(--mts-brk-w) var(--mts-brk-len),
		var(--mts-brk-len) var(--mts-brk-w), var(--mts-brk-w) var(--mts-brk-len),
		var(--mts-brk-len) var(--mts-brk-w), var(--mts-brk-w) var(--mts-brk-len),
		var(--mts-brk-len) var(--mts-brk-w), var(--mts-brk-w) var(--mts-brk-len);
	background-position:
		left top, left top,
		right top, right top,
		left bottom, left bottom,
		right bottom, right bottom;
}

/*
 * Marquee bulbs — a run of lamps along the top and bottom of a band, sized in
 * rem so the spacing stays even at any width. Purely decorative and no
 * animation: a blinking marquee would be a motion problem for no gain.
 */
.wp-block-group.is-style-bulbs {
	position: relative;
	padding-block: var(--wp--preset--spacing--50);
}

.wp-block-group.is-style-bulbs::before,
.wp-block-group.is-style-bulbs::after {
	content: "";
	position: absolute;
	inset-inline: var(--wp--preset--spacing--20);
	height: 0.5rem;
	background-image: radial-gradient(circle, var(--mts-rule-strong) 38%, transparent 42%);
	background-size: 1.4rem 0.5rem;
	background-repeat: repeat-x;
	pointer-events: none;
}

.wp-block-group.is-style-bulbs::before {
	inset-block-start: 0.6rem;
}

.wp-block-group.is-style-bulbs::after {
	inset-block-end: 0.6rem;
}

/*
 * Ticket stub — a clean semicircular notch out of each side edge. Deliberately
 * not toothy: the shark bite is the brand mark, this is stationery, and the two
 * should not be mistaken for each other.
 *
 * Three mask layers XOR'd: two notch discs against a full-coverage rectangle.
 * The discs sit on opposite edges and never overlap, so the chained exclude
 * resolves to "everything except both notches".
 *
 * A dashed perforation between the notches was tried and removed: it sits at
 * the vertical centre, which is also where a short block's text sits, and it
 * ran straight through the copy. The notches carry the ticket on their own.
 */
@supports (mask-composite: exclude) or (-webkit-mask-composite: xor) {
	.wp-block-group.is-style-stub {
		--mts-stub-r: 0.85rem;
		position: relative;
		padding: var(--wp--preset--spacing--40);
		padding-inline: max(var(--wp--preset--spacing--40), calc(var(--mts-stub-r) * 2));
		-webkit-mask-image:
			radial-gradient(circle var(--mts-stub-r) at left 0 top 50%, #000 99%, transparent 100%),
			radial-gradient(circle var(--mts-stub-r) at right 0 top 50%, #000 99%, transparent 100%),
			linear-gradient(#000, #000);
		mask-image:
			radial-gradient(circle var(--mts-stub-r) at left 0 top 50%, #000 99%, transparent 100%),
			radial-gradient(circle var(--mts-stub-r) at right 0 top 50%, #000 99%, transparent 100%),
			linear-gradient(#000, #000);
		-webkit-mask-composite: xor, xor, source-over;
		mask-composite: exclude, exclude, add;
	}
}

/*
 * Letterpress — a heading pressed into the paper rather than sitting on it.
 * One light edge above, one dark below. The text colour is untouched, so Ink
 * on Cream stays at 16.35:1; this only shapes the edge of the glyph.
 */
.wp-block-heading.is-style-letterpress {
	text-shadow:
		0 1px 0 rgba(255, 255, 255, 0.8),
		0 -1px 0 rgba(20, 23, 28, 0.16);
}

:where(
	.wp-block-group.is-style-stage,
	.has-surface-dark-background-color,
	.has-contrast-background-color
) .wp-block-heading.is-style-letterpress {
	text-shadow:
		0 1px 0 rgba(0, 0, 0, 0.6),
		0 -1px 0 rgba(255, 255, 255, 0.14);
}

/* ======================================================================
 * 15. Print and forced colours
 * ====================================================================== */

@media print {
	body::after,
	.wp-block-group.is-style-stage::before,
	.wp-block-query-no-results > :first-child::before {
		display: none;
	}
}

/*
 * A mask is invisible in print and only risks clipping content, so the bite
 * and the stub print as plain rectangles.
 */
@media print {
	.wp-block-group[class*="is-style-bite-"],
	.wp-block-image[class*="is-style-bite-"] img,
	.wp-block-group.is-style-stub {
		-webkit-mask-image: none;
		mask-image: none;
	}

	.wp-block-group[class*="is-style-bite-"]::after,
	.wp-block-group.is-style-bulbs::before,
	.wp-block-group.is-style-bulbs::after {
		display: none;
	}
}

/*
 * In forced-colours mode the OS palette replaces ours. Drop the decorative
 * layers so they cannot muddy the user's chosen colours, and let the rules
 * fall back to system colours rather than disappearing.
 */
@media (forced-colors: active) {
	body::after,
	.wp-block-group.is-style-stage::before {
		display: none;
	}

	hr.wp-block-separator.is-style-brass,
	hr.wp-block-separator.is-style-double,
	.wp-block-group.is-style-poster {
		forced-color-adjust: none;
		border-color: CanvasText;
		background: CanvasText;
	}

	.wp-block-query-no-results {
		border-color: CanvasText;
	}

	/*
	 * Forced colours replaces our palette but not the mask, which would carve
	 * a hole out of the user's own Canvas. Drop the bite and the stub, and let
	 * the track card and its sleeve fall back to system colours.
	 */
	.wp-block-group[class*="is-style-bite-"],
	.wp-block-image[class*="is-style-bite-"] img,
	.wp-block-group.is-style-stub {
		-webkit-mask-image: none;
		mask-image: none;
	}

	.wp-block-group[class*="is-style-bite-"]::after,
	.wp-block-group.is-style-bulbs::before,
	.wp-block-group.is-style-bulbs::after {
		display: none;
	}

	.mts-track,
	.mts-track__pending,
	.mts-track__sleeve,
	.wp-block-group.is-style-brackets {
		forced-color-adjust: none;
		border-color: CanvasText;
	}

	.mts-track__sleeve {
		background: Canvas;
	}
}
