/* ============================================================================
   Maktune v5 — homepage chapters
   ----------------------------------------------------------------------------
   Loads on the front page only. Everything shared with other routes lives in
   v5-system.css; if a rule here would be useful on a second page, it belongs
   there instead.

   Layout principle: no chapter uses the same grid as the one before it. The
   old homepage was eleven card grids in a row, which is what made it read as a
   template regardless of how the cards were styled.
   ========================================================================== */

/* ============================================================ 1. Hero ===== */

.v5-hero { padding-block: clamp(28px, 4vw, 56px) clamp(56px, 7vw, 104px); }

.v5-hero-grid {
	display: grid;
	gap: 16px;
	grid-template-columns: 1fr 1fr;
	grid-template-areas:
		"lead lead"
		"a    b";
}
.v5-hero-tile--lead { grid-area: lead; }
.v5-hero-tile:nth-child(2) { grid-area: a; }
.v5-hero-tile:nth-child(3) { grid-area: b; }

.v5-hero-tile { position: relative; display: flex; flex-direction: column; }

/* The lead tile is one composition: image with the copy sitting on it. The two
   supporting tiles keep copy BELOW the image, because a headline over a
   detail shot of a castor has nothing to sit on. */
.v5-hero-tile--lead .v5-media {
	aspect-ratio: 21 / 9;
	min-height: 380px;
}
.v5-hero-tile--lead .v5-media::after {
	/* Legibility scrim. Bottom-weighted so the top of the photograph is
	   untouched — a full overlay flattens the product. */
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		to right,
		rgba(11, 12, 15, .90) 0%,
		rgba(11, 12, 15, .72) 34%,
		rgba(11, 12, 15, .18) 66%,
		rgba(11, 12, 15, .05) 100%
	);
}
.v5-hero-tile--lead .v5-hero-copy {
	position: absolute;
	z-index: 2;
	inset-inline-start: clamp(24px, 4vw, 60px);
	inset-block-end: clamp(28px, 4vw, 56px);
	max-width: min(540px, 62%);
	color: var(--v5-on-dark);
}
.v5-hero-tile--lead .v5-lede { color: rgba(244, 245, 247, .80); }

.v5-hero-tile:not(.v5-hero-tile--lead) .v5-hero-copy { padding: 20px 2px 0; }
.v5-hero-tile:not(.v5-hero-tile--lead) p {
	color: var(--v5-on-dark-soft);
	margin: 8px 0 14px;
	font-size: 15px;
	line-height: 1.55;
	max-width: 42ch;
}

/* ================================================= 2. Shop the system ===== */

.v5-worlds {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: clamp(16px, 2vw, 28px);
}
.v5-world {
	display: block;
	text-decoration: none;
	color: inherit;
	border: 1px solid var(--v5-paper-3);
	border-radius: var(--mk-r-lg);
	overflow: hidden;
	background: #fff;
	transition: border-color var(--mk-dur) var(--v5-ease), transform var(--mk-dur) var(--v5-ease);
}
.v5-world:hover { border-color: var(--v5-ink); transform: translateY(-2px); }
.v5-world-media { border-radius: 0; background: var(--v5-paper-2); }
.v5-world-media img { padding: 6%; }
.v5-world-copy { padding: clamp(20px, 2.2vw, 30px); }
.v5-world-copy p { color: var(--v5-ink-soft); margin: 10px 0 16px; max-width: 40ch; }

/* ================================================ 3. Maktune difference === */

.v5-diff {
	display: grid;
	grid-template-columns: 1.25fr .75fr;
	gap: clamp(28px, 5vw, 72px);
	align-items: center;
}
.v5-diff-media { align-self: stretch; min-height: 340px; }

.v5-diff-list {
	list-style: none;
	margin: clamp(40px, 5vw, 68px) 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: clamp(20px, 2.4vw, 36px);
	border-top: 1px solid var(--v5-graphite-3);
	padding-top: clamp(28px, 3vw, 44px);
}
.v5-diff-list p { color: var(--v5-on-dark-soft); font-size: 14.5px; line-height: 1.6; margin: 8px 0 0; }
.v5-diff-t { font-size: 16px; font-weight: 620; letter-spacing: -0.014em; margin: 0; }

