/* ==========================================================================
   Turbo Reman Center: subpages (pages, blog, 404)
   ========================================================================== */

/* Long-form text (Terms, Privacy, blog posts) ------------------------------ */

.page-body {
	padding-block: clamp(40px, 6vw, 88px) var(--space-section);
}

.prose {
	max-width: 72ch;
	color: var(--c-text);
	font-size: 1.0625rem;
	line-height: 1.7;
}

.prose > * + * {
	margin-top: 1em;
}

.prose h2,
.prose h3,
.prose h4 {
	margin: 1.8em 0 0.5em;
	color: var(--c-ink);
	line-height: 1.1;
	text-wrap: balance;
}

.prose h2 {
	font-size: clamp(1.75rem, 1.5rem + 0.9vw, 2.25rem);
}

.prose h3 {
	font-size: clamp(1.375rem, 1.25rem + 0.5vw, 1.625rem);
}

.prose h4 {
	font-size: 1.25rem;
}

.prose > :first-child {
	margin-top: 0;
}

.prose ul,
.prose ol {
	display: grid;
	gap: 0.5em;
	padding-left: 1.3em;
}

.prose li::marker {
	color: var(--c-red);
}

.prose strong {
	color: var(--c-ink);
	font-weight: 600;
}

.prose a {
	color: var(--c-red-600);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	overflow-wrap: anywhere;
}

.prose img {
	height: auto;
	border-radius: var(--radius-lg);
}

.prose blockquote {
	padding-left: 1em;
	border-left: 2px solid var(--c-line-strong);
	color: var(--c-ink);
	font-style: italic;
}

/* Contact ----------------------------------------------------------------- */

.contact {
	padding-block: clamp(48px, 6vw, 96px) clamp(40px, 5vw, 72px);
}

.contact__grid {
	display: grid;
	gap: clamp(32px, 5vw, 64px);
	align-items: start;
}

@media (min-width: 1024px) {
	.contact__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
}

.contact__intro > p {
	max-width: 58ch;
	margin-top: 16px;
	color: var(--c-text);
	font-size: 1.0625rem;
	line-height: 1.65;
}

.contact__intro > p a {
	color: var(--c-red-600);
	font-weight: 500;
	white-space: nowrap;
}

.contact-list {
	display: grid;
	gap: 14px;
	margin-top: 32px;
	padding-top: 28px;
	border-top: 1px solid var(--c-line);
}

@media (min-width: 640px) {
	.contact-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px 32px;
	}
}

.contact-list dt {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--c-muted);
	font-size: 0.875rem;
	font-weight: 500;
}

.contact-list dt .icon {
	width: 18px;
	height: 18px;
	color: var(--c-red);
}

.contact-list dd {
	display: grid;
	gap: 2px;
	margin-top: 6px;
	color: var(--c-ink);
	font-weight: 500;
}

.contact-list dd a {
	justify-self: start;
	color: var(--c-ink);
	text-decoration: none;
	font-variant-numeric: tabular-nums;
}

@media (hover: hover) and (pointer: fine) {
	.contact-list dd a:hover {
		color: var(--c-red-600);
		text-decoration: underline;
		text-underline-offset: 0.2em;
	}
}

/* Form card */

.contact__form {
	padding: clamp(24px, 3vw, 40px);
	border-radius: var(--radius-lg);
	background: var(--c-surface);
}

.contact-form {
	display: grid;
	gap: 18px;
}

.field {
	display: grid;
	gap: 6px;
}

.field__label {
	color: var(--c-ink);
	font-weight: 500;
}

.field__hint {
	color: var(--c-muted);
	font-weight: 400;
}

.field__input {
	width: 100%;
	min-height: 52px;
	padding: 12px 16px;
	border: 1px solid var(--c-line-strong);
	border-radius: var(--radius-sm);
	background: var(--c-white);
	color: var(--c-ink);
	font: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input--area {
	min-height: 150px;
	resize: vertical;
}

.field__input:focus {
	border-color: var(--c-red);
	outline: none;
	box-shadow: 0 0 0 4px rgb(229 39 39 / 0.14);
}

.field__input:user-invalid {
	border-color: var(--c-red-600);
}

.contact-form__submit {
	justify-self: start;
	min-width: 180px;
}

.form-status {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 14px 16px;
	border-radius: var(--radius-sm);
	font-weight: 500;
	line-height: 1.45;
}

.form-status .icon {
	flex: none;
	width: 20px;
	height: 20px;
	margin-top: 1px;
}

.form-status.is-ok {
	background: #e8f5ec;
	color: #1d5c32;
}

.form-status.is-error {
	background: var(--c-red-50);
	color: var(--c-red-700);
}

/* Map: a dark card until the visitor loads Google's map */

.map {
	padding-block: 0 var(--space-section);
}

.map__frame {
	position: relative;
	display: grid;
	min-height: 320px;
	overflow: hidden;
	border-radius: var(--radius-lg);
	background:
		radial-gradient(circle at 1px 1px, rgb(255 255 255 / 0.12) 1px, transparent 0) 0 0 / 22px 22px,
		var(--c-dark);
	color: var(--c-white);
}

/* A min-height with a fixed ratio would force the card wider than a phone, so the ratio starts at 768px. */
@media (min-width: 768px) {
	.map__frame {
		aspect-ratio: 16 / 7;
	}
}

.map__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.map__placeholder {
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 14px;
	padding: 24px;
	text-align: center;
}

.map__pin {
	display: grid;
	place-items: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--c-red);
	box-shadow: 0 12px 24px -10px rgb(0 0 0 / 0.6);
}

