/*
 * MEPCO theme — product family detail (single-product_family.php, prototype lines 355–425) and
 * product detail (single-product.php, prototype lines 294–353). Both templates load this file.
 *
 * Builds on base.css (.two-col/.main/.aside, .kicker, .page-title, .h-24, .stats-strip, .side-cta,
 * .doc-list, .breadcrumb, .placeholder-hatch); every value below is the prototype's inline style.
 *
 *   .family-breadcrumb        breadcrumb row, padding 20px gutter 0
 *   .family-cols              the two-column shell: padding 24px gutter 24px, gap 40px 48px
 *   .product-cols             …with the product page's 48px bottom padding
 *   .family-title             H1 (margin-bottom 20px instead of the shared 24px)
 *   .family-photo             white hero photo box: 1px #d5d2ca, padding clamp(16px,3vw,32px), min-height 260px
 *   .family-photo__img        max-width min(100%,520px), max-height 360px, contain
 *   .family-nophoto           hatched 16:8 placeholder shown when the family has no photo
 *   .family-gallery           "PRODUCTS IN THIS FAMILY": margin -12px 0 32px, column flex, gap 12px
 *   .family-gallery__head     kicker + count row (space-between, baseline)
 *   .family-gallery__count    11px mono #5d626a (no letter-spacing — not .mono-11)
 *   .family-gallery__grid     auto-fill minmax(160px,1fr), gap 10px
 *   .family-gallery__card     panel card, hover border #2a3340; 5:4 white photo cell; label 600 17px/1.1
 *   .family-gallery__cta      "View →" 12px 600 #9e5510
 *   .family-stats             .stats-strip + margin-bottom 32px
 *   .family-h                 section heading (.h-24) with the prototype's 14px bottom margin
 *   .family-benefits          auto-fit minmax(260px,1fr), gap 10px 28px, 14px #2f353d
 *   .family-benefits__item    padding-left 16px, 2px left border #c8731f
 *   .family-body              applications paragraph, #4a5058, max-width 680px
 *   .product-photo            hero box with the product page's 10px bottom margin
 *   .product-photo__img       max-width min(100%,480px)
 *   .product-alts             variant thumbnails row (always present: 28px bottom margin), 150px figures
 *   .product-lede             19px/1.45 #2f353d, max-width 680px
 *   .product-body             #4a5058, max-width 680px
 *   .product-specs            .stats-strip + margin-bottom 28px
 *   .product-h                heading with the product page's 12px bottom margin
 *   .product-apps             chips: 7px 12px, 1px #c9c5bc, #f7f6f2, 13px, pill
 *   .product-siblings         "Also in …" grid: auto-fill minmax(150px,1fr), 12px/1.35 caption
 *   .product-cta              the dark card on a product page (orange button uses ink text)
 *   .compare                  comparison section: padding 0 gutter 64px
 *   .compare__scroll          panel + 1px border, overflow-x auto, keyboard scrollable
 *   .compare__table           width 100%, min-width 640px, collapsed borders
 *   .compare__col             header cell: 11px mono #5d626a .1em, nowrap
 *   .compare__cell            body cell: 13px body font; --model 700 18px display; --approx #9e5510
 *   .compare__note            12px #5d626a under the table
 */

/* ---------------------------------------------------------------------------
 * Shell
 * ------------------------------------------------------------------------ */
.family-breadcrumb {
	padding: 20px var(--gutter) 0;
}

.family-cols {
	padding: 24px var(--gutter) 24px;
	gap: 40px 48px;
}
.product-cols {
	padding-bottom: 48px;
}

.family-title {
	margin-bottom: 20px;
}

/* ---------------------------------------------------------------------------
 * Hero photo
 * ------------------------------------------------------------------------ */
.family-photo {
	background: #fff;
	border: 1px solid var(--line);
	display: grid;
	place-items: center;
	margin-bottom: 28px;
	padding: clamp(16px, 3vw, 32px);
	min-height: 260px;
}
.family-photo__img {
	max-width: min(100%, 520px);
	max-height: 360px;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}
.family-nophoto {
	aspect-ratio: 16 / 8;
	border: 1px solid var(--line);
	display: grid;
	place-items: center;
	margin-bottom: 28px;
}

/* ---------------------------------------------------------------------------
 * "PRODUCTS IN THIS FAMILY"
 * ------------------------------------------------------------------------ */
