/* MBC base styles. Tokens only: see tokens.css. */

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

body {
	margin: 0;
	background: var(--mbc-surface-alt);
	color: var(--mbc-text);
}

/*
 * Type. GeneratePress's own stylesheet sets font-family, size, weight and
 * line height on body, form controls and headings with the same specificity
 * and loads later, so "html body" lifts ours above it (as for buttons below).
 * Without this a look cannot change fonts, sizes or weights.
 */
html body,
html body button,
html body input,
html body select,
html body textarea {
	font-family: var(--mbc-font-body);
	font-size: var(--mbc-step-0);
	font-weight: var(--mbc-weight-body);
	line-height: var(--mbc-leading-body);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 var(--mbc-space-m);
	line-height: var(--mbc-leading-heading);
}

html body h1,
html body h2,
html body h3,
html body h4,
html body h5,
html body h6 {
	font-family: var(--mbc-font-heading);
}

h1 { font-size: var(--mbc-step-5); }
h2 { font-size: var(--mbc-step-4); }
h3 { font-size: var(--mbc-step-3); }
h4 { font-size: var(--mbc-step-2); }
h5 { font-size: var(--mbc-step-1); }
h6 { font-size: var(--mbc-step-0); }

p {
	margin: 0 0 var(--mbc-space-m);
}

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

a {
	color: var(--mbc-link);
}

a:hover {
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: var(--mbc-focus-width) solid var(--mbc-focus);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/*
 * Buttons: <a> or <button> with .mbc-button, and form submits (MC4WP etc).
 * "html body" lifts specificity above GeneratePress's own button rules.
 */
.mbc-button,
button.mbc-button,
html body a.wp-block-button__link:not(.has-background),
html body input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--mbc-tap-target);
	padding: var(--mbc-space-xs) var(--mbc-space-l);
	border: 2px solid var(--mbc-button-border);
	border-radius: var(--mbc-radius-pill);
	background: var(--mbc-button-bg);
	color: var(--mbc-button-text);
	font: inherit;
	font-weight: var(--mbc-weight-strong);
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.mbc-button:hover,
html body a.wp-block-button__link:not(.has-background):hover,
html body input[type="submit"]:hover,
html body input[type="submit"]:focus {
	background: var(--mbc-button-hover-bg);
	border-color: var(--mbc-button-hover-border);
	color: var(--mbc-button-hover-text);
}

.mbc-button--outline,
html body .is-style-outline > a.wp-block-button__link:not(.has-background) {
	background: transparent;
	color: var(--mbc-outline-text);
}

/* Form fields (GeneratePress styles these too; roles win via html body). */
html body input[type="text"],
html body input[type="email"],
html body input[type="search"],
html body input[type="url"],
html body input[type="tel"],
html body textarea,
html body select {
	border: var(--mbc-border-width) solid var(--mbc-input-border);
	border-radius: var(--mbc-radius-sm);
	background: var(--mbc-input-bg);
	color: var(--mbc-input-text);
}

/* Tables: GeneratePress borders them in the text colour. */
html body table,
html body th,
html body td {
	border-color: var(--mbc-border);
}

::placeholder {
	color: var(--mbc-placeholder);
	opacity: 1;
}

/*
 * GeneratePress bridge: GP's own CSS reads these variables (content cards,
 * page background, text, links). Defined on body so they beat GP's :root
 * values whatever the stylesheet order. This is what lets a look restyle
 * legacy GP output.
 */
body {
	--base: var(--mbc-surface-alt);
	--base-2: var(--mbc-surface-alt);
	--base-3: var(--mbc-surface);
	--contrast: var(--mbc-text);
	--contrast-2: var(--mbc-text-muted);
	--contrast-3: var(--mbc-text-muted);
	--accent: var(--mbc-link);
}