.map__pin .icon {
	width: 28px;
	height: 28px;
}

.map__address {
	color: var(--c-white);
	font-family: var(--font-display);
	font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
	font-weight: 600;
	line-height: 1.1;
}

.map__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 6px;
}

.map :focus-visible {
	outline-color: var(--c-white);
}

/* FAQ --------------------------------------------------------------------- */

.faq {
	padding-block: clamp(40px, 6vw, 88px) var(--space-section);
}

.faq__inner {
	display: grid;
	gap: 40px;
	align-items: start;
}

@media (min-width: 1024px) {
	.faq__inner {
		grid-template-columns: minmax(0, 1fr) 340px;
		gap: clamp(48px, 6vw, 96px);
	}

	/* The call card stays beside the questions. */
	.faq .help-card {
		position: sticky;
		top: calc(var(--header-nav) + 24px);
	}
}

.faq__list {
	max-width: 860px;
	border-top: 1px solid var(--c-line);
}

.faq-item {
	border-bottom: 1px solid var(--c-line);
}

.faq-item__q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 22px 0;
	color: var(--c-ink);
	font-family: var(--font-display);
	font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
	font-weight: 600;
	line-height: 1.15;
	list-style: none;
	cursor: pointer;
}

.faq-item__q::-webkit-details-marker {
	display: none;
}

/* A plus that turns into a minus. */
.faq-item__sign {
	position: relative;
	flex: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--c-surface);
	transition: background-color 0.2s ease;
}

.faq-item__sign::before,
.faq-item__sign::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 2px;
	border-radius: 2px;
	background: var(--c-ink);
	transform: translate(-50%, -50%);
	transition: transform 0.3s var(--ease-out), background-color 0.2s ease;
}

.faq-item__sign::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

.faq-item[open] .faq-item__sign {
	background: var(--c-red);
}

.faq-item[open] .faq-item__sign::before,
.faq-item[open] .faq-item__sign::after {
	background: var(--c-white);
}

.faq-item[open] .faq-item__sign::after {
	transform: translate(-50%, -50%) rotate(0deg);
}

.faq-item__a {
	padding: 0 56px 24px 0;
	color: var(--c-text);
	font-size: 1.0625rem;
	line-height: 1.65;
}

.faq-item__a a {
	color: var(--c-red-600);
	font-weight: 500;
}

@media (hover: hover) and (pointer: fine) {
	.faq-item__q:hover .faq-item__sign {
		background: var(--c-line);
	}

	.faq-item[open] .faq-item__q:hover .faq-item__sign {
		background: var(--c-red-600);
	}
}

/* Smooth open and close where the browser can animate to auto height. */
@supports (interpolate-size: allow-keywords) {
	.faq-item {
		interpolate-size: allow-keywords;
	}

	.faq-item::details-content {
		height: 0;
		overflow: hidden;
		transition: height 0.35s var(--ease-out), content-visibility 0.35s allow-discrete;
	}

	.faq-item[open]::details-content {
		height: auto;
	}
}

/* Text beside a picture (About, Fuel Injectors) ---------------------------- */

.split {
	padding-block: var(--space-section);
}

.split--surface {
	background: var(--c-surface);
}

.split__inner {
	display: grid;
	gap: clamp(32px, 5vw, 56px);
	align-items: center;
}

@media (min-width: 1024px) {
	.split__inner {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
		gap: clamp(48px, 6vw, 96px);
	}
}

.split__body > p {
	max-width: 62ch;
	margin-top: 18px;
	color: var(--c-text);
	font-size: 1.0625rem;
	line-height: 1.7;
}

.split__body > .btn {
	margin-top: 28px;
}

.split__media img {
	width: 100%;
	height: auto;
}

/* Cut-outs on white or warm grounds sit on the page without a box. */
.split__media--cutout img {
	mix-blend-mode: multiply;
}

.split__media--photo {
	justify-self: center;
	width: min(100%, 460px);
	overflow: hidden;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-2);
}

.split__media--photo img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.split__media--product {
	justify-self: center;
	width: min(80%, 420px);
}

.split__media--product img {
	filter: drop-shadow(0 30px 34px rgb(0 0 0 / 0.28));
}

/* About: the film with its line, and the studio photos ---------------------- */

.film--about {
	background: var(--c-white);
}