.family-gallery {
	margin: -12px 0 32px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.family-gallery__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
}
.family-gallery__count {
	font: 11px var(--font-mono);
	color: var(--muted);
}
.family-gallery__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 10px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.family-gallery__item {
	display: grid;
	min-width: 0;
}
.family-gallery__card {
	background: var(--panel);
	border: 1px solid var(--line);
	display: flex;
	flex-direction: column;
	min-width: 0;
	color: var(--ink);
}
.family-gallery__card:hover {
	border-color: var(--navy);
	color: var(--ink);
}
.family-gallery__photo {
	background: #fff;
	aspect-ratio: 5 / 4;
	display: grid;
	place-items: center;
	padding: 10px;
	border-bottom: 1px solid var(--line);
	min-width: 0;
}
.family-gallery__img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}
.family-gallery__body {
	padding: 10px 12px 12px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.family-gallery__label {
	font: 600 17px/1.1 var(--font-display);
	text-transform: uppercase;
	text-wrap: pretty;
}
.family-gallery__cta {
	font-size: 12px;
	font-weight: 600;
	color: var(--orange-text);
}

/* ---------------------------------------------------------------------------
 * Stats, benefits, applications paragraph
 * ------------------------------------------------------------------------ */
.family-stats {
	margin-bottom: 32px;
}
.family-h {
	margin-bottom: 14px;
}
.family-benefits {
	margin: 0 0 32px;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 10px 28px;
	color: var(--text);
	font-size: 14px;
}
.family-benefits__item {
	padding-left: 16px;
	border-left: 2px solid var(--orange);
	text-wrap: pretty;
}
.family-body {
	margin: 0;
	color: var(--text-2);
	max-width: 680px;
	text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
 * Product page
 * ------------------------------------------------------------------------ */
.product-photo {
	margin-bottom: 10px;
}
.product-photo__img {
	max-width: min(100%, 480px);
	max-height: 360px;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.product-alts {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 28px;
}
.product-alts__figure {
	margin: 0;
	background: var(--panel);
	border: 1px solid var(--line);
	display: flex;
	flex-direction: column;
	width: 150px;
}
.product-alts__photo {
	background: #fff;
	aspect-ratio: 5 / 4;
	display: grid;
	place-items: center;
	padding: 8px;
	border-bottom: 1px solid var(--line);
}
.product-alts__img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}
.product-alts__caption {
	padding: 6px 8px;
	font-size: 12px;
	color: var(--text);
}

.product-lede {
	margin: 0 0 20px;
	font-size: 19px;
	line-height: 1.45;
	color: var(--text);
	text-wrap: pretty;
	max-width: 680px;
}
.product-body {
	margin: 0 0 28px;
	color: var(--text-2);
	max-width: 680px;
	text-wrap: pretty;
}
.product-specs {
	margin-bottom: 28px;
}
.product-h {
	margin-bottom: 12px;
}
.product-apps {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin: 0 0 36px;
	padding: 0;
	list-style: none;
}
.product-apps__item {
	padding: 7px 12px;
	border: 1px solid var(--input-line);
	background: var(--panel);
	font-size: 13px;
	border-radius: 999px;
}

.product-siblings__title {
	margin-bottom: 12px;
}
.product-siblings__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.product-siblings__item {
	display: grid;
	min-width: 0;
}
.product-siblings__card {
	background: var(--panel);
	border: 1px solid var(--line);
	display: flex;
	flex-direction: column;
	min-width: 0;
	color: var(--ink);
}
.product-siblings__card:hover {
	border-color: var(--navy);
	color: var(--ink);
}
.product-siblings__photo {
	background: #fff;
	aspect-ratio: 5 / 4;
	display: grid;
	place-items: center;
	padding: 10px;
	border-bottom: 1px solid var(--line);
	min-width: 0;
}
.product-siblings__img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}
.product-siblings__name {
	padding: 8px 10px;
	font-size: 12px;
	line-height: 1.35;
	color: var(--text);
	text-wrap: pretty;
}

/* The product page's orange button carries ink text (the family page's inherits white) */
.product-cta .side-cta__primary {
	color: var(--ink);
}

/* ---------------------------------------------------------------------------
 * Comparison table
 * ------------------------------------------------------------------------ */
.compare {
	padding: 0 var(--gutter) 64px;
}
.compare__title {
	margin-bottom: 14px;
}
.compare__scroll {
	background: var(--panel);
	border: 1px solid var(--line);
	overflow-x: auto;
}
.compare__table {
	width: 100%;
	min-width: 640px;
	border-collapse: collapse;
}
.compare__col {
	padding: 10px 16px;
	border-bottom: 1px solid var(--line);
	font: 11px var(--font-mono);
	color: var(--muted);
	letter-spacing: .1em;
	white-space: nowrap;
	text-align: left;
}
.compare__cell {
	padding: 12px 16px;
	border-bottom: 1px solid var(--line-2);
	vertical-align: middle;
	font: 13px var(--font-body);
	color: var(--ink);
	text-align: left;
}
.compare__cell--model {
	font: 700 18px var(--font-display);
}
.compare__cell--approx {
	color: var(--orange-text);
}
.compare__table tbody tr:hover {
	background: #fff;
}
.compare__note {
	display: block;
	margin-top: 10px;
	font-size: 12px;
	color: var(--muted);
	text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
 * Mobile (designed from the desktop language — no phone reference)
 * ------------------------------------------------------------------------ */
@media (max-width: 899.98px) {
	.compare__cell { font-size: 14px; }
	.compare__table tbody tr:hover { background: transparent; }
	/* Numeric spec tables (compare__table--sticky, set by template-parts/compare-table.php): engineers
	   compare across models, so the columns stay; the model column sticks to the left edge and the
	   panel's right edge carries a scroll shadow that fades out at the end of the scroll. */
	.compare__scroll--sticky {
		background:
			linear-gradient(to left, var(--panel) 30%, rgba(247, 246, 242, 0)) right / 40px 100% no-repeat local,
			linear-gradient(to left, rgba(22, 25, 29, .16), rgba(22, 25, 29, 0)) right / 16px 100% no-repeat scroll,
			var(--panel);
	}
	.compare__table--sticky th:first-child,
	.compare__table--sticky td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); box-shadow: 1px 0 0 var(--line-2); }
	/* Prose tables (compare__table--stacked, e.g. the steam-specialties trap-type comparison, 761px
	   wide): each row is a card — the row header on top, then one label / value line per column.
	   The thead is visually hidden, not removed; the roles in the markup keep the table semantics. */
	.compare__table--stacked { min-width: 0; display: block; }
	.compare__table--stacked thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
	.compare__table--stacked tbody, .compare__table--stacked tr, .compare__table--stacked th { display: block; }
	.compare__table--stacked tr { padding: 14px 16px 16px; border-bottom: 1px solid var(--line-2); }
	.compare__table--stacked tr:last-child { border-bottom: 0; }
	.compare__table--stacked .compare__cell { padding: 0; border: 0; }
	.compare__table--stacked .compare__cell--model { padding-bottom: 8px; }
	.compare__table--stacked td { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0 12px; align-items: baseline; padding: 4px 0; }
	.compare__table--stacked td::before { content: attr(data-label); font: 11px var(--font-mono); color: var(--muted); letter-spacing: .1em; }
	/* Gallery / sibling labels read at 13px. */
	.family-gallery__cta, .product-siblings__name { font-size: 13px; }
}

/* Discontinued notice band (template-parts/discontinued-notice.php): shown under the H1 of a family or
   product whose status is Discontinued. Brass rule, panel background, the DISCONTINUED tag on top. */
.discontinued { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin: 0 0 24px; padding: 18px 20px 20px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--orange); }
.discontinued__tag { background: var(--orange); color: var(--ink); }
.discontinued__title { margin: 0; }
.discontinued__text { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; max-width: 640px; text-wrap: pretty; }
.discontinued__links { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; }
.discontinued__link { font-weight: 600; color: var(--orange-text); }
.discontinued__link:hover { text-decoration: underline; }
/* Family / product cards carry the tag next to their label. */
.family-gallery__tag, .product-siblings__tag { background: var(--orange); color: var(--ink); margin-left: 8px; vertical-align: middle; }
/* The models / series table on a product page sits inside the main column (no section gutter). */
.compare--models { padding: 0; margin: 8px 0 32px; }
.compare--models .compare__table { min-width: 560px; }
.compare--models .compare__cell--model { font-size: 16px; }
