/*
 * Mercury Minimal.
 *
 * White page, black text, one accent-free palette. Everything that is not
 * content is a hairline rule; there are no fills, shadows or colours anywhere
 * in this file by design.
 */

:root {
	--mm-ink: #000;
	--mm-paper: #fff;
	--mm-rule: #e0e0e0;
	--mm-muted: #555;
	--mm-measure: 42rem;   /* comfortable line length for body copy */
	--mm-carousel: 40rem;  /* the brief: "shouldn't be too big" */
	--mm-logo: 125px;      /* keep in step with MM_LOGO_PX in functions.php */
}

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--mm-paper);
	color: var(--mm-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.6;
}

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

a {
	color: var(--mm-ink);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

a:hover,
a:focus {
	text-decoration: none;
}

:focus-visible {
	outline: 2px solid var(--mm-ink);
	outline-offset: 2px;
}

/* Bootstrap's name for it, but WordPress core and several plugins emit this
   class, so it has to exist regardless of what the theme itself does. */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.mm-skip {
	position: absolute;
	left: -9999px;
}

.mm-skip:focus {
	left: 1rem;
	top: 1rem;
	z-index: 10;
	padding: 0.5rem 1rem;
	background: var(--mm-paper);
	border: 1px solid var(--mm-ink);
}

/* ---------------------------------------------------------------- contact bar
 * A full-width strip above the header. Sized generously on purpose — the brief
 * asked for roughly double a normal utility bar, so this is ~3.5rem tall with
 * the link set at body size rather than the usual small print.
 */
.mm-contactbar {
	border-bottom: 1px solid var(--mm-rule);
	padding: 1.1rem 1rem;
	text-align: center;
}

.mm-contactbar__link {
	font-size: 1rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	border-bottom: 1px solid var(--mm-ink);
	padding-bottom: 0.15rem;
}

.mm-contactbar__link:hover,
.mm-contactbar__link:focus {
	border-bottom-color: transparent;
}

/* -------------------------------------------------------------------- header
 * Logo above, nav below, both centred. The logo is inside the header rather
 * than a sibling below it, so the header's bottom rule sits under the whole
 * lockup instead of splitting it.
 */
.mm-header {
	border-bottom: 1px solid var(--mm-rule);
	padding: 2rem 1rem 1.25rem;
}

.mm-nav__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mm-nav__list li {
	margin: 0;
}

.mm-nav__list a {
	font-size: 0.95rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
}

.mm-nav__list a:hover,
.mm-nav__list a:focus,
.mm-nav__list .current-menu-item > a,
.mm-nav__list .current_page_item > a {
	text-decoration: underline;
	text-underline-offset: 0.35em;
}

/* ---------------------------------------------------------------------- logo */
.mm-logo {
	display: flex;
	justify-content: center;
	margin-bottom: 1.5rem;
}

/* WordPress wraps the custom logo in .custom-logo-link > img.custom-logo. */
.mm-logo .custom-logo-link {
	display: block;
	line-height: 0;
}

.mm-logo .custom-logo {
	width: var(--mm-logo);
	height: var(--mm-logo);
	object-fit: contain;
}

/* The stand-in until a logo is uploaded. */
.mm-wordmark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--mm-logo);
	min-height: var(--mm-logo);
	/* Smaller than the logo box so three words still fit on three lines. */
	font-size: 0.95rem;
	line-height: 1.25;
	letter-spacing: 0.04em;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
}

/* ------------------------------------------------------------------ carousel
 * A scroll-snap track. Each slide is exactly the frame's width, so snapping
 * lands one image dead centre with no arithmetic in JavaScript.
 */
.mm-carousel {
	margin: 0 auto 3rem;
	padding: 0 1rem;
	max-width: var(--mm-carousel);
}

/* The carousel is the first thing in <main> on the front page and already
   carries its own breathing room, so it does not need the block gap twice. */
.home .mm-main {
	padding-top: 2rem;
}

.mm-carousel__frame {
	position: relative;
}

.mm-carousel__track {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	/* Firefox and the standards track; the WebKit bar is hidden below. */
	scrollbar-width: none;
}

.mm-carousel__track::-webkit-scrollbar {
	display: none;
}

.mm-carousel__slide {
	flex: 0 0 100%;
	scroll-snap-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	/* A fixed frame height keeps the page from jumping as slides of different
	   aspect ratios scroll past. */
	height: 24rem;
}

