/* ==========================================================================
   Listing page — /equipment/<category>/<slug>
   (pages/equipment.php + assets/js/equipment.js)
   ========================================================================== */

.listing {
	padding-block: 24px 64px;
}

/* ---- Breadcrumb ---- */
.crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 28px;
	font-size: 13px;
	color: var(--color-neutral-600);
}
.crumbs a {
	text-decoration: none;
}
.crumbs .current {
	color: var(--color-text);
}

.listing-top {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 40px;
}

/* ---- Photos ---- */
.listing-media {
	flex: 1 1 520px;
	min-width: 0;
}
.gallery {
	aspect-ratio: 4 / 3;
}
.gallery-main {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: none;
	overflow: hidden;
	cursor: zoom-in;
}
.gallery-main img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.gallery-empty {
	display: flex;
	align-items: flex-end;
	width: 100%;
	height: 100%;
	padding: 20px;
	background-image: linear-gradient(var(--color-divider) 1px, transparent 1px),
		linear-gradient(90deg, var(--color-divider) 1px, transparent 1px);
	background-size: 32px 32px;
	background-position: -1px -1px;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--color-neutral-600);
}
.gallery-thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
	gap: 10px;
	margin-top: 14px;
}
.gallery-thumb {
	aspect-ratio: 4 / 3;
	padding: 0;
	border: 1px solid var(--color-divider);
	background: none;
	overflow: hidden;
	opacity: 0.65;
	cursor: pointer;
	transition: opacity 0.15s, border-color 0.15s;
}
.gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.gallery-thumb:hover,
.gallery-thumb.is-active {
	opacity: 1;
	border-color: var(--color-accent-600);
}

/* ---- Title, price, listing sheet ---- */
.listing-info {
	flex: 1 1 380px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 22px;
}
.listing-meta {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}
.listing-meta a {
	color: inherit;
	text-decoration: none;
}
.listing-info h1 {
	margin: 0 0 0 -0.04em;
	font-size: clamp(34px, 4vw, 54px);
	line-height: 1;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}
.listing-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 16px;
}
.listing-price .amount {
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 44px;
	line-height: 1;
	font-feature-settings: "tnum" 1;
}
.listing-price .note {
	font-size: 13px;
	color: var(--color-neutral-600);
}
.sheet-head {
	display: flex;
	justify-content: space-between;
	padding: 10px 18px;
	border-bottom: 1px solid var(--color-divider);
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 600;
}
.sheet .table {
	table-layout: fixed;
}
.sheet .table th {
	width: 38%;
	padding: 10px 18px;
	font-size: 13px;
	font-weight: 400;
	color: var(--color-neutral-700);
}
.sheet .table td {
	padding: 10px 18px;
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 18px;
	letter-spacing: 0.01em;
}

/* ---- Share ---- */
.share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
	padding-top: 6px;
}
.share-label {
	margin-right: 6px;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--color-neutral-600);
}
.share a,
.share button {
	padding: 0;
	border: 0;
	background: none;
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--color-accent-700);
	cursor: pointer;
}
.share a:hover,
.share button:hover {
	color: var(--color-accent-900);
}
.listing-note {
	max-width: 52ch;
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--color-neutral-700);
}

/* ---- Description (left) + inquiry form (right) ---- */
/* Two equal columns that start on the same line; they stack on narrow
   screens. With only one of them (no description, or the unlisted admin view
   with no form) it takes the full width. */
.listing-lower {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
	align-items: start;
	gap: 40px 56px;
	margin-top: 64px;
}

/* ---- Description / key specs / spec sheets ---- */
.listing-details {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.listing-details .kicker-rule {
	margin-bottom: 20px;
}
.listing-details .kicker-rule.is-next {
	margin-top: 36px;
}
/* A long description (some posts run to 20+ paragraphs) scrolls inside a
   box instead of pushing the inquiry form off the screen. Short text shows
   as plain text, no box. The soft shadows at the top / bottom only show while there is
   more to scroll (the "local" gradients move with the content and cover the
   fixed shadow gradients at the ends). */
.listing-details .rich-text {
	max-height: 640px;
	overflow-y: auto;
	overscroll-behavior: contain;
}
/* the frame and edge shadows only when the text actually scrolls
   (assets/js/equipment.js adds .is-scrolling) */
.listing-details .rich-text.is-scrolling {
	padding: 16px 18px;
	border: 1px solid var(--color-divider);
	scrollbar-width: thin;
	scrollbar-color: var(--color-neutral-300) transparent;
	background: linear-gradient(var(--color-bg) 30%, transparent) top / 100% 36px no-repeat local,
		linear-gradient(transparent, var(--color-bg) 70%) bottom / 100% 36px no-repeat local,
		radial-gradient(farthest-side at 50% 0, color-mix(in srgb, #000 14%, transparent), transparent) top / 100% 12px
			no-repeat scroll,
		radial-gradient(farthest-side at 50% 100%, color-mix(in srgb, #000 14%, transparent), transparent) bottom / 100%
			12px no-repeat scroll;
}
.listing-details .rich-text > :last-child {
	margin-bottom: 0;
}
.doc-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.doc-list a {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid var(--color-divider);
	text-decoration: none;
}
.doc-type {
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.06em;
	white-space: nowrap;
}

/* ---- Request a quote: heading above the form ---- */
.quote {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
	scroll-margin-top: var(--head-offset);
}
.quote-intro {
	min-width: 0;
}
.quote-intro .kicker-rule {
	margin-bottom: 20px;
}
.quote-intro h2 {
	margin: 0 0 12px;
	font-size: 32px;
	line-height: 1.05;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}
.quote-intro p {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--color-neutral-700);
}
.quote .form-grid,
.quote .form-success {
	min-width: 0;
}

/* ---- Related listings ---- */
.related {
	margin-top: 64px;
}
.related-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--color-divider);
	margin-bottom: 28px;
}
.related-head a {
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
}

/* ---- Lightbox ---- */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 56px);
	background: color-mix(in srgb, var(--color-neutral-900) 94%, transparent);
	cursor: zoom-out;
}
.lightbox img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	cursor: default;
}
.lightbox-close,
.lightbox-nav {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid color-mix(in srgb, var(--color-bg) 35%, transparent);
	background: color-mix(in srgb, var(--color-neutral-900) 60%, transparent);
	font-size: 28px;
	line-height: 1;
	color: var(--color-bg);
	cursor: pointer;
}
.lightbox-close:hover,
.lightbox-nav:hover {
	border-color: var(--color-bg);
}
.lightbox-close {
	top: 16px;
	right: 16px;
}
.lightbox-nav {
	top: 50%;
	transform: translateY(-50%);
}
.lightbox-nav.is-prev {
	left: 16px;
}
.lightbox-nav.is-next {
	right: 16px;
}