.film__lede {
	max-width: 60ch;
	margin: -12px auto clamp(28px, 3.5vw, 44px);
	color: var(--c-text);
	font-size: 1.0625rem;
	line-height: 1.65;
	text-align: center;
	text-wrap: pretty;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	max-width: 1120px;
	margin: clamp(40px, 5vw, 64px) auto 0;
	list-style: none;
}

@media (min-width: 640px) {
	.gallery {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.gallery {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 14px;
	}
}

.gallery__tile {
	display: block;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--c-dark-2);
	cursor: zoom-in;
}

.gallery__tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
	.gallery__tile:hover img {
		transform: scale(1.04);
	}
}

/* About: the story, heading beside its text on wide screens */

.story {
	padding-block: 0 var(--space-section);
}

.story__block {
	display: grid;
	gap: 20px;
	padding-block: clamp(40px, 5vw, 64px);
	border-top: 1px solid var(--c-line);
}

@media (min-width: 1024px) {
	.story__block {
		grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
		gap: clamp(48px, 6vw, 96px);
	}

	.story__block .section-head__title {
		position: sticky;
		top: calc(var(--header-nav) + 32px);
		align-self: start;
	}
}

.story__text {
	display: grid;
	gap: 18px;
	max-width: 66ch;
	color: var(--c-text);
	font-size: 1.0625rem;
	line-height: 1.7;
}

/* 14 photos: tall tiles close the grid into full rows (5 x 3 on tablets, 4 x 4 on wide screens). */
@media (min-width: 640px) {
	.gallery__item:first-child {
		grid-row: span 2;
	}

	.gallery__item:first-child .gallery__tile {
		height: 100%;
		aspect-ratio: auto;
	}
}

@media (min-width: 1024px) {
	.gallery__item:nth-child(8) {
		grid-row: span 2;
	}

	.gallery__item:nth-child(8) .gallery__tile {
		height: 100%;
		aspect-ratio: auto;
	}
}

/* Fuel Injectors ---------------------------------------------------------- */

.inj-brands {
	padding-block: var(--space-section);
	background: var(--c-surface);
}

.inj-brands .brand-card {
	box-shadow: var(--shadow-1);
}

@media (hover: hover) and (pointer: fine) {
	.inj-brands .brand-card:hover {
		box-shadow: var(--shadow-2);
	}
}

/* Three vertical process clips on a dark band. */
.process {
	padding-block: var(--space-section);
	background: var(--c-dark);
}

.process .section-head__title {
	color: var(--c-white);
}

.process__list {
	display: grid;
	gap: 16px;
	list-style: none;
}

@media (min-width: 640px) {
	.process__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: clamp(16px, 2vw, 28px);
	}
}

.clip__video {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 9 / 16;
	border-radius: var(--radius-lg);
	background: var(--c-dark-2);
	object-fit: cover;
}

.clip__caption {
	margin-top: 14px;
	color: var(--c-on-dark);
	font-family: var(--font-display);
	font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
	font-weight: 600;
	line-height: 1.15;
	text-wrap: balance;
}

@media (max-width: 639px) {
	/* One clip per row is too tall on a phone: a centred column keeps each clip on one screen. */
	.clip {
		width: min(100%, 320px);
		margin-inline: auto;
	}
}

/* Bestsellers: the shop's product grid and cards (product-card.css). */
.bestsellers {
	padding-block: var(--space-section);
}

/* The closing band with a single injector instead of the turbocharger. */
.cta.cta .cta__product--injector {
	width: min(42%, 200px);
	max-width: 200px;
}

/* Blog -------------------------------------------------------------------- */

.articles--index {
	padding-block: clamp(40px, 6vw, 88px) var(--space-section);
}

.articles__empty {
	color: var(--c-text);
}

.articles--index .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 40px;
}

.articles--index .page-numbers {
	display: grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding-inline: 14px;
	border: 1px solid var(--c-line-strong);
	border-radius: var(--radius-pill);
	color: var(--c-ink);
	font-weight: 500;
	text-decoration: none;
}

.articles--index .page-numbers.current {
	border-color: var(--c-ink);
	background: var(--c-ink);
	color: var(--c-white);
}

.post-body__media {
	max-width: 860px;
	margin-bottom: clamp(28px, 4vw, 48px);
	overflow: hidden;
	border-radius: var(--radius-lg);
}

.post-body__media img {
	width: 100%;
	height: auto;
}

.post-body__back {
	margin-top: 48px;
}

/* 404 --------------------------------------------------------------------- */

.not-found__text {
	max-width: 56ch;
	color: var(--c-text);
	font-size: 1.125rem;
	line-height: 1.6;
}

.not-found__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 28px;
}

/* Legal pages */

.legal-updated {
	color: var(--c-muted);
	font-size: 0.9375rem;
}

.legal h2 {
	scroll-margin-top: calc(var(--header-nav) + var(--header-top) + 16px);
}

.legal code {
	font-size: 0.9em;
	overflow-wrap: anywhere;
}