/* ====================================================== 4. Engineering ==== */

.v5-features {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(20px, 2.6vw, 40px);
}
.v5-feature .v5-media { margin-bottom: 22px; background: var(--v5-paper-2); }
.v5-feature p { color: var(--v5-ink-soft); line-height: 1.62; margin: 12px 0 0; }
.v5-feature .v5-eyebrow { margin-bottom: 10px; }
.v5-spec {
	font-family: var(--mk-font-mono);
	font-size: 12.5px !important;
	color: var(--v5-ink) !important;
	letter-spacing: -0.005em;
	margin-top: 16px !important;
	padding-top: 14px;
	border-top: 1px solid var(--v5-paper-3);
}
/* ======================================= 7 & 8. Honest empty states ======= */

/* Reads as a considered, unfinished frame — not a broken image. Deliberately
   quiet: hatching, not a big grey box with an icon. */
.v5-slot-empty {
	display: grid;
	place-items: center;
	border: 1px dashed var(--v5-paper-3);
	background:
		repeating-linear-gradient(
			-45deg,
			transparent 0 9px,
			rgba(20, 23, 31, .028) 9px 18px
		),
		var(--v5-paper-2);
}
.v5-slot-empty span {
	font-size: 12px;
	letter-spacing: .05em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--mk-muted-soft);
}
.v5-dark .v5-slot-empty {
	border-color: var(--v5-graphite-3);
	background:
		repeating-linear-gradient(-45deg, transparent 0 9px, rgba(255, 255, 255, .03) 9px 18px),
		var(--v5-graphite-2);
}

.v5-factory { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 1.6vw, 24px); }
.v5-factory figure { margin: 0; }
.v5-factory figcaption { margin-top: 12px; font-size: 14px; font-weight: 560; color: var(--v5-ink-soft); }

.v5-inspire { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(10px, 1.2vw, 18px); }

/* ========================================================= 9. Creator ===== */

.v5-creator {
	display: grid;
	grid-template-columns: 1fr .85fr;
	gap: clamp(28px, 5vw, 72px);
	align-items: center;
}
.v5-creator-media { background: var(--v5-graphite-2); }
.v5-creator-media img { padding: 5%; }

/* ========================================================= 10. Reviews ==== */

