/*!
 * Harvardbridge Automotives — base
 * @version 1.0.0
 * Changelog: 1.0.0 — Initial build.
 *
 * Mobile first. Every media query below is min-width: the phone layout is the default and
 * the desktop layout is the enhancement, because most of this traffic is one thumb on
 * mobile data standing next to a car.
 */

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

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

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

	*,
	*::before,
	*::after {
		animation-duration: 1ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 1ms !important;
	}
}

body {
	margin: 0;
	background-color: var(--hba-obsidian);
	color: var(--hba-chrome);
	font-family: var(--hba-font-body);
	font-size: var(--hba-step-0);
	line-height: var(--hba-leading-body);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

/* The sticky action bar must never cover the last line of content. */
body.has-hba-actionbar {
	padding-bottom: calc(var(--hba-actionbar-h) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 900px) {
	body.has-hba-actionbar {
		padding-bottom: 0;
	}
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 var(--hba-space-sm);
	font-family: var(--hba-font-display);
	font-weight: 500;
	line-height: var(--hba-leading-tight);
	letter-spacing: -0.015em;
	color: var(--hba-chrome);
	text-wrap: balance;
}

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

p, ul, ol, dl, blockquote, figure, table, pre {
	margin: 0 0 var(--hba-space-md);
}

p, li {
	max-width: var(--hba-measure);
	text-wrap: pretty;
}

a {
	color: var(--hba-chrome);
	text-decoration-color: var(--hba-solar);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.22em;
	transition: color var(--hba-transition);
}

a:hover {
	color: var(--hba-solar);
}

:focus-visible {
	outline: var(--hba-focus);
	outline-offset: var(--hba-focus-offset);
	border-radius: var(--hba-radius-sm);
}

strong, b {
	font-weight: 600;
}

small {
	font-size: var(--hba-step--1);
}

hr {
	height: 1px;
	margin: var(--hba-space-xl) 0;
	border: 0;
	background: var(--hba-slate);
}

img, picture, video, canvas, svg {
	display: block;
	max-width: 100%;
	height: auto;
}

figure {
	margin-inline: 0;
}

figcaption {
	margin-top: var(--hba-space-xs);
	color: var(--hba-steel);
	font-size: var(--hba-step--1);
}

blockquote {
	margin-inline: 0;
	padding-left: var(--hba-space-md);
	border-left: 3px solid var(--hba-solar);
	color: var(--hba-chrome);
}

code, kbd, samp, pre, .hba-mono {
	font-family: var(--hba-font-mono);
	font-size: 0.94em;
	font-variant-numeric: tabular-nums slashed-zero;
}

ul, ol {
	padding-left: 1.25em;
}

li + li {
	margin-top: var(--hba-space-2xs);
}

/* Lists of included work read faster with a tick than a bullet. */
.hba-list-checked {
	padding-left: 0;
	list-style: none;
}

.hba-list-checked li {
	position: relative;
	padding-left: 1.9em;
}

.hba-list-checked li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.62em;
	width: 0.85em;
	height: 0.45em;
	border-left: 2px solid var(--hba-solar);
	border-bottom: 2px solid var(--hba-solar);
	transform: rotate(-45deg);
}

/* ------------------------------------------------------------------
   Layout primitives
   ------------------------------------------------------------------ */

.hba-container {
	width: 100%;
	max-width: var(--hba-container);
	margin-inline: auto;
	padding-inline: var(--hba-gutter);
}

.hba-container--narrow {
	max-width: var(--hba-container-narrow);
}

.hba-section {
	padding-block: var(--hba-space-2xl);
}

@media (min-width: 900px) {
	.hba-section {
		padding-block: var(--hba-space-3xl);
	}
}

.hba-section--light {
	background: var(--hba-paper);
	color: var(--hba-ink);
}

.hba-section--light h1,
.hba-section--light h2,
.hba-section--light h3,
.hba-section--light h4,
.hba-section--light a {
	color: var(--hba-ink);
}

/* Steel is 2.45:1 on white. On a light section, muted text uses ink-muted. */
.hba-section--light .hba-muted {
	color: var(--hba-ink-muted);
}

.hba-muted {
	color: var(--hba-steel);
}

.hba-eyebrow {
	margin-bottom: var(--hba-space-xs);
	font-family: var(--hba-font-display);
	font-size: var(--hba-step--1);
	font-weight: 700;
	letter-spacing: var(--hba-tracking-eyebrow);
	text-transform: uppercase;
	color: var(--hba-solar);
}

.hba-section--light .hba-eyebrow {
	color: var(--hba-solar-text);
}

.hba-lede {
	font-size: var(--hba-step-1);
	line-height: 1.5;
	color: var(--hba-chrome);
}

.hba-section--light .hba-lede {
	color: var(--hba-ink);
}

.hba-stack > * + * {
	margin-top: var(--hba-space-md);
}

.hba-grid {
	display: grid;
	gap: var(--hba-space-lg);
}

@media (min-width: 700px) {
	.hba-grid--2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
	.hba-grid--3 { grid-template-columns: repeat(3, 1fr); }
	.hba-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 700px) and (max-width: 999px) {
	.hba-grid--3,
	.hba-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* The signature rule: an inspection light across the section edge. */
.hba-lightbar {
	height: 2px;
	border: 0;
	margin: 0;
	background: var(--hba-lightbar);
	opacity: 0.9;
}

.hba-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	padding: var(--hba-space-sm) var(--hba-space-md);
	background: var(--hba-solar);
	color: var(--hba-on-cta);
	font-weight: 600;
}

.hba-skip:focus {
	left: var(--hba-space-md);
	top: var(--hba-space-md);
	color: var(--hba-on-cta);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------------
   Forms — labelled, large enough to hit, errors in text not colour
   ------------------------------------------------------------------ */

label {
	display: block;
	margin-bottom: var(--hba-space-2xs);
	font-weight: 600;
	font-size: var(--hba-step--1);
	letter-spacing: 0.01em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="password"],
select,
textarea {
	width: 100%;
	min-height: var(--hba-tap);
	padding: var(--hba-space-sm) var(--hba-space-md);
	background: var(--hba-carbon);
	color: var(--hba-chrome);
	border: var(--hba-border);
	border-radius: var(--hba-radius-md);
	font-family: inherit;
	font-size: 1rem; /* 16px minimum stops iOS zooming on focus */
	line-height: 1.4;
}

textarea {
	min-height: 8rem;
	resize: vertical;
}

input::placeholder,
textarea::placeholder {
	color: var(--hba-steel);
	opacity: 1;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	border-color: var(--hba-solar);
}

.hba-section--light input[type="text"],
.hba-section--light input[type="email"],
.hba-section--light input[type="tel"],
.hba-section--light select,
.hba-section--light textarea {
	background: var(--hba-white);
	color: var(--hba-ink);
	border: var(--hba-border-light);
}

.hba-section--light input::placeholder,
.hba-section--light textarea::placeholder {
	color: var(--hba-ink-muted);
}

/* ------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------ */

.hba-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: var(--hba-border);
	border-radius: var(--hba-radius-lg);
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--hba-step--1);
}

caption {
	padding: var(--hba-space-sm) var(--hba-space-md);
	color: var(--hba-steel);
	text-align: left;
	font-size: var(--hba-step--1);
}

th, td {
	padding: var(--hba-space-sm) var(--hba-space-md);
	text-align: left;
	border-bottom: var(--hba-border);
	vertical-align: top;
}

thead th {
	font-family: var(--hba-font-display);
	font-size: var(--hba-step-0);
	white-space: nowrap;
}

tbody tr:last-child th,
tbody tr:last-child td {
	border-bottom: 0;
}

/* ------------------------------------------------------------------
   WordPress editor output
   ------------------------------------------------------------------ */

.alignleft { float: left; margin: 0 var(--hba-space-md) var(--hba-space-md) 0; }
.alignright { float: right; margin: 0 0 var(--hba-space-md) var(--hba-space-md); }
.aligncenter { display: block; margin-inline: auto; }
.alignwide { max-width: min(100%, 1100px); margin-inline: auto; }
.alignfull { max-width: none; }

.wp-caption { max-width: 100%; }
.wp-caption-text { color: var(--hba-steel); font-size: var(--hba-step--1); }
.sticky, .gallery-caption, .bypostauthor { display: block; }
