/*
 * Pattern detail page: hero, feature callouts, spec tables, related grid.
 * Reuses .hl-pattern-card from home.css for the related row.
 *
 * Not designed in the bundle; derived from the HILO tokens in base.css.
 */

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hl-pattern-hero {
	position: relative;
	padding: clamp(32px, 4vw, 52px) 0 clamp(40px, 5vw, 64px);
	border-bottom: 1px solid var(--hl-line-2);
	background:
		radial-gradient(700px 400px at 22% 40%, rgba(23, 231, 220, 0.10), transparent 70%),
		var(--hl-black);
}

.hl-pattern-hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
	gap: clamp(28px, 4vw, 56px);
	align-items: center;
}

.hl-pattern-hero__media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	padding: 0;
	border: 1px solid var(--hl-line-2);
	border-radius: var(--hl-radius-product);
	background: radial-gradient(circle at 50% 55%, rgba(23, 231, 220, 0.16), transparent 62%);
}
/* It's a <button> now, so the browser's own chrome has to be reset.
   The frame stays transparent at rest — a faint white box around the product
   shot reads as an unfinished edge rather than as a deliberate tile, and the
   glow behind the tyre already defines the area. The 1px is still declared so
   lighting it up on hover doesn't shift the layout by a pixel. */
button.hl-pattern-hero__media {
	cursor: zoom-in;
	border-color: transparent;
	transition: border-color 0.2s ease;
}
button.hl-pattern-hero__media:hover {
	border-color: var(--hl-cyan);
}
/* Keyboard focus needs more than a 1px tint to be obvious, and unlike :hover it
   must not depend on colour alone. */
button.hl-pattern-hero__media:focus-visible {
	border-color: var(--hl-cyan);
	outline: 2px solid var(--hl-cyan);
	outline-offset: 3px;
}

.hl-pattern-hero__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}
.hl-pattern-hero__thumbs button {
	display: block;
	width: 68px;
	aspect-ratio: 1 / 1;
	padding: 4px;
	border: 1px solid var(--hl-line-2);
	border-radius: 8px;
	background: var(--hl-black);
	cursor: zoom-in;
}
.hl-pattern-hero__thumbs button:hover,
.hl-pattern-hero__thumbs button:focus-visible { border-color: var(--hl-cyan); }
.hl-pattern-hero__thumbs img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* --- Fullscreen lightbox --- */
.hl-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(4, 6, 8, 0.94);
}
.hl-lightbox.is-open { display: flex; }
.hl-lightbox__img {
	max-width: min(92vw, 900px);
	max-height: 88vh;
	object-fit: contain;
}
.hl-lightbox__close,
.hl-lightbox__nav {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	cursor: pointer;
	line-height: 1;
}
.hl-lightbox__close:hover,
.hl-lightbox__nav:hover { background: rgba(255, 255, 255, 0.2); }
.hl-lightbox__close {
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	font-size: 28px;
}
.hl-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	font-size: 30px;
}
.hl-lightbox__nav--prev { left: 20px; }
.hl-lightbox__nav--next { right: 20px; }

@media (max-width: 600px) {
	.hl-lightbox__nav { width: 42px; height: 42px; font-size: 24px; }
	.hl-lightbox__nav--prev { left: 8px; }
	.hl-lightbox__nav--next { right: 8px; }
}
/* The knockout blend itself lives on .hl-knockout in base.css, applied only to
   opaque photos. */
.hl-pattern-hero__media img {
	width: 86%;
	height: auto;
	object-fit: contain;
}

.hl-pattern-hero__tag { margin: 18px 0 0; }

.hl-pattern-hero__heading {
	margin: 14px 0 0;
	font: 700 clamp(34px, 4.6vw, 60px)/0.98 var(--hl-font-head);
	text-transform: uppercase;
	letter-spacing: -0.01em;
}

.hl-pattern-hero__desc {
	margin: 20px 0 0;
	max-width: 560px;
	font: 400 16px/1.65 var(--hl-font-body);
	color: var(--hl-body);
	text-wrap: pretty;
}

.hl-pattern-hero__facts {
	display: flex;
	gap: 40px;
	margin: 26px 0 0;
	padding: 18px 0;
	border-top: 1px solid var(--hl-line);
	border-bottom: 1px solid var(--hl-line);
}
.hl-pattern-hero__facts dt {
	font: 500 10px/1 var(--hl-font-mono);
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--hl-mono);
}
.hl-pattern-hero__facts dd {
	margin: 8px 0 0;
	font: 700 22px/1 var(--hl-font-head);
	color: var(--hl-cyan);
}

.hl-pattern-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-top: 26px;
}

/* ---------------------------------------------------------------------
   Editor intro (post content)
   --------------------------------------------------------------------- */
.hl-pattern__intro {
	padding-top: clamp(40px, 5vw, 64px);
	max-width: 780px;
	font: 400 16px/1.7 var(--hl-font-body);
	color: var(--hl-body);
}
.hl-pattern__intro h2,
.hl-pattern__intro h3 {
	font-family: var(--hl-font-head);
	text-transform: uppercase;
	color: var(--hl-text);
}

