/*
Theme Name: Mud & Manners
Theme URI: https://mudandmanners.com
Author: Stephan
Description: Block theme for Mud & Manners: overlanding, offroad, dogs. Get dirty. Leave clean. Colours, fonts and spacing follow the Mud & Manners Brand Book v1.1. Fonts are self-hosted (no requests to Google). Works best together with the "Mud & Manners Core" plugin, which adds Trail Checks and Long-Term Tested.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mud-and-manners
Tags: block-patterns, full-site-editing, blog, one-column, wide-blocks, custom-colors, editor-style
*/

/* Brand fonts are licensed under the SIL Open Font License 1.1, see assets/fonts. */

:root {
	--mm-rule: 3px solid var(--wp--preset--color--forest);
}

/* Skip link */
.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--bone);
	color: var(--wp--preset--color--forest);
	padding: 12px 16px;
	z-index: 100000;
}

/* ---------- Block styles ---------- */

/* Paragraph: Overline (small caps label above a heading) */
p.is-style-overline {
	font-family: var(--wp--preset--font-family--utility);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--label);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.3;
	color: var(--wp--preset--color--clay);
	margin-bottom: 8px;
}

/* Heading: Section rule (field-notebook line on top) */
.wp-block-heading.is-style-rule {
	border-top: var(--mm-rule);
	padding-top: 16px;
}
/* Group: Ruled list row container */
.wp-block-group.is-style-rule-bottom {
	border-bottom: var(--mm-rule);
	padding-bottom: 16px;
}

/* Group: Card */
.wp-block-group.is-style-card {
	background: var(--wp--preset--color--sage);
	border-radius: 4px;
	padding: 28px;
}
.wp-block-group.is-style-card-dark {
	background: var(--wp--preset--color--pine);
	color: var(--wp--preset--color--bone);
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: 4px;
	padding: 24px;
}

/* Paragraph: Data (mono figures, dates, coordinates) */
p.is-style-data {
	font-family: var(--wp--preset--font-family--data);
	font-size: var(--wp--preset--font-size--label);
	line-height: 1.5;
}

/* Button: Outline */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: currentColor;
	border: 2px solid currentColor;
	padding: 12px 22px;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--forest);
	color: var(--wp--preset--color--bone);
	border-color: var(--wp--preset--color--forest);
}

/* List: Numbered rules (The Code) */
ol.is-style-rules {
	list-style: none;
	padding: 0;
	counter-reset: mm-rule;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	column-gap: 48px;
}
ol.is-style-rules > li {
	counter-increment: mm-rule;
	position: relative;
	padding: 24px 0 24px 64px;
	border-bottom: 1px solid var(--wp--preset--color--lichen);
}
ol.is-style-rules > li::before {
	content: counter(mm-rule);
	position: absolute;
	left: 0;
	top: 22px;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 44px;
	line-height: 1;
	color: var(--wp--preset--color--clay);
}
ol.is-style-rules > li strong {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 24px;
	line-height: 1.25;
	display: block;
}

/* ---------- Dark grounds: approved colour pairs ---------- */

.has-forest-background-color a:not([class]),
.has-pine-background-color a:not([class]) {
	color: var(--wp--preset--color--ember);
}
.has-forest-background-color p.is-style-overline {
	color: var(--wp--preset--color--ember);
}
.has-pine-background-color p.is-style-overline,
.has-moss-background-color p.is-style-overline,
.has-creek-background-color p.is-style-overline,
.has-clay-background-color p.is-style-overline,
.has-moss-background-color a:not([class]),
.has-creek-background-color a:not([class]),
.has-clay-background-color a:not([class]) {
	color: var(--wp--preset--color--sage);
}
.has-forest-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover,
.has-pine-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover,
.has-moss-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover,
.has-creek-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--bone);
	color: var(--wp--preset--color--forest);
	border-color: var(--wp--preset--color--bone);
}
/* Footer navigation sits on forest */
.has-forest-background-color .wp-block-navigation a {
	color: var(--wp--preset--color--ember);
}
.mm-header.has-forest-background-color .wp-block-navigation a,
.mm-header.has-forest-background-color .wp-block-site-title a {
	color: var(--wp--preset--color--bone);
}

/* Header */
.mm-header .wp-block-navigation a:hover,
.mm-header .wp-block-navigation .current-menu-item > a {
	color: var(--wp--preset--color--ember);
	text-decoration: underline;
	text-underline-offset: 6px;
}
.mm-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--forest);
	color: var(--wp--preset--color--bone);
}
.mm-header .mm-logo img {
	width: 40px;
	height: 40px;
}

/* Image placeholders in patterns: a moss field until a photo is set */
.wp-block-cover.mm-photo-slot .wp-block-cover__background {
	background-color: var(--wp--preset--color--moss);
}

/* Post cards in query loops */
.mm-post-card {
	height: 100%;
}
.mm-post-card .wp-block-post-featured-image img {
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

/* Tables */
.wp-block-table thead {
	border-bottom: 0;
}
.wp-block-table thead th {
	background: var(--wp--preset--color--forest);
	color: var(--wp--preset--color--bone);
	font-family: var(--wp--preset--font-family--utility);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--label);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: left;
}
.wp-block-table td,
.wp-block-table th {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--lichen);
	padding: 12px 16px;
}
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background: var(--wp--preset--color--sage);
}

/* Forms (comments, search, newsletter embeds) */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea,
select {
	min-height: 44px;
	padding: 10px 14px;
	border: 1.5px solid var(--wp--preset--color--stone);
	border-radius: 2px;
	background: var(--wp--preset--color--bone);
	color: var(--wp--preset--color--forest);
	font-family: inherit;
	font-size: 17px;
}

/* Whole card clickable when its heading holds the link */
.wp-block-group.is-style-card:has(h3 a) {
	position: relative;
}
.wp-block-group.is-style-card h3 a {
	color: inherit;
	text-decoration: none;
}
.wp-block-group.is-style-card h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
}
.wp-block-group.is-style-card:has(h3 a):hover h3 a {
	text-decoration: underline;
}

/* Header and footer sit flush against the content */
.wp-site-blocks > header.wp-block-template-part,
.wp-site-blocks > footer.wp-block-template-part {
	margin-block-start: 0;
}
.wp-site-blocks > main {
	margin-block-start: 0;
}
