/*
 * Vesmaco Product Manager — [vesmaco_table] on the public site (TABLES-SPEC §4, §10.3).
 *
 * §10.3: on a product the shortcode prints a native <details> strip that has to look like the DCE
 * accordion it replaced — 1 px #D6D6D6 border, 16 px below, white, the theme's font, and a + that
 * becomes − when it is open. The marker is drawn with two bars in CSS: no icon font, no JavaScript.
 *
 * Loaded only on pages where the shortcode actually renders. Every rule is scoped to .vm-table /
 * .vm-table__wrap, so the theme's own tables and everything else on the page are untouched. The font
 * is inherited from the theme; the two colours are the ones the manager uses (navy #1f1c31, border
 * grey #e0e5e9) and can be overridden per page with --vm-table-head / --vm-table-border.
 */

.vm-table__wrap {
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.vm-table {
	--vm-table-head: #1f1c31;
	--vm-table-border: #e0e5e9;
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	font: inherit;
	color: inherit;
	background: none;
}

.vm-table caption {
	text-align: left;
}

.vm-table thead th {
	padding: 10px 14px;
	border: 0;
	border-bottom: 2px solid var(--vm-table-head);
	color: var(--vm-table-head);
	font-weight: 600;
	text-align: left;
	vertical-align: bottom;
	white-space: nowrap;
	background: none;
}

.vm-table tbody td {
	padding: 10px 14px;
	border: 0;
	border-bottom: 1px solid var(--vm-table-border);
	text-align: left;
	vertical-align: top;
	background: none;
}

.vm-table tbody tr:last-child td {
	border-bottom: 0;
}

.vm-table a {
	text-decoration: underline;
}

/* Below ~700 px the wrapper scrolls sideways instead of squashing the columns. */
@media (max-width: 700px) {
	.vm-table {
		min-width: 560px;
	}

	.vm-table thead th,
	.vm-table tbody td {
		padding: 8px 10px;
	}
}

/* ------------------------------------------------------------------ the collapsible strip (§10.3) */

.vm-table__box {
	--vm-table-strip: #d6d6d6;
	margin: 0 0 16px;
	border: 1px solid var(--vm-table-strip);
	background: #fff;
	font: inherit;
	color: inherit;
}

.vm-table__strip {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	cursor: pointer;
	font-weight: 600;
	list-style: none;
}

/* The browser's own triangle, in both engines. */
.vm-table__strip::-webkit-details-marker {
	display: none;
}

.vm-table__strip::marker {
	content: '';
}

.vm-table__label {
	flex: 1 1 auto;
	min-width: 0;
}

/* The + / − : a horizontal bar always, a vertical one only while the strip is closed. */
.vm-table__mark {
	position: relative;
	flex: 0 0 14px;
	width: 14px;
	height: 14px;
}

.vm-table__mark::before,
.vm-table__mark::after {
	content: '';
	position: absolute;
	background: currentColor;
}

.vm-table__mark::before {
	top: 50%;
	right: 0;
	left: 0;
	height: 2px;
	margin-top: -1px;
}

.vm-table__mark::after {
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	margin-left: -1px;
}

.vm-table__box[open] > .vm-table__strip .vm-table__mark::after {
	display: none;
}

.vm-table__body {
	padding: 0 18px 16px;
}

.vm-table__drawing {
	margin: 0 0 16px;
}

.vm-table__image,
.vm-table__drawing img {
	max-width: 100%;
	height: auto;
}

.vm-table__note {
	margin: 12px 0 0;
	font-size: 0.9em;
}
