/* Data Table. Two classes on every rule: theme table styles (zebra rows, cell borders) are fairly specific. */
.hwd.hwd-table { container: hwd-table / inline-size; }

.hwd.hwd-table .hwd-table__scroll {
	overflow-x: auto;
	border: 1px solid var(--hwd-table-border, var(--hwd-line));
	border-radius: var(--hwd-table-radius, 14px);
}
.hwd.hwd-table .hwd-table__scroll:focus-visible { outline: 3px solid var(--hwd-amber); outline-offset: 3px; }

.hwd.hwd-table table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	border-spacing: 0;
	background: none;
	font-size: 0.94rem;
	line-height: 1.5;
}
.hwd.hwd-table :is(th, td) {
	padding: 12px 16px;
	border: 0;
	border-bottom: 1px solid var(--hwd-table-border, var(--hwd-line));
	background: none;
	color: var(--hwd-text);
	text-align: start;
	vertical-align: top;
}
.hwd.hwd-table tbody tr:last-child > * { border-bottom: 0; }
.hwd.hwd-table thead th {
	background: var(--hwd-table-head-bg, var(--hwd-tint));
	color: var(--hwd-table-head-text, var(--hwd-ink));
	font-size: 0.86rem;
	font-weight: 700;
}
.hwd.hwd-table tbody th {
	color: var(--hwd-table-row-head, var(--hwd-ink));
	font-weight: 650;
	white-space: nowrap;
}
.hwd.hwd-table td code,
.hwd.hwd-table th code { white-space: nowrap; overflow-wrap: normal; }
.hwd.hwd-table .hwd-table__caption {
	caption-side: top;
	padding: 12px 16px;
	border-bottom: 1px solid var(--hwd-table-border, var(--hwd-line));
	color: var(--hwd-ink);
	font-weight: 650;
	text-align: start;
}

/* Narrow columns: each row becomes a card, labelled by the column headings. */
@container hwd-table (max-width: 640px) {
	.hwd.hwd-table--stack .hwd-table__scroll { overflow: visible; }
	.hwd.hwd-table--stack :is(table, tbody) { display: block; }
	.hwd.hwd-table--stack thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
	.hwd.hwd-table--stack tbody tr {
		display: block;
		padding: 14px 16px;
		border-bottom: 1px solid var(--hwd-table-border, var(--hwd-line));
	}
	.hwd.hwd-table--stack tbody tr:last-child { border-bottom: 0; }
	.hwd.hwd-table--stack tbody :is(th, td) { display: block; padding: 0; border: 0; white-space: normal; }
	.hwd.hwd-table--stack tbody th { margin-bottom: 6px; font-size: 1rem; }
	.hwd.hwd-table--stack tbody :is(th, td) + td { margin-top: 6px; }
	.hwd.hwd-table--stack td[data-label]::before {
		content: attr(data-label);
		display: block;
		color: var(--hwd-muted);
		font-size: 0.8rem;
		font-weight: 600;
	}
	.hwd.hwd-table--stack :is(td, th) code { white-space: normal; overflow-wrap: anywhere; }
}
