/* ==============
   MAIN STRUCTURE
   ============== */
html {
	font-size: 62.5%; /* 1rem = 10px, so every rem in the theme is px / 10 */
	-webkit-text-size-adjust: 100%; }

body {
	background: var(--color__paper);
	font-family: var(--font__primary);
	font-size: 1.6rem;
	line-height: 1.5;
	color: var(--color__text);
	-webkit-font-smoothing: antialiased; }

h1, h2, h3, h4, p, figure, blockquote {
	margin: 0; }

img {
	max-width: 100%;
	display: block; }

#wrapper {
	position: relative;
	min-height: 100vh; }


/* ======
   MODULE
   ====== */
/* .m carries the background and the section padding. */
.m {
	padding: var(--spacing__y) var(--spacing__x);
	background: var(--color__paper); }


/* =========
   CONTAINER
   ========= */
/* .mc sets the width only. The flex gap is the rhythm between header, body
   and footer: it only spaces children that exist, so a missing header or
   footer needs no special case. Never set in module CSS. */
.mc {
	max-width: var(--width__lg);
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: var(--spacing__stack); }

.mc > * {
	min-width: 0; }

.mc__header {
	display: flex;
	flex-direction: column;
	gap: 1.6rem;
	max-width: 76rem; }

.mc__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 1.2rem; }

.mc__header > :first-child,
.mc__footer > :first-child {
	margin-top: 0; }


/* ==============
   SECTION THEMES
   ============== */
.m--theme-default {
	background: var(--color__paper);
	color: var(--color__text); }

.m--theme-tint {
	background: var(--color__tint);
	color: var(--color__text); }

.m--theme-ink {
	background: var(--color__ink);
	color: var(--color__on-ink); }

.m--theme-blue {
	background: var(--color__blue);
	color: var(--color__on-blue); }


/* =================
   SECTION MODIFIERS
   ================= */
.m--width-xs .mc { max-width: var(--width__xs); }
.m--width-sm .mc { max-width: var(--width__sm); }
.m--width-md .mc { max-width: var(--width__md); }
.m--width-xl .mc { max-width: var(--width__xl); }

/* No top or bottom padding: the section runs flush with its neighbours
   (edge-to-edge media). The section after it keeps its own top padding. */
.m--spacing-none {
	padding-top: 0;
	padding-bottom: 0; }

.m--flush-top {
	padding-top: 0; }

.m--flush-bottom {
	padding-bottom: 0; }


/* ===============
   SECTION SPACING
   =============== */
/* Two sections in a row on the same background share one gap: the second
   drops its top padding, so the first one's bottom padding is the gap.
   Not after a hero or a section with no padding of its own (m--spacing-none):
   the section after those keeps its top padding. */
.m--theme-default:not(.m--spacing-none, [class*="m--hero"]) + .m--theme-default,
.m--theme-tint:not(.m--spacing-none, [class*="m--hero"]) + .m--theme-tint,
.m--theme-ink + .m--theme-ink,
.m--theme-blue + .m--theme-blue {
	padding-top: 0; }

/* Spacing between specific module pairs is on the To do list in
   build/project.md: it is decided once the pages have been reviewed. */


/* ========
   FALLBACK
   ======== */
.m--fallback {
	padding-top: var(--spacing__y); }
