/**
 * The exponent register.
 *
 * `07-templates.md`: tokens only, no literal colours; a data table scrolls in
 * its own container so the page body never scrolls sideways.
 */

.pem-reg { max-width: var(--wide, 76rem); }

/* -------------------------------------------------------------------------
 * Headline findings.
 * ---------------------------------------------------------------------- */

.pem-reg__headline {
	margin: 0 0 1.75rem;
	max-width: var(--measure, 34rem);
}

.pem-reg__counts {
	font-size: var(--step-1, 1.125rem);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	margin: 0 0 .75rem;
	padding-bottom: .6rem;
	border-bottom: 2px solid var(--ink, #16191d);
}

.pem-reg__headline p { line-height: 1.55; margin: 0 0 .75rem; }

.pem-reg__caveat {
	font-size: var(--step--1, .875rem);
	color: var(--ink-2, #4a5058);
}

/* -------------------------------------------------------------------------
 * The quality bar. Stated, not just applied.
 * ---------------------------------------------------------------------- */

.pem-reg__bar {
	margin: 0 0 1.5rem;
	padding: 1rem 1.1rem;
	border-left: 4px solid var(--accent, #0b4f6c);
	background: var(--ground-2, #f4f6f8);
	max-width: var(--measure, 34rem);
}

.pem-reg__bar h2 { margin: 0 0 .5rem; font-size: var(--step-0, 1rem); }
.pem-reg__bar p { margin: 0 0 .6rem; font-size: var(--step--1, .875rem); line-height: 1.55; }
.pem-reg__bar p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------------------
 * Filters.
 * ---------------------------------------------------------------------- */

.pem-reg__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: .75rem 1.25rem;
	margin: 0 0 1rem;
}

.pem-reg__field { display: grid; gap: .3rem; }

.pem-reg__field label {
	font-size: var(--step--1, .875rem);
	font-weight: 600;
	color: var(--ink-2, #4a5058);
}

.pem-reg__field--check { display: flex; align-items: center; gap: .4rem; }
.pem-reg__field--check label { font-weight: 400; }

.pem-reg__count {
	margin: 0;
	font-variant-numeric: tabular-nums;
	font-size: var(--step--1, .875rem);
	flex-basis: 100%;
}

.pem-reg__download { margin: 0; flex-basis: 100%; font-size: var(--step--1, .875rem); }

/* -------------------------------------------------------------------------
 * The table.
 * ---------------------------------------------------------------------- */

.pem-reg__table {
	border-collapse: collapse;
	width: 100%;
	min-width: 62rem;
	font-size: var(--step--1, .875rem);
	font-variant-numeric: tabular-nums;
}

.pem-reg__table :is(th, td) {
	text-align: right;
	padding: .5rem .55rem;
	border-bottom: 1px solid var(--rule, #d4d8dd);
	vertical-align: top;
}

.pem-reg__table thead th {
	font-size: var(--step--2, .78rem);
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--ink-2, #4a5058);
	border-bottom: 2px solid var(--ink, #16191d);
	white-space: nowrap;
	position: sticky;
	top: 0;
	background: var(--ground, #fff);
}

.pem-reg__table :is(thead th, tbody th):first-child,
.pem-reg__subtype,
.pem-reg__source { text-align: left; }

.pem-reg__table tbody th { font-weight: 600; white-space: nowrap; }

.pem-reg__sort {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	text-transform: inherit;
	letter-spacing: inherit;
}

.pem-reg__sort:hover { text-decoration: underline; }
.pem-reg__sort:focus-visible { outline: 3px solid var(--accent, #0b4f6c); outline-offset: 2px; }

[aria-sort="ascending"] .pem-reg__arrow::after { content: " ▲"; }
[aria-sort="descending"] .pem-reg__arrow::after { content: " ▼"; }

/* The citation target. Visible rather than something only the URL bar knows. */
.pem-reg__anchor {
	margin-left: .35rem;
	color: var(--ink-2, #4a5058);
	text-decoration: none;
	opacity: .5;
}

.pem-reg__anchor:hover,
.pem-reg__anchor:focus-visible { opacity: 1; text-decoration: underline; }

:target { background: var(--ground-2, #f4f6f8); outline: 2px solid var(--accent, #0b4f6c); }

.pem-reg__n { font-weight: 600; }

/*
 * A failing fit. Dimmed, never hidden, and never removed from the default
 * view — these rows are the argument for the method, not clutter.
 */
.pem-reg__row--failed { background: var(--warn-bg, #fdf6ec); }

.pem-reg__reason,
.pem-reg__promoted,
.pem-reg__confidence {
	display: block;
	font-size: var(--step--2, .78rem);
	line-height: 1.4;
	margin-top: .2rem;
	white-space: normal;
	text-align: left;
}

.pem-reg__reason { color: var(--stop, #8c2f18); max-width: 16rem; }
.pem-reg__promoted { color: var(--accent, #0b4f6c); }
.pem-reg__confidence { color: var(--ink-2, #4a5058); }
.pem-reg__subtype { max-width: 18rem; white-space: normal; }
.pem-reg__source { max-width: 14rem; white-space: normal; color: var(--ink-2, #4a5058); }

@media print {
	.pem-reg__controls { display: none; }
	.pem-ft__scroll { overflow: visible; }
	.pem-reg__table { min-width: 0; font-size: 8pt; }
	.pem-reg__table thead th { position: static; }
	/* Everything prints, including the failures. */
	.pem-reg__table tr[hidden] { display: table-row !important; }
}
