/**
 * HG Automotive theme — base layout and chrome styles.
 * Colour tokens live in design-tokens.css (enqueued first).
 *
 * @package HG_Automotive
 * @since 0.1.0
 * @updated 0.42.27 Tighter section top pad when breadcrumbs lead
 */

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--hg-auto-font-sans);
	font-size: 1rem;
	line-height: 1.6;
	color: var(--hg-auto-color-ink);
	background:
		radial-gradient(ellipse 70% 45% at 0% 0%, rgba(var(--hg-color-primary-rgb), 0.05), transparent 55%),
		radial-gradient(ellipse 50% 35% at 100% 0%, rgba(var(--hg-color-secondary-rgb), 0.04), transparent 50%),
		var(--hg-color-bg);
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: var(--hg-color-secondary);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	text-decoration-color: rgba(var(--hg-color-secondary-rgb), 0.55);
	transition: color var(--hg-auto-transition);
}

a:hover,
a:focus-visible {
	color: var(--hg-color-secondary-hover);
	text-decoration-color: var(--hg-color-secondary-hover);
}

:focus-visible {
	outline: none;
	box-shadow: var(--hg-auto-focus);
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background: var(--hg-auto-color-surface-elevated);
	clip: auto !important;
	clip-path: none;
	color: var(--hg-auto-color-ink);
	display: block;
	font-size: 0.875rem;
	height: auto;
	left: var(--hg-auto-space-4);
	line-height: normal;
	padding: var(--hg-auto-space-3) var(--hg-auto-space-4);
	text-decoration: none;
	top: var(--hg-auto-space-4);
	width: auto;
	z-index: 100000;
	box-shadow: var(--hg-auto-focus);
}

.hg-auto-skip-link:focus {
	position: absolute;
}

/* Canonical inner content width for marketing / archive / single pages. */
.hg-auto-container {
	width: min(100% - 1.5rem, var(--hg-container-width, var(--hg-auto-container)));
	margin-inline: auto;
}

@media (min-width: 640px) {
	.hg-auto-container {
		width: min(100% - 2.5rem, var(--hg-container-width, var(--hg-auto-container)));
	}
}

.hg-auto-section {
	padding-block: var(--hg-auto-space-7);
}

/*
 * Breadcrumbs sit under the sticky header inside .hg-auto-section.
 * Default top pad is --hg-auto-space-7 (3rem); halve it when crumbs are present
 * so the trail sits closer without changing pages that omit breadcrumbs.
 */
.hg-auto-section:has(.hg-auto-breadcrumbs),
.hg-auto-section:has(.hg-auto-vs-breadcrumbs) {
	padding-top: var(--hg-auto-space-5);
}

.hg-auto-grid {
	display: grid;
	gap: var(--hg-auto-space-5);
}

.hg-auto-grid--2,
.hg-auto-grid--3,
.hg-auto-grid--4 {
	grid-template-columns: 1fr;
}

.hg-auto-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(var(--hg-color-card-rgb), 0.9);
	backdrop-filter: blur(12px);
}

.admin-bar .hg-auto-header {
	top: 32px;
}

.hg-auto-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--hg-auto-space-4);
	min-height: 4.5rem;
	position: relative;
}

.hg-auto-branding__title {
	margin: 0;
	font-family: var(--hg-auto-font-display);
	font-size: 1.4rem;
	font-weight: 700;
	letter-spacing: -0.025em;
}

.hg-auto-branding__title a {
	color: var(--hg-auto-color-ink);
	text-decoration: none;
}

.hg-auto-branding__description {
	margin: 0;
	color: var(--hg-auto-color-muted);
	font-size: 0.875rem;
}

.hg-auto-main {
	min-height: 50vh;
}

.hg-auto-hero {
	padding-block: clamp(3.25rem, 11vw, 6.5rem);
	border-bottom: 1px solid rgba(var(--hg-color-card-rgb), 0.08);
	background:
		linear-gradient(115deg, rgba(var(--hg-color-text-rgb), 0.94), rgba(var(--hg-color-text-rgb), 0.72)),
		radial-gradient(circle at 78% 18%, rgba(var(--hg-color-primary-rgb), 0.5), transparent 48%),
		linear-gradient(165deg, var(--hg-color-footer-mid), var(--hg-color-footer-deep));
	color: var(--hg-color-on-dark);
}

.hg-auto-hero__brand {
	margin: 0 0 var(--hg-auto-space-3);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(var(--hg-color-card-rgb), 0.78);
}

.hg-auto-hero__title {
	margin: 0 0 var(--hg-auto-space-4);
	font-family: var(--hg-auto-font-display);
	font-size: clamp(2.1rem, 5.2vw, 3.4rem);
	line-height: 1.08;
	letter-spacing: -0.03em;
	max-width: 14ch;
}

.hg-auto-hero__text {
	margin: 0 0 var(--hg-auto-space-5);
	max-width: 38ch;
	color: rgba(var(--hg-color-card-rgb), 0.86);
	font-size: 1.0625rem;
}

.hg-auto-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--hg-auto-space-3);
}

.hg-auto-page-header {
	margin-bottom: var(--hg-auto-space-6);
}

.hg-auto-page-header__title {
	margin: 0 0 var(--hg-auto-space-2);
	font-family: var(--hg-auto-font-display);
	font-size: clamp(1.85rem, 3.2vw, 2.4rem);
	letter-spacing: -0.025em;
}

.hg-auto-page-header__desc {
	margin: 0;
	color: var(--hg-auto-color-steel);
	max-width: 42rem;
}

.hg-auto-breadcrumbs {
	margin: 0 0 var(--hg-auto-space-3);
}

.hg-auto-breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.875rem;
	color: var(--hg-auto-color-steel);
}

.hg-auto-breadcrumbs__item:not(:last-child)::after {
	content: "/";
	margin-left: 0.35rem;
	opacity: 0.6;
}

.hg-auto-breadcrumbs__link {
	color: var(--hg-auto-color-steel);
	text-decoration: none;
}

.hg-auto-breadcrumbs__link:hover,
.hg-auto-breadcrumbs__link:focus-visible {
	color: var(--hg-auto-color-ink, inherit);
	text-decoration: underline;
}

.hg-auto-breadcrumbs__current {
	color: var(--hg-auto-color-ink, inherit);
}

.hg-auto-da-header--count-only {
	margin-bottom: var(--hg-auto-space-4);
}

.hg-auto-da-header--count-only .hg-auto-da-header__count {
	margin: 0;
}

@media (max-width: 767px) {
	.hg-auto-page-header {
		margin-bottom: var(--hg-auto-space-5);
	}

	.hg-auto-breadcrumbs {
		margin-bottom: var(--hg-auto-space-2);
	}
}

.hg-auto-footer {
	margin-top: var(--hg-auto-space-8);
	padding-block: var(--hg-auto-space-7) var(--hg-auto-space-5);
	background: var(--hg-color-footer);
	color: rgba(var(--hg-color-card-rgb), 0.82);
}

.hg-auto-footer a {
	color: var(--hg-color-on-dark);
}

.hg-auto-footer__bottom {
	display: flex;
	flex-direction: column;
	gap: var(--hg-auto-space-4);
	padding-top: var(--hg-auto-space-5);
	border-top: 1px solid rgba(var(--hg-color-card-rgb), 0.12);
	margin-top: var(--hg-auto-space-6);
}

.hg-auto-footer__copy {
	margin: 0;
	font-size: 0.875rem;
	color: rgba(var(--hg-color-card-rgb), 0.66);
}

.hg-auto-footer__sep {
	margin-inline: 0.4rem;
}
