/**
 * Layout: header, footer, grids, homepage.
 */

.site-header {
	border-bottom: 1px solid var(--dm-border);
	background: var(--dm-surface);
	position: sticky;
	top: 0;
	z-index: 50;
}

.site-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 0;
}

.site-title {
	font-family: var(--dm-font-heading);
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--dm-navy);
	text-decoration: none;
}

.site-logo img {
	max-height: 48px;
	width: auto;
}

.site-header__trust {
	margin: 0;
	padding: 0.4rem 0 0.75rem;
	font-size: 0.9rem;
	color: var(--dm-muted);
	border-top: 1px solid var(--dm-border);
}

.site-nav__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	min-width: var(--dm-touch);
	min-height: var(--dm-touch);
	background: transparent;
	border: 1px solid var(--dm-border);
	border-radius: var(--dm-radius);
	padding: 0.5rem 0.75rem;
	font: inherit;
	color: var(--dm-navy);
	cursor: pointer;
}

.site-nav__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-nav__list a {
	color: var(--dm-navy);
	text-decoration: none;
	font-weight: 550;
}

.site-nav__list a:hover {
	color: var(--dm-green);
}

.site-nav__list--secondary {
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--dm-border);
}

.site-nav__panel {
	display: none;
}

.site-nav__close {
	display: none;
}

@media (max-width: 800px) {
	.site-nav__toggle {
		display: inline-flex;
	}

	.site-nav__desktop {
		display: none;
	}

	.site-nav__panel:not([hidden]) {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(11, 31, 58, 0.45);
		z-index: 100;
	}

	.site-nav__panel-inner {
		position: absolute;
		top: 0;
		right: 0;
		width: min(100%, 320px);
		height: 100%;
		background: var(--dm-surface);
		padding: 1.25rem;
		box-shadow: -8px 0 24px rgba(11, 31, 58, 0.12);
		overflow: auto;
		animation: dm-slide-in 180ms ease;
	}

	.site-nav__panel .site-nav__list {
		flex-direction: column;
		gap: 0.75rem;
	}

	.site-nav__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: var(--dm-touch);
		margin-top: 1.5rem;
		background: transparent;
		border: 1px solid var(--dm-border);
		border-radius: var(--dm-radius);
		padding: 0.5rem 0.75rem;
		font: inherit;
		cursor: pointer;
	}
}

@keyframes dm-slide-in {
	from {
		transform: translateX(12px);
		opacity: 0.85;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-nav__panel-inner {
		animation: none;
	}
}

.site-main {
	padding: 2rem 0 3rem;
}

.site-main--home {
	padding-top: 0;
}

.page-header {
	margin-bottom: 1.75rem;
}

.page-title {
	font-size: clamp(1.75rem, 3vw, 2.4rem);
}

.page-intro {
	color: var(--dm-muted);
	max-width: 42rem;
}

.site-footer {
	margin-top: 3rem;
	padding: 2.5rem 0 1.5rem;
	background: var(--dm-navy);
	color: #d7dde7;
}

.site-footer a {
	color: #e8eef7;
}

.site-footer__grid {
	display: grid;
	grid-template-columns: 1.4fr repeat(3, 1fr);
	gap: 1.5rem;
}

.site-footer__name {
	font-family: var(--dm-font-heading);
	font-size: 1.35rem;
	color: #fff;
	margin: 0 0 0.5rem;
}

.site-footer__heading {
	font-weight: 700;
	color: #fff;
	margin: 0 0 0.75rem;
}

.site-footer__menu,
.site-footer__legal-menu,
.site-footer__social {
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-footer__menu li,
.site-footer__legal-menu li {
	margin-bottom: 0.4rem;
}

.site-footer__social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1rem;
}

.site-footer__legal {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	font-size: 0.9rem;
}

.site-footer__legal-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

@media (max-width: 800px) {
	.site-footer__grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 520px) {
	.site-footer__grid {
		grid-template-columns: 1fr;
	}
}

/* Homepage hero — full-bleed visual plane */
.home-hero {
	position: relative;
	padding: clamp(2.5rem, 8vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem);
	overflow: hidden;
	isolation: isolate;
}

.home-hero__plane {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(1200px 480px at 80% -10%, rgba(31, 122, 77, 0.18), transparent 60%),
		linear-gradient(165deg, #0b1f3a 0%, #163456 48%, #1a4a38 100%);
	z-index: -1;
}

.home-hero__inner {
	color: #e8eef7;
	max-width: 40rem;
	animation: dm-fade-up 420ms ease both;
}

.home-hero__brand {
	font-family: var(--dm-font-heading);
	font-size: clamp(1.75rem, 4vw, 2.75rem);
	font-weight: 700;
	color: #fff;
	margin: 0 0 0.35rem;
	letter-spacing: -0.02em;
}

.home-hero__title {
	color: #fff;
	font-size: clamp(1.35rem, 2.6vw, 1.85rem);
	font-weight: 600;
	margin: 0 0 0.65rem;
}

.home-hero__subtitle {
	margin: 0 0 1.25rem;
	color: #c9d3e0;
	font-size: 1.05rem;
}

.home-hero__trust {
	margin: 1rem 0 0;
	color: #b7c3d4;
	font-size: 0.95rem;
}

.home-hero .dm-search__input {
	border: 0;
}

@keyframes dm-fade-up {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.home-hero__inner {
		animation: none;
	}
}

.home-section {
	padding: 2.5rem 0;
}

.home-section--muted {
	background: var(--dm-surface-muted);
}

.home-section h2 {
	font-size: clamp(1.4rem, 2.4vw, 1.85rem);
	margin-bottom: 1.25rem;
}

.brand-grid,
.category-grid,
.driver-grid,
.post-list--grid {
	display: grid;
	gap: 1rem;
}

.brand-grid {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.category-grid {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.driver-grid,
.post-list--grid {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

@media (max-height: 420px) and (orientation: landscape) {
	.site-header {
		position: static;
	}

	.site-nav__panel-inner,
	.archive-filters__form.is-open {
		max-height: 90vh;
	}
}

.brand-tile,
.category-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 96px;
	padding: 1rem;
	border: 1px solid var(--dm-border);
	border-radius: var(--dm-radius);
	background: var(--dm-surface);
	color: var(--dm-navy);
	text-decoration: none;
	font-weight: 600;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

.brand-tile:hover,
.category-tile:hover {
	border-color: var(--dm-green);
	box-shadow: var(--dm-shadow);
}

.driver-results--row {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}
