/**
 * core/table — technical specification table, horizontal scroll on mobile.
 */

.wp-block-table {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var(--wp--custom--radius--md);
	border: var(--wp--custom--stroke--thin) solid var(--wp--preset--color--border);
}

.wp-block-table table {
	border-collapse: collapse;
	border: 0;
	width: 100%;
	min-width: 560px;
	font-variant-numeric: tabular-nums;
}

.wp-block-table th,
.wp-block-table td {
	padding: 12px 16px;
	border: 0;
	border-bottom: var(--wp--custom--stroke--thin) solid var(--wp--preset--color--border);
	text-align: left;
	vertical-align: top;
}

.wp-block-table th:not(:last-child),
.wp-block-table td:not(:last-child) {
	border-right: var(--wp--custom--stroke--thin) solid var(--wp--preset--color--border);
}

.wp-block-table tr:last-child > th,
.wp-block-table tr:last-child > td {
	border-bottom: 0;
}

.wp-block-table thead th {
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	white-space: nowrap;
}

/* First column = row label (characteristic name). */
.wp-block-table tbody th,
.wp-block-table tbody td:first-child {
	font-weight: 600;
	color: var(--wp--preset--color--contrast);
}

.wp-block-table tbody td {
	color: var(--wp--preset--color--muted);
}

/* Brand head: blue header row (criteria tables). */
.wp-block-table.is-style-brand-head thead th {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--on-dark);
	border-bottom-color: var(--wp--preset--color--primary);
}

.wp-block-table.is-style-brand-head thead th:not(:last-child) {
	border-right-color: rgb(255 255 255 / 0.25);
}

/* Inline code in a cell = unit or notation (Ø / H / mm): mono, brand colour, no box. */
.wp-block-table td code,
.wp-block-table th code {
	display: inline-block;
	margin-top: 2px;
	padding: 0;
	background: none;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 400;
	color: var(--wp--preset--color--primary);
}

/* Values in mono: add class "is-style-technical" to the table block. */
.wp-block-table.is-style-technical tbody td:not(:first-child) {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast);
}

.wp-block-table tbody tr:hover > td,
.wp-block-table tbody tr:hover > th {
	background-color: var(--wp--preset--color--primary-soft);
}

/* Core stripes style: use the surface colour. */
.wp-block-table.is-style-stripes {
	border-bottom: 0;
}

.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background-color: var(--wp--preset--color--surface);
}

.wp-block-table figcaption {
	padding: 8px 16px;
	font-size: var(--wp--preset--font-size--caption);
	color: var(--wp--preset--color--muted);
	text-align: left;
}
