/*
Theme Name: Milepost
Theme URI: https://milepost.co.uk
Author: Milepost
Author URI: https://milepost.co.uk
Description: Block theme for Milepost health, safety and compliance software and its RackInspect product. Racing Green and Brass, Victorian milepost lettering and modern layouts. Every template, header, footer and page is editable in the Site Editor, with ready-made page and section patterns.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: milepost
Tags: block-patterns, block-styles, custom-colors, custom-menu, editor-style, full-site-editing, one-column, wide-blocks, accessibility-ready, business
*/

/* Most styling lives in theme.json. These rules cover the few things theme.json cannot express. */

/* Keyboard focus: a clear brass ring everywhere. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--brass);
	outline-offset: 2px;
}

/* ---------- Route list (List block › Styles › Route) ----------
   A vertical milepost route. Add the CSS class "is-done" or "is-current" to a list
   item (List item › Advanced › Additional CSS class) to change its marker. */
.is-style-route {
	list-style: none;
	padding-left: 0;
	margin-left: 0;
}
.is-style-route > li {
	position: relative;
	padding: 0 0 1.5rem 2.25rem;
	margin: 0;
	line-height: 1.45;
}
.is-style-route > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.2rem;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	box-sizing: border-box;
	border: 3px solid #C3D1C8;
	background: #FFFFFF;
	z-index: 1;
}
.is-style-route > li::after {
	content: "";
	position: absolute;
	left: 7.5px;
	top: 1.35rem;
	bottom: 0;
	width: 3px;
	background: #C3D1C8;
}
.is-style-route > li:last-child { padding-bottom: 0; }
.is-style-route > li:last-child::after { display: none; }
.is-style-route > li.is-done::before {
	border: none;
	background: var(--wp--preset--color--racing-green);
}
.is-style-route > li.is-done::after { background: var(--wp--preset--color--racing-green); }
.is-style-route > li.is-current::before {
	border: none;
	background: var(--wp--preset--color--brass);
	box-shadow: 0 0 0 5px var(--wp--preset--color--brass-tint);
}

/* ---------- Short brass rule (Separator › Styles › Short rule) ---------- */
hr.wp-block-separator.is-style-short-rule {
	width: 56px;
	max-width: 56px;
	margin-left: 0;
	margin-right: auto;
	border: none;
	border-top: 2px solid var(--wp--preset--color--brass);
	height: 0;
	background: none;
	opacity: 1;
}
.has-text-align-center hr.wp-block-separator.is-style-short-rule,
hr.wp-block-separator.is-style-short-rule.aligncenter { margin-left: auto; }

/* ---------- Dark sections ---------- */
/* Eyebrows switch to bright brass on green so they stay readable. */
:is(.is-style-section-green, .is-style-section-deep, .is-style-card-green) .is-style-eyebrow {
	color: var(--wp--preset--color--brass);
}
/* Outline buttons turn white on green. */
:is(.is-style-section-green, .is-style-section-deep, .is-style-card-green) .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	color: #FFFFFF;
	border-color: #5E7A6A;
}
:is(.is-style-section-green, .is-style-section-deep, .is-style-card-green) .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover {
	background-color: rgba(255, 255, 255, 0.08);
	color: #FFFFFF;
}
/* The route card sits on green but is itself white. */
.is-style-section-green .is-style-card { color: var(--wp--preset--color--body-text); }
.is-style-section-green .is-style-card :where(h1, h2, h3, h4, h5, h6) { color: var(--wp--preset--color--racing-green); }

/* ---------- Header ---------- */
.milepost-header .wp-block-site-title a { text-decoration: none; }
.milepost-header .wp-block-navigation a:hover { color: var(--wp--preset--color--brass); }

/* ---------- Status badges (RackInspect ratings) ---------- */
.milepost-badge {
	display: inline-block;
	padding: 0.1rem 0.75rem;
	border-radius: 999px;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
}

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.milepost-header .wp-block-buttons { display: none; }
}

/* Sections and template parts sit flush against each other. */
.wp-site-blocks > * + * { margin-block-start: 0; }

/* Badges are paragraphs with a background colour. */
p.milepost-badge.has-background { padding: 0.15rem 0.8rem; }
