/* ==========================================================================
   Motorly landing templates (Vehicle Template + Budget Template)
   Single-column layout matching the original designs on every screen size.
   Everything is scoped to .motorly-* classes so the rest of the site is
   untouched. Colours are set once below – change them here.
   ========================================================================== */

@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
}

.motorly-header,
.motorly-main,
.motorly-landing,
.motorly-footer,
.motorly-sticky-cta {
	--motorly-dark: #17392f;
	--motorly-green: #2e7362;
	--motorly-green-bright: #3a8d76;
	--motorly-tint: #eaf3f0;
	--motorly-soft: #f4f7f6;
	--motorly-text: #1d2431;
	--motorly-muted: #545b68;
	--motorly-line: #dde2e6;
	--motorly-radius: 10px;
	--motorly-column: 640px;
	--wp--style--root--padding-left: 16px;
	--wp--style--root--padding-right: 16px;

	font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--motorly-text);
	-webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Header – logo left, "secure" right, lined up with the page column
   ========================================================================== */
.motorly-header {
	align-items: center;
	padding: 10px max(16px, calc((100% - var(--motorly-column)) / 2));
	background: #fff;
	border-bottom: 1px solid var(--motorly-line);
}
.motorly-header .wp-block-site-logo img {
	max-height: 32px;
	width: auto;
}
.motorly-header .motorly-secure {
	margin-left: auto !important; /* stays on the right even before a logo is set */
	gap: 6px;
	align-items: center;
	margin: 0;
}
.motorly-secure .wp-block-image {
	margin: 0;
	line-height: 0;
}
.motorly-secure .wp-block-image img {
	display: block;
	width: 16px;
	height: auto;
}
.motorly-secure .motorly-secure__text {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	color: var(--motorly-green);
}

/* ==========================================================================
   Main column
   The template's <main> holds Post Content; the page content starts with
   the full-width .motorly-landing group.
   ========================================================================== */
.motorly-main,
.motorly-main > .wp-block-post-content,
.motorly-main > .wp-block-post-content > .motorly-landing:first-child {
	margin-block-start: 0;
	padding-top: 0;
}
.motorly-main {
	padding-bottom: 0;
}
.motorly-landing {
	margin-block-start: 0;
	padding-bottom: 24px;
	font-size: 16px;
	line-height: 1.5;
}
.motorly-landing > * {
	margin-block-start: 16px;
	margin-block-end: 0;
}