.mm-carousel__img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.mm-carousel__btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 2.75rem;
	height: 2.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-size: 1.75rem;
	line-height: 1;
	color: var(--mm-ink);
	background: var(--mm-paper);
	border: 1px solid var(--mm-ink);
	border-radius: 50%;
	cursor: pointer;
}

.mm-carousel__btn--prev {
	left: -0.5rem;
}

.mm-carousel__btn--next {
	right: -0.5rem;
}

.mm-carousel__count {
	margin: 0.9rem 0 0;
	text-align: center;
	font-size: 0.85rem;
	letter-spacing: 0.08em;
	color: var(--mm-muted);
}

@media (max-width: 30rem) {
	.mm-carousel__slide {
		height: 16rem;
	}

	.mm-carousel__btn--prev {
		left: 0;
	}

	.mm-carousel__btn--next {
		right: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mm-carousel__track {
		scroll-behavior: auto;
	}
}

/* -------------------------------------------------------------------- content */
.mm-main {
	/* The header used to be followed by the logo block, which supplied this
	   gap; with the logo moved up inside the header, the gap has to be here. */
	padding: 2.5rem 1rem 0;
}

.mm-page {
	max-width: var(--mm-measure);
	margin: 0 auto;
	padding-bottom: 3rem;
}

.mm-page__title {
	font-size: 1.9rem;
	font-weight: 600;
	line-height: 1.25;
	margin: 0 0 1.5rem;
}

.mm-prose h2 {
	font-size: 1.3rem;
	font-weight: 600;
	margin: 2.5rem 0 0.75rem;
}

.mm-prose h3 {
	font-size: 1.1rem;
	font-weight: 600;
	margin: 2rem 0 0.5rem;
}

.mm-prose p,
.mm-prose ul,
.mm-prose ol {
	margin: 0 0 1.15rem;
}

.mm-prose ul,
.mm-prose ol {
	padding-left: 1.25rem;
}

.mm-prose li {
	margin-bottom: 0.35rem;
}

.mm-prose hr,
.mm-prose .wp-block-separator {
	height: 0;
	margin: 2.5rem 0;
	border: 0;
	border-top: 1px solid var(--mm-rule);
}

/* The editor's two-column block, which the front page uses for the services
   list. Stacks below the measure rather than squeezing to two thin columns. */
.mm-prose .wp-block-columns {
	display: flex;
	flex-wrap: wrap;
	gap: 0 2.5rem;
}

.mm-prose .wp-block-column {
	flex: 1 1 14rem;
}

/* Forms — the Jetpack contact form and the printstack quote form. Kept to the
   same hairline vocabulary as the rest of the page. */
.mm-prose input[type="text"],
.mm-prose input[type="email"],
.mm-prose input[type="tel"],
.mm-prose input[type="url"],
.mm-prose input[type="number"],
.mm-prose select,
.mm-prose textarea {
	width: 100%;
	max-width: 100%;
	padding: 0.6rem 0.7rem;
	font: inherit;
	color: var(--mm-ink);
	background: var(--mm-paper);
	border: 1px solid var(--mm-ink);
	border-radius: 0;
}

.mm-prose textarea {
	min-height: 9rem;
}

.mm-prose button,
.mm-prose input[type="submit"],
.mm-prose .wp-block-button__link {
	display: inline-block;
	padding: 0.65rem 1.6rem;
	font: inherit;
	color: var(--mm-paper);
	background: var(--mm-ink);
	border: 1px solid var(--mm-ink);
	border-radius: 0;
	cursor: pointer;
	text-decoration: none;
}

.mm-prose button:hover,
.mm-prose input[type="submit"]:hover,
.mm-prose .wp-block-button__link:hover {
	color: var(--mm-ink);
	background: var(--mm-paper);
}

/* -------------------------------------------------------------------- footer */
.mm-footer {
	border-top: 1px solid var(--mm-rule);
	padding: 2.5rem 1rem 3rem;
	text-align: center;
}

.mm-footer .mm-nav__list {
	gap: 1.75rem;
	margin-bottom: 1.25rem;
}

.mm-footer .mm-nav__list a {
	font-size: 0.85rem;
}

.mm-footer__contact {
	margin: 0 0 0.75rem;
	font-size: 0.95rem;
}

.mm-footer__legal {
	margin: 0;
	font-size: 0.8rem;
	color: var(--mm-muted);
}