.v5-reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); }
.v5-review {
	margin: 0;
	padding: 26px 26px 22px;
	border: 1px solid var(--v5-paper-3);
	border-radius: var(--mk-r-lg);
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.v5-review blockquote { margin: 0; font-size: 16px; line-height: 1.6; letter-spacing: -0.008em; }
.v5-review figcaption { margin-top: auto; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.v5-review-who { font-weight: 620; }
.v5-review figcaption a { color: var(--v5-ink-soft); text-decoration: none; }
.v5-review figcaption a:hover { color: var(--v5-blue); }

/* ================================================ 11. Reassurance ========= */

.v5-help-h { margin-bottom: clamp(24px, 3vw, 36px); }
.v5-help {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(20px, 2.4vw, 34px) clamp(24px, 3vw, 48px);
}
.v5-help h3 { font-size: 15px; font-weight: 620; letter-spacing: -0.012em; margin: 0 0 6px; }
.v5-help p { font-size: 14px; line-height: 1.58; color: var(--v5-ink-soft); margin: 0 0 8px; }

/* ============================================================================
   Breakpoints
   ----------------------------------------------------------------------------
   Mobile is designed, not compressed. The rules below change the SHAPE of a
   chapter rather than just letting it reflow: six anatomy columns become two,
   four product columns become one, and the hero's overlaid copy moves out from
   under the photograph rather than sitting on a scrim it no longer fits.
   ========================================================================== */

@media (max-width: 1080px) {
	.v5-features { grid-template-columns: 1fr; gap: clamp(28px, 5vw, 44px); }
	.v5-feature { display: grid; grid-template-columns: minmax(0, 280px) 1fr; gap: 24px; align-items: start; }
	.v5-feature .v5-media { margin-bottom: 0; }
	.v5-feature .v5-eyebrow,
	.v5-feature h3, .v5-feature p, .v5-feature .v5-spec { grid-column: 2; }
	.v5-feature .v5-media { grid-row: 1 / span 4; }

	.v5-diff { grid-template-columns: 1fr; }
	.v5-diff-media { order: -1; min-height: 0; aspect-ratio: 16 / 10; }
	.v5-diff-list { grid-template-columns: repeat(2, 1fr); }
	.v5-creator { grid-template-columns: 1fr; }
	.v5-creator-media { order: -1; }
	.v5-reviews { grid-template-columns: 1fr; }
	.v5-help { grid-template-columns: repeat(2, 1fr); }
	.v5-factory { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
	.v5-hero-grid { grid-template-columns: 1fr; grid-template-areas: "lead" "a" "b"; }
	.v5-hero-tile--lead .v5-media { aspect-ratio: 4 / 5; min-height: 0; }
	/* The overlay scrim becomes a bottom gradient once the frame is tall and
	   narrow — a left-weighted one leaves the headline on open photograph. */
	.v5-hero-tile--lead .v5-media::after {
		background: linear-gradient(to top, rgba(11, 12, 15, .94) 0%, rgba(11, 12, 15, .62) 42%, rgba(11, 12, 15, .06) 100%);
	}
	.v5-hero-tile--lead .v5-hero-copy { max-width: none; inset-inline: 22px; inset-block-end: 26px; }

	.v5-worlds { grid-template-columns: 1fr; }
	.v5-inspire { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
	.v5-feature { grid-template-columns: 1fr; }
	.v5-feature .v5-media { grid-row: auto; margin-bottom: 18px; }
	.v5-feature .v5-eyebrow, .v5-feature h3,
	.v5-feature p, .v5-feature .v5-spec { grid-column: 1; }

	.v5-diff-list { grid-template-columns: 1fr; gap: 24px; }
	.v5-factory { grid-template-columns: 1fr; }
	.v5-help { grid-template-columns: 1fr; }
}

/* ============================================================================
   Routed pages: /find-your-part/, /engineering/, /affiliate/
   ----------------------------------------------------------------------------
   These reuse the homepage chapter system, so only their own components live
   here. v5-routes.php turns this stylesheet on for those routes.
   ========================================================================== */

/* ------------------------------------------------------- Find Your Part -- */

.v5-symptoms { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.v5-symptoms li {
	display: grid;
	grid-template-columns: 108px 1fr auto;
	gap: clamp(16px, 2.4vw, 32px);
	align-items: center;
	padding: 18px;
	background: #fff;
	border: 1px solid var(--v5-paper-3);
	border-radius: var(--mk-r-lg);
	transition: border-color var(--mk-dur) var(--v5-ease);
}
.v5-symptoms li:hover { border-color: var(--v5-ink); }
.v5-symptom-media { aspect-ratio: 1 / 1; background: var(--v5-paper); border-radius: var(--mk-r); overflow: hidden; }
.v5-symptom-media img { width: 100%; height: 100%; object-fit: contain; padding: 8%; display: block; }
.v5-symptom-body p { color: var(--v5-ink-soft); margin: 8px 0 0; font-size: 14.5px; line-height: 1.58; max-width: 54ch; }
.v5-symptom-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px !important; font-size: 12.5px !important; }
.v5-symptom-sku { font-family: var(--mk-font-mono); color: var(--mk-muted-soft); }
.v5-symptom-buy { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; text-align: right; }
/*
 * NOT `white-space: nowrap`. The button carries the real product name, and
 * "Hydraulic Gas Lift Cylinder" on a 390px screen then refuses to shrink and
 * pushes the whole document 48px wider than the viewport — measured.
 * A grid item also defaults to min-width:auto, so it will not shrink below its
 * content no matter what the track says; both have to be undone.
 */
.v5-symptoms li > * { min-width: 0; }
.v5-symptom-buy .v5-btn { text-align: center; }

.v5-notsure {
	display: grid;
	grid-template-columns: 1.4fr auto;
	gap: clamp(24px, 4vw, 56px);
	align-items: center;
}
.v5-notsure .v5-actions { margin-top: 0; }

/* ---------------------------------------------------------- Engineering -- */

.v5-engrow {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(28px, 5vw, 72px);
	align-items: center;
}
.v5-engrow--flip .v5-media { order: 2; }
.v5-engbody .v5-lede { margin-top: 16px; }

/* ------------------------------------------------------------ Affiliate -- */

.v5-diff-list--paper { border-top-color: var(--v5-paper-3); }
.v5-diff-list--paper p { color: var(--v5-ink-soft); }

.v5-steps {
	list-style: none;
	counter-reset: step;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: clamp(20px, 2.4vw, 36px);
}
.v5-steps li { counter-increment: step; }
/* A step number is the one place a numeral is doing real work — it is the
   sequence itself. This is not the decorative "01 / 02 / 03" the brief removed
   from the homepage sections. */
.v5-steps li::before {
	content: counter(step);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin-bottom: 16px;
	border-radius: var(--mk-r-circle);
	border: 1px solid var(--v5-graphite-3);
	font-size: 13px;
	font-weight: 650;
	color: var(--v5-on-dark);
}
.v5-steps h3 { font-size: 16px; font-weight: 620; letter-spacing: -0.014em; margin: 0 0 8px; }
.v5-steps p { color: var(--v5-on-dark-soft); font-size: 14.5px; line-height: 1.6; margin: 0; }

.v5-terms { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(24px, 4vw, 64px); }
.v5-terms > div {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 20px;
	padding: 16px 0;
	border-bottom: 1px solid var(--v5-paper-3);
}
.v5-terms dt { font-weight: 600; font-size: 15px; }
.v5-terms dd { margin: 0; text-align: right; color: var(--v5-ink-soft); font-size: 14.5px; }
.v5-faq details {
	border-bottom: 1px solid var(--v5-paper-3);
	padding: 4px 0;
}
.v5-faq summary {
	cursor: pointer;
	list-style: none;
	padding: 18px 36px 18px 0;
	font-size: 16.5px;
	font-weight: 600;
	letter-spacing: -0.014em;
	position: relative;
}
.v5-faq summary::-webkit-details-marker { display: none; }
.v5-faq summary::after {
	content: "";
	position: absolute;
	right: 6px;
	top: 50%;
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--mk-muted-soft);
	border-bottom: 2px solid var(--mk-muted-soft);
	transform: translateY(-70%) rotate(45deg);
	transition: transform var(--mk-dur) var(--v5-ease);
}
.v5-faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.v5-faq p { margin: 0 0 20px; color: var(--v5-ink-soft); line-height: 1.62; max-width: 62ch; }

@media (max-width: 1080px) {
	.v5-steps { grid-template-columns: repeat(2, 1fr); }
	.v5-engrow { grid-template-columns: 1fr; }
	.v5-engrow--flip .v5-media { order: 0; }
	.v5-terms { grid-template-columns: 1fr; }
	.v5-notsure { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
	.v5-symptoms li { grid-template-columns: 76px 1fr; }
	.v5-symptom-buy {
		grid-column: 1 / -1;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		text-align: left;
		border-top: 1px solid var(--v5-paper-3);
		padding-top: 14px;
	}
	.v5-symptom-buy .v5-btn {
		flex: 1;
		margin-left: 12px;
		min-width: 0;
		padding-inline: 14px;
		font-size: 14px;
		line-height: 1.25;
		/* The label is a product name, so it must be allowed two lines rather
		   than forcing the row wider than the screen. */
		white-space: normal;
		min-height: 48px;
	}
	.v5-steps { grid-template-columns: 1fr; }
}