/* Hero banner */
.motorly-landing > .motorly-hero {
	margin-block-start: 0;
	padding-top: 14px;
	padding-bottom: 14px;
	background:
		radial-gradient(120% 140% at 85% 30%, rgba(108, 190, 160, 0.55) 0%, rgba(108, 190, 160, 0) 60%),
		linear-gradient(100deg, var(--motorly-dark) 0%, #24604f 45%, #3d927a 100%);
}
.motorly-hero h1 {
	margin: 0 auto;
	color: #fff;
	text-align: center;
	text-transform: uppercase;
	font-family: inherit;
	font-size: clamp(22px, 6.4vw, 34px);
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: 0;
	text-wrap: balance;
}

/* Headings */
.motorly-landing h2.motorly-subtitle,
.motorly-landing h2.motorly-question {
	text-align: center;
	font-family: inherit;
	font-weight: 700;
	letter-spacing: 0;
	color: var(--motorly-text);
	text-wrap: balance;
}
.motorly-landing h2.motorly-subtitle {
	margin-block-start: 14px;
	font-size: clamp(18px, 4.8vw, 22px);
	line-height: 1.3;
}
.motorly-landing h2.motorly-question {
	margin-block-start: 14px;
	font-size: clamp(19px, 5.2vw, 24px);
	line-height: 1.3;
}

/* Checklist – each row is an editable tick image + paragraph */
.motorly-landing .motorly-checklist {
	margin-block-start: 10px;
}
.motorly-checklist > .motorly-check {
	gap: 12px;
	align-items: center;
	margin: 0 0 4px;
}
.motorly-check .wp-block-image {
	flex: 0 0 auto;
	margin: 0 0 0 2px;
	line-height: 0;
}
.motorly-check .wp-block-image img {
	display: block;
	width: 21px;
	height: auto;
}
.motorly-check .motorly-check__text {
	margin: 0;
	font-size: 17px;
	line-height: 1.45;
}

/* ==========================================================================
   Selection tiles – each tile is a group with an (optional) icon image and
   a label paragraph. landing.js makes them clickable and keyboard friendly.
   ========================================================================== */
.motorly-landing .motorly-tiles {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-block-start: 10px;
}
.motorly-tiles > .motorly-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 60px;
	margin: 0;
	padding: 10px 8px;
	border: 2px solid var(--motorly-green-bright);
	border-radius: var(--motorly-radius);
	background: #fff;
	color: var(--motorly-text);
	text-align: center;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.motorly-tiles > .motorly-tile > * {
	margin: 0;
}
.motorly-tiles > .motorly-tile--wide {
	grid-column: 1 / -1;
}
.motorly-tiles--vehicle > .motorly-tile {
	min-height: 92px;
}
.motorly-tile .wp-block-image {
	line-height: 0;
}
.motorly-tile .wp-block-image img {
	display: block;
	width: 46px;
	height: auto;
	max-height: 34px;
	object-fit: contain;
}
.motorly-tile .motorly-tile__label {
	font-size: clamp(17px, 4.6vw, 20px);
	line-height: 1.2;
	user-select: none;
}
.motorly-tiles > .motorly-tile:hover {
	background: var(--motorly-tint);
}
.motorly-tiles > .motorly-tile:focus-visible {
	outline: 3px solid var(--motorly-dark);
	outline-offset: 2px;
}
.motorly-tiles > .motorly-tile.is-chosen {
	background: var(--motorly-tint);
	box-shadow: inset 0 0 0 1px var(--motorly-green-bright);
}
.motorly-tiles > .motorly-tile.is-chosen .motorly-tile__label {
	font-weight: 600;
}
/* Tick badge on the chosen tile (a selection state, set in CSS) */
.motorly-tiles > .motorly-tile.is-chosen::after {
	content: "";
	position: absolute;
	top: 7px;
	right: 7px;
	width: 20px;
	height: 20px;
	background: url("../icons/check-badge.svg") center / contain no-repeat;
}

/* ==========================================================================
   Call to action
   ========================================================================== */
.wp-block-buttons.motorly-cta-wrap {
	margin-block-start: 12px;
}
.motorly-cta-wrap > .wp-block-button.motorly-cta {
	width: 100%;
	margin: 0;
}
.motorly-cta-wrap .wp-block-button.motorly-cta .wp-block-button__link,
.motorly-sticky-cta__link {
	display: block;
	width: 100%;
	border: 0;
	border-radius: 8px;
	background: var(--motorly-green);
	color: #fff;
	font-family: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	box-shadow: 0 2px 0 rgba(23, 57, 47, 0.25);
	transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.motorly-cta-wrap .wp-block-button.motorly-cta .wp-block-button__link {
	padding: 12px 16px 11px;
	font-size: clamp(22px, 6vw, 26px);
}
.motorly-cta-wrap .wp-block-button.motorly-cta .wp-block-button__link:hover,
.motorly-cta-wrap .wp-block-button.motorly-cta .wp-block-button__link:focus-visible,
.motorly-sticky-cta__link:hover,
.motorly-sticky-cta__link:focus-visible {
	background: var(--motorly-dark);
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(23, 57, 47, 0.3);
}
.motorly-cta-wrap .wp-block-button.motorly-cta .wp-block-button__link:active {
	transform: translateY(0);
	box-shadow: 0 2px 0 rgba(23, 57, 47, 0.25);
}
.motorly-cta__arrow {
	display: inline-block;
	transition: transform 0.2s ease;
	animation: motorly-nudge 3.2s ease-in-out 1.5s infinite;
}
.motorly-cta .wp-block-button__link:hover .motorly-cta__arrow,
.motorly-sticky-cta__link:hover .motorly-cta__arrow {
	animation: none;
	transform: translateX(5px);
}
@keyframes motorly-nudge {
	0%, 80%, 100% { transform: translateX(0); }
	88% { transform: translateX(5px); }
	94% { transform: translateX(1px); }
}
.motorly-cta__note {
	display: inline-block;
	margin-top: 3px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
}

/* Sticky bar – added by landing.js once the main button scrolls away */
.motorly-sticky-cta,
.motorly-sticky-cta * {
	box-sizing: border-box;
}
.motorly-sticky-cta {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 50;
	padding: 10px max(16px, calc((100% - var(--motorly-column)) / 2)) calc(10px + env(safe-area-inset-bottom));
	background: rgba(255, 255, 255, 0.97);
	box-shadow: 0 -6px 20px rgba(23, 57, 47, 0.15);
	transform: translateY(110%);
	transition: transform 0.25s ease;
}
.motorly-sticky-cta.is-visible {
	transform: translateY(0);
}
.motorly-sticky-cta__link {
	padding: 13px 16px;
	font-size: 19px;
}
body.motorly-landing-page {
	padding-bottom: 76px;
}

/* ==========================================================================
   Copy and compliance
   ========================================================================== */
.motorly-landing .motorly-disclaimer {
	margin-block-start: 12px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--motorly-muted);
}
.motorly-disclaimer strong {
	color: var(--motorly-text);
}
.motorly-landing .motorly-intro {
	margin-block-start: 28px;
	text-align: center;
	font-size: clamp(16px, 4.4vw, 18px);
	line-height: 1.55;
}

.motorly-landing .motorly-compliance {
	margin-block-start: 22px;
	padding: 0;
}
.motorly-compliance > * {
	margin-block: 14px 0;
}
.motorly-compliance > :first-child {
	margin-block-start: 0;
}
.motorly-compliance .motorly-rep {
	padding: 12px 14px;
	border-radius: var(--motorly-radius);
	background: var(--motorly-soft);
	text-align: center;
	font-size: 14px;
	line-height: 1.55;
	color: var(--motorly-text);
}
.motorly-compliance .motorly-small-print {
	text-align: center;
	font-size: 14px;
	line-height: 1.55;
	color: var(--motorly-muted);
}
.motorly-reviews {
	display: flex;
	justify-content: center;
	margin-top: 22px;
}
.motorly-reviews:empty {
	display: none;
}

/* ==========================================================================
   "More about…" accordion
   ========================================================================== */
.motorly-landing .wp-block-details.motorly-accordion {
	margin-block-start: 28px;
	padding: 0 12px;
	border: 0;
	border-top: 1px solid var(--motorly-line);
	border-bottom: 1px solid var(--motorly-line);
	border-radius: 0;
	overflow: hidden;
	transition: background-color 0.3s ease;
}
.motorly-landing .wp-block-details.motorly-accordion[open] {
	background: var(--motorly-soft);
}
.motorly-accordion summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 0;
	font-size: clamp(17px, 4.8vw, 20px);
	font-weight: 700;
	list-style: none;
	cursor: pointer;
	outline: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
}
.motorly-accordion summary::-webkit-details-marker {
	display: none;
}
/* No box after a mouse click/tap; a soft ring only for keyboard users */
.motorly-accordion summary:focus {
	outline: none;
}
.motorly-accordion summary:focus-visible {
	outline: 2px solid var(--motorly-green-bright);
	outline-offset: 4px;
	border-radius: 4px;
}
/* Plus that turns into a minus: the vertical bar shrinks away */
.motorly-accordion summary::after {
	content: "";
	flex: 0 0 18px;
	height: 18px;
	background:
		linear-gradient(var(--motorly-green-bright), var(--motorly-green-bright)) center / 16px 2.5px no-repeat,
		linear-gradient(var(--motorly-green-bright), var(--motorly-green-bright)) center / 2.5px 16px no-repeat;
	transition: transform 0.35s ease, background-size 0.35s ease;
}
.motorly-accordion[open] summary::after {
	transform: rotate(180deg);
	background-size: 16px 2.5px, 2.5px 0;
}
.motorly-accordion > :not(summary) {
	margin: 0 0 14px;
	font-size: 16px;
	line-height: 1.6;
	color: var(--motorly-text);
	transition: opacity 0.3s ease, transform 0.3s ease;
}
.motorly-accordion > :last-child {
	margin-bottom: 18px;
}
/* Text fades/slides in while the panel opens (class set by landing.js) */
.motorly-accordion.is-animating:not(.is-opening) > :not(summary),
.motorly-accordion.is-opening.is-start > :not(summary) {
	opacity: 0;
	transform: translateY(-4px);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.motorly-footer {
	padding: 24px max(16px, calc((100% - var(--motorly-column)) / 2)) 32px;
	border-top: 1px solid var(--motorly-line);
	text-align: center;
	font-size: 13px;
	line-height: 1.55;
	color: var(--motorly-muted);
}
.motorly-footer p {
	margin: 0 0 8px;
}

/* ==========================================================================
   Larger screens – same layout, a little more presence and breathing room
   ========================================================================== */
@media (min-width: 782px) {
	.motorly-header .wp-block-site-logo img {
		max-height: 40px;
	}
	.motorly-landing > .motorly-hero {
		padding-top: 36px;
		padding-bottom: 36px;
	}
	.motorly-hero h1 {
		font-size: 40px;
	}
	.motorly-landing h2.motorly-subtitle {
		margin-block-start: 28px;
		font-size: 24px;
	}
	/* Checklist in a single centred row. It may run a little wider than the
	   640px column so all three items fit on one line; it wraps (still
	   centred) if the screen is too narrow. */
	.motorly-landing .motorly-checklist {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 8px 28px;
		width: max-content;
		max-width: calc(100vw - 32px);
		margin-block-start: 18px;
		/* Centre on the column even when wider than it */
		margin-left: 50% !important;
		margin-right: 0 !important;
		transform: translateX(-50%);
	}
	.motorly-checklist > .motorly-check {
		gap: 9px;
		margin: 0;
	}
	.motorly-check .motorly-check__text {
		white-space: nowrap;
	}
	.motorly-landing h2.motorly-question {
		margin-block-start: 24px;
		font-size: 26px;
	}
	.motorly-landing .motorly-tiles {
		gap: 14px;
		margin-block-start: 14px;
	}
	.motorly-tiles > .motorly-tile {
		min-height: 64px;
	}
	.motorly-tiles--vehicle > .motorly-tile {
		min-height: 110px;
	}
	.motorly-tile .motorly-tile__label {
		font-size: 20px;
	}
	.motorly-tiles > .motorly-tile:hover {
		transform: translateY(-1px);
	}
	.wp-block-buttons.motorly-cta-wrap {
		margin-block-start: 16px;
	}
	.motorly-cta-wrap .wp-block-button.motorly-cta .wp-block-button__link {
		padding: 16px 16px 14px;
		font-size: 28px;
	}
	.motorly-landing .motorly-intro {
		margin-block-start: 40px;
		font-size: 19px;
	}
	.motorly-landing .motorly-compliance {
		margin-block-start: 28px;
	}
	.motorly-landing .wp-block-details.motorly-accordion {
		margin-block-start: 36px;
	}
	.motorly-accordion summary:hover {
		color: var(--motorly-green);
	}
	.motorly-landing {
		padding-bottom: 48px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.motorly-tiles > .motorly-tile,
	.motorly-cta .wp-block-button__link,
	.motorly-sticky-cta,
	.motorly-sticky-cta__link,
	.motorly-cta__arrow,
	.motorly-accordion,
	.motorly-accordion summary::after,
	.motorly-accordion > :not(summary) {
		transition: none;
		animation: none;
	}
}
