/* Shared COA-table + lab-card + accordion styles for the /testing/ index
   ([pgb_testing_index]) AND the per-product lot hub. Historical filename —
   kept to avoid enqueue churn. Both surfaces enqueue handle pgb-testing-index.
   Old .pgb-ti__* list styles retired with the <ul> (only .pgb-ti__empty kept).

   Design system: navy #16304F / steel #5E89A3 / teal #1D9E75 (teal-700
   #0F6E56 for any text-carrying teal) / ink-soft #56636F / line #E3E9ED.
   Fonts come from the theme's @font-face; the stacks degrade gracefully.

   PE contract: panels render OPEN; collapse is armed ONLY under html.pgb-cc-js
   (added by an inline one-liner before each table). JS-off = readable, open. */

.pgb-ti__empty { opacity: .7; }

/* wpautop phantom-<p> guard (theme Phase 1 lesson) */
.pgb-cc-ti p:empty { display: none; }

.pgb-cc-coa-cap { font-size: 13px; color: #56636F; margin: 0 0 18px; }

/* Outer wrapper of the COA table. On phones (≤640px) the table stacks into
   per-row cards — see the block at the foot of this file — instead of scrolling,
   so this no longer has to be a scroll viewport. (History: it once was, with the
   table forced to min-width:660px, but the rounded .pgb-cc-coa-wrap below has
   overflow:hidden and sat BETWEEN this wrapper and the table — its clip ate the
   overflow before this could scroll, silently cutting columns 3–5 off on mobile
   with no way to reach them. Stacking removes the overflow entirely.) Kept as a
   harmless structural wrapper. */
.pgb-cc-table-scroll { overflow-x: auto; }

.pgb-cc-coa-wrap {
	background: #fff;
	border: 1px solid #E3E9ED;
	border-radius: 16px;
	overflow: hidden;
}
.pgb-cc-coa-table { width: 100%; border-collapse: collapse; margin: 0; }
/* Deep-linked rows must not land under the theme's sticky nav (~68px) — nor
   under nav + the 32px admin bar when the operator is logged in. */
.pgb-cc-lot-row { scroll-margin-top: 128px; }
.pgb-cc-coa-table thead th {
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: .5px;
	color: #56636F;
	font-weight: 400;
	text-align: left;
	text-transform: uppercase;
	padding: 14px 20px;
	border-bottom: 1px solid #E3E9ED;
}
.pgb-cc-coa-table__col-product { width: 32%; }
.pgb-cc-coa-table__verif { text-align: right !important; }

.pgb-cc-lot-row { cursor: pointer; transition: background .12s; }
.pgb-cc-lot-row:hover, .pgb-cc-lot-row.open { background: #F6F9FA; }
.pgb-cc-lot-row td {
	padding: 16px 20px;
	font-size: 14px;
	border-top: 1px solid #E3E9ED;
	vertical-align: middle;
}
.pgb-cc-coa-table tbody tr:first-child td { border-top: 0; }

/* The single focusable control per row (a11y: no nested interactives). */
.pgb-cc-lot-toggle {
	display: inline-block;
	appearance: none;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
	margin: 0;
	font: inherit;
	text-transform: none;
	letter-spacing: normal;
	text-align: left;
	cursor: pointer;
	color: inherit;
}
.pgb-cc-lot-toggle:focus-visible {
	outline: 2px solid #0F6E56;
	outline-offset: 3px;
	border-radius: 4px;
}
.pgb-cc-coa-table__name { color: #16304F; font-weight: 600; display: block; }
.pgb-cc-coa-table__lot {
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 11px;
	color: #56636F;
	display: block;
	margin-top: 2px;
}
.pgb-cc-num {
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 13px;
	color: #16304F;
}

.pgb-cc-verified {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: #0F6E56;
	font-size: 13px;
	font-weight: 600;
}
.pgb-cc-verified__badge {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #1D9E75;
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
}
.pgb-cc-tested { color: #56636F; font-size: 13px; font-weight: 500; }
.pgb-cc-chev {
	display: inline-block;
	margin-left: 10px;
	color: #56636F;
	transition: transform .2s ease;
	font-size: 11px;
}
.pgb-cc-lot-row.open .pgb-cc-chev { transform: rotate(180deg); }

/* ---- expanded detail row (grid-rows accordion — no max-height cap) ---- */
.pgb-cc-lot-detail > td { padding: 0; border-top: 0; }
.pgb-cc-detail { display: grid; grid-template-rows: 1fr; background: #F6F9FA; }
html.pgb-cc-js .pgb-cc-detail {
	grid-template-rows: 0fr;
	/* visibility removes the collapsed panels' links from the keyboard tab
	   order (grid 0fr + overflow alone leaves invisible tab stops); it
	   transitions discretely so the hide waits for the collapse to finish. */
	visibility: hidden;
	transition: grid-template-rows .3s ease, visibility .3s;
}
html.pgb-cc-js .pgb-cc-detail.is-open { grid-template-rows: 1fr; visibility: visible; }
.pgb-cc-detail__clip { overflow: hidden; min-height: 0; }
.pgb-cc-detail__pad { padding: 20px 22px 22px; }
@media ( prefers-reduced-motion: reduce ) {
	html.pgb-cc-js .pgb-cc-detail, .pgb-cc-chev { transition: none; }
}

/* ---- lab cards ---- */
.pgb-cc-lab-cards { display: flex; gap: 16px; flex-wrap: wrap; }
.pgb-cc-lab-card {
	flex: 1;
	min-width: 230px;
	box-sizing: border-box; /* no Preflight on these pages — be explicit */
	background: #fff;
	border: 1px solid #E3E9ED;
	border-radius: 12px;
	padding: 15px 17px;
}
.pgb-cc-lab-card__name {
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: .5px;
	color: #5E89A3;
	text-transform: uppercase;
}
.pgb-cc-gauge { width: 100%; max-width: 240px; height: auto; margin: 11px 0 8px; display: block; }
.pgb-cc-gauge text {
	fill: #56636F;
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 10px;
}
.pgb-cc-gauge__track { stroke: #E3E9ED; stroke-width: 4; stroke-linecap: round; }
.pgb-cc-gauge__fill { stroke: #5E89A3; stroke-width: 4; stroke-linecap: round; }
.pgb-cc-gauge__marker { fill: #5E89A3; stroke: #fff; stroke-width: 2; }
/* Newest card (first in the newest-first list) carries the teal read. */
.pgb-cc-lab-card:first-child .pgb-cc-gauge__fill { stroke: #0F6E56; }
.pgb-cc-lab-card:first-child .pgb-cc-gauge__marker { fill: #0F6E56; }

.pgb-cc-lab-card__figure {
	font-family: "Space Grotesk", sans-serif;
	font-size: 22px;
	font-weight: 600;
	color: #16304F;
}
.pgb-cc-lab-card__figure span {
	font-size: 11.5px;
	font-weight: 400;
	color: #56636F;
	margin-left: 5px;
	font-family: inherit;
}
.pgb-cc-lab-card__meta {
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 11px;
	color: #56636F;
	margin-top: 6px;
}
/* Explicit link colors — the theme's legacy unlayered a{} aqua leaks otherwise. */
.pgb-cc-lab-card__link {
	font-size: 12px;
	color: #0F6E56 !important;
	font-weight: 600;
	margin-top: 10px;
	display: inline-block;
	text-decoration: none;
}
.pgb-cc-lab-card__link:hover { text-decoration: underline; }

.pgb-cc-detail__foot {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 15px;
	padding-top: 14px;
	border-top: 1px dashed #E3E9ED;
}
.pgb-cc-detail__foot:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pgb-cc-link-strong {
	font-size: 13px;
	color: #16304F !important;
	font-weight: 600;
	text-decoration: none;
	margin-left: auto;
}
.pgb-cc-link-strong:hover { text-decoration: underline; }
.pgb-cc-link-strong .pgb-cc-arr { color: #0F6E56; }

/* Pills — VERBATIM duplicate of lot-pages.css's .pgb-cc-pill base + --pass +
   --fail + --neutral (the index never loads lot-pages.css; the hub loads BOTH
   sheets, so the rules must stay byte-identical or the hub drifts from the
   detail page). Keep in sync with lot-pages.css. */
.pgb-cc-pill {
	display: inline-block;
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 600;
}
.pgb-cc-pill--pass {
	background: #d1fae5;
	color: #065f46;
}
.pgb-cc-pill--fail {
	background: #fee2e2;
	color: #991b1b;
}
.pgb-cc-pill--neutral {
	background: #e5e7eb;
	color: #374151;
}

/* ── Phones (≤640px): stack the 5-column COA table into per-row cards ────────
   The table never fits 5 columns on a phone; forcing a min-width + horizontal
   scroll cut the right-hand columns off (the rounded card's overflow:hidden ate
   the scroll). Instead, each row becomes a card of LABEL / value pairs so every
   field stays visible and nothing scrolls. Per-cell labels come from data-label
   attributes on the value <td>s, set in BOTH templates (public-api.php index +
   lot-hub.php hub); the heading cell (product name / lot #) carries no label.
   Shared by the /testing/ index and the per-product lot hub (same markup). */
@media ( max-width: 640px ) {
	.pgb-cc-coa-table { display: block; }
	.pgb-cc-coa-table thead { display: none; }   /* column labels move inline */
	.pgb-cc-coa-table tbody { display: block; }

	.pgb-cc-lot-row { display: block; padding: 4px 0 12px; border-top: 1px solid #E3E9ED; }
	.pgb-cc-coa-table tbody .pgb-cc-lot-row:first-child { border-top: 0; }

	/* value rows: LABEL left, value right */
	.pgb-cc-lot-row td {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 16px;
		border: 0;
		padding: 4px 20px;
	}
	.pgb-cc-lot-row td[data-label]::before {
		content: attr( data-label );
		color: #56636F;
		font-family: "IBM Plex Mono", ui-monospace, monospace;
		font-size: 11px;
		letter-spacing: .5px;
		text-transform: uppercase;
		white-space: nowrap;
	}

	/* heading cell (product name / lot #): full-width title + room for chevron */
	.pgb-cc-lot-row td:first-child {
		display: block;
		position: relative;
		padding: 12px 44px 6px 20px;
	}
	/* one expand chevron on the heading replaces the in-cell one; rotates open */
	.pgb-cc-chev { display: none; }
	.pgb-cc-lot-row td:first-child::after {
		content: "\25BE";
		position: absolute;
		top: 14px;
		right: 20px;
		color: #56636F;
		font-size: 11px;
		transition: transform .2s ease;
	}
	.pgb-cc-lot-row.open td:first-child::after { transform: rotate( 180deg ); }

	/* expanded detail (lab cards) spans the full card width */
	.pgb-cc-lot-detail { display: block; }
	.pgb-cc-lot-detail > td { display: block; padding: 0; }
}