/* ---------------------------------------------------------------------
   Feature callouts
   --------------------------------------------------------------------- */
.hl-pattern-features {
	position: relative;
	margin-top: clamp(40px, 5vw, 64px);
	padding: clamp(40px, 5vw, 64px) 0;
	background: var(--hl-black-2);
	border-top: 1px solid var(--hl-line);
	border-bottom: 1px solid var(--hl-line);
}

.hl-pattern-features__heading { margin-bottom: 8px; }

.hl-pattern-features__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 clamp(28px, 4vw, 56px);
}

.hl-pattern-features__item {
	display: flex;
	gap: 20px;
	padding: 22px 0;
	border-bottom: 1px solid var(--hl-line-3);
}

.hl-pattern-features__num {
	flex: none;
	min-width: 28px;
	font: 500 11px/1.6 var(--hl-font-mono);
	color: var(--hl-cyan);
}

.hl-pattern-features__title {
	display: block;
	font: 700 16px/1.2 var(--hl-font-head);
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.hl-pattern-features__body {
	display: block;
	margin-top: 6px;
	font: 400 14px/1.55 var(--hl-font-body);
	color: var(--hl-muted);
}

/* ---------------------------------------------------------------------
   Spec tables
   --------------------------------------------------------------------- */
.hl-specs { padding-top: clamp(40px, 5vw, 64px); }
.hl-specs__head { margin-bottom: 8px; }

.hl-specs__group { margin-top: 28px; }

.hl-specs__group-title {
	margin: 0 0 10px;
	padding: 9px 16px;
	border-radius: 999px;
	background: var(--hl-surface);
	border: 1px solid var(--hl-line-2);
	font: 600 12px/1 var(--hl-font-head);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--hl-cyan);
}

/* The light-truck tables run to 14 columns — they scroll inside this box so
   the page itself never gains a horizontal scrollbar on a phone. tabindex=0
   makes the scroll region reachable by keyboard. */
.hl-specs__scroll {
	overflow-x: auto;
	border: 1px solid var(--hl-line-2);
	border-radius: var(--hl-radius-card);
	background: var(--hl-surface);
}
.hl-specs__scroll:focus-visible { outline: 2px solid var(--hl-cyan); outline-offset: 2px; }

.hl-specs__table {
	width: 100%;
	border-collapse: collapse;
	font: 400 13px/1.4 var(--hl-font-body);
	white-space: nowrap;
}

.hl-specs__table th,
.hl-specs__table td {
	padding: 11px 14px;
	text-align: right;
	border-bottom: 1px solid var(--hl-line);
}
.hl-specs__table thead th {
	position: sticky;
	top: 0;
	background: #12161c;
	color: var(--hl-text);
	font: 600 11px/1.3 var(--hl-font-head);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border-bottom: 1px solid var(--hl-cyan-hairline);
}
.hl-specs__unit {
	display: block;
	font: 400 10px/1.2 var(--hl-font-mono);
	letter-spacing: 0.1em;
	color: var(--hl-mono);
	text-transform: none;
}

/* The size column is the one people scan, so it stays left-aligned, in the
   mono face, and pinned while the rest scrolls. */
.hl-specs__table tbody th,
.hl-specs__table thead th:first-child {
	position: sticky;
	left: 0;
	text-align: left;
	background: var(--hl-surface);
	font: 500 13px/1.4 var(--hl-font-mono);
	color: var(--hl-text);
	z-index: 1;
}
.hl-specs__table thead th:first-child { background: #12161c; z-index: 2; }
.hl-specs__table tbody tr:nth-child(even) th,
.hl-specs__table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }
.hl-specs__table tbody tr:last-child th,
.hl-specs__table tbody tr:last-child td { border-bottom: none; }
.hl-specs__table td { color: var(--hl-body); }

.hl-specs__source {
	margin: 22px 0 0;
	max-width: 720px;
	font: 400 12px/1.6 var(--hl-font-body);
	color: var(--hl-mono);
}

/* ---------------------------------------------------------------------
   Related
   --------------------------------------------------------------------- */
.hl-related { padding: clamp(48px, 6vw, 80px) var(--hl-pad-x) clamp(56px, 7vw, 88px); }

.hl-related__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
	margin-top: 26px;
}

/* ---------------------------------------------------------------------
   Breakpoints
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
	.hl-pattern-hero__inner { grid-template-columns: minmax(0, 1fr); }
	.hl-pattern-hero__media { max-width: 380px; }
	.hl-pattern-features__list { grid-template-columns: minmax(0, 1fr); }
	.hl-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
	.hl-related__grid { grid-template-columns: minmax(0, 1fr); }
	.hl-pattern-hero__facts { gap: 28px; }
	.hl-specs__table th,
	.hl-specs__table td { padding: 10px 12px; }
}
