body.tpl-typeface .hero--typeface {
	margin-bottom: var(--spacing-base);
}

body.tpl-typeface #content .type-info {
	margin-bottom: var(--spacing-lg);
	padding-inline: var(--spacing-base);
}

/* =================== */
/* Info */
/* =================== */

.type-info > .caption {
	margin-bottom: var(--spacing-lg);
} 

.type-info > .styles {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--spacing-lg);
}

.type-info > .styles > .cuts {
	width: 100%; /* mobile: full width, so the styles list can be fitted to it (scripts/pages/typeface.js) */
}

.type-info > .styles > .cuts > h2 {
	margin-bottom: var(--spacing-sm);
}

.type-info > .styles > .cuts p {
	/* Mobile: the cuts column is full width (the specimen sits below).
	   One shared size so the widest name spans the column (--cuts-fit, scripts/pages/typeface.js).
	   The formula is the fallback before/without JS */
	font-size: var(--cuts-fit, min(10vw, calc((100vw - 2 * var(--spacing-base)) * 2 / 3 / var(--count))));
	line-height: 1;
	white-space: nowrap;
	color: var(--color-text-solid); /* pure black, white in dark theme */
	font-synthesis: none; /* never fake a missing weight */
}

.type-info > .styles > .specimen {
	position: relative;
}

.type-info > .styles > .specimen > h2 {
	position: absolute;
	bottom: 0;
}

@media screen and (min-width: 768px) {
	.type-info > .styles {
		flex-direction: row;
		flex-wrap: nowrap;
		gap: var(--spacing-base);
	}

	.type-info > .styles > .cuts,
	.type-info > .styles > .specimen {
		flex: 0 1 50%;
	}

	/* Side by side: half width, list height follows the specimen */
	.type-info > .styles > .cuts p {
		font-size: min(6vw, calc((50vw - 3 * var(--spacing-base)) * 2 / 3 / var(--count)));
		white-space: normal;
	}
}

/* =================== */
/* Matrix */
/* =================== */

/*.matrix-item {
	margin-bottom:var(--spacing-lg);
}*/

/* Images (typeface.php: type_images) — one image full width, two side by side
   (stacked on mobile); no forced ratio: each image keeps its proportions, top-aligned */
.matrix-images {
	display: grid;
	grid-template-columns: 1fr;
	align-items: start;
	gap: var(--spacing-base);
	padding-inline: var(--spacing-base);
}

.matrix-images > * {
	display: block;
	width: 100%;
	height: auto;
}

@media (min-width: 768px) {
	.matrix-images--2 {
		grid-template-columns: 1fr 1fr;
	}
}

.matrix-images__caption {
	margin-top: var(--spacing-sm);
	padding-inline: var(--spacing-base);
}

/* =================== */
/* Characters */
/* =================== */

.characters {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(5em, 1fr));
	padding: 0 var(--spacing);
	gap: 3px;
}

.characters__category {
	grid-column: 1 / -1;
	margin-bottom: var(--spacing);
}

.characters__category:not(:first-of-type) {
	margin-top: var(--spacing-xl);
}

.characters__character {
	font-weight: normal; /* body is bold (Univers): without this the browser fakes a bold of the typeface */
	font-synthesis: none; /* never fake a missing weight or style */
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	padding: var(--spacing);
	background: white;
	font-size: var(--font-size-l);
	line-height: var(--line-height-l);
	text-align: center;
	white-space: pre;
}

.characters__character > small {
	display: none;
}

/* =================== */
/* Order button */
/* =================== */

.order {
	display: flex;
	z-index: 100; /* above the footer (99) */
	position: fixed;
	right: var(--spacing-m); /* the footer's own padding */
	/* vertically centred on the footer bar (--footer-height: scripts/main.js) */
	bottom: calc(var(--footer-height, 0px) / 2);
	transform: translateY(50%);
	align-items: center;
	justify-content: center;
	padding: var(--spacing-s) var(--spacing-m);
	/* Univers capitals sit at the top of the line: move the empty descender space to the top half */
	padding-top: calc(var(--spacing-s) + (1em - 1cap) / 2);
	padding-bottom: calc(var(--spacing-s) - (1em - 1cap) / 2);
	/* box-shadow: rgba(149, 157, 165, 0.05) 0px 8px 24px; */
	background: var(--bg-inverted); /* black, white in dark theme */
	color: var(--color-text-inverted);
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* The button is also a .copy-email button (main.css, loaded after this file):
   .order.copy-email restates its own colours so they win over the link styles */
.order.copy-email,
.order.copy-email:hover {
	color: var(--color-text-inverted);
	text-align: center;
	transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* Hover: grey background, black text (both themes) */
@media (hover: hover) {
	.order.copy-email:hover {
		background-color: var(--color-grey);
		color: var(--color-black);
	}
}

/* Fades with the page (fade only: the transform is used for the centring) */
.order {
	animation: fade-in var(--duration-in) ease-out both;
}

#content.is-hidden > .order {
	animation: fade-out var(--duration-out) ease-in forwards;
}

/* Hidden while the mobile menu is open */
body:has(.nav-container.is-open) .order {
	visibility: hidden;
}
