/**
 * Mobile Senses — global table design
 */

.ms-body .wp-block-table,
.ms-body figure.wp-block-table,
.ms-blog-prose .wp-block-table,
.ms-post-prose .wp-block-table,
.ms-pages .wp-block-table,
.ms-static-page .wp-block-table {
	margin: 1.75rem 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var(--ms-radius-md);
	box-shadow: var(--ms-shadow-sm);
	background: var(--ms-color-surface);
}

.ms-body .wp-block-table > table,
.ms-body figure.wp-block-table > table,
.ms-blog-prose table,
.ms-post-prose table,
.ms-pages table,
.ms-static-page table,
.ms-buy-compare__table,
.ms-prod-sheet__table {
	width: 100%;
	min-width: 520px;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 0.9375rem;
	line-height: 1.55;
	border: 1px solid var(--ms-color-border);
	border-radius: var(--ms-radius-md);
	overflow: hidden;
	background: var(--ms-color-surface);
}

.ms-body .wp-block-table thead th,
.ms-body figure.wp-block-table thead th,
.ms-blog-prose thead th,
.ms-post-prose thead th,
.ms-pages thead th,
.ms-static-page thead th,
.ms-buy-compare__table thead th {
	padding: 0.85rem 1rem;
	background: linear-gradient(180deg, var(--ms-color-navy) 0%, var(--ms-color-navy-deep) 100%) !important;
	color: #fff !important;
	font-weight: 800;
	text-align: center;
	border: none !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
	white-space: nowrap;
}

.ms-body .wp-block-table thead th:not(:last-child),
.ms-body figure.wp-block-table thead th:not(:last-child),
.ms-blog-prose thead th:not(:last-child),
.ms-post-prose thead th:not(:last-child) {
	border-inline-end: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.ms-body .wp-block-table tbody td,
.ms-body .wp-block-table tbody th,
.ms-body figure.wp-block-table tbody td,
.ms-body figure.wp-block-table tbody th,
.ms-blog-prose tbody td,
.ms-blog-prose tbody th,
.ms-post-prose tbody td,
.ms-post-prose tbody th,
.ms-pages tbody td,
.ms-pages tbody th,
.ms-static-page tbody td,
.ms-static-page tbody th,
.ms-buy-compare__table td,
.ms-buy-compare__table th {
	padding: 0.8rem 1rem;
	border: none;
	border-bottom: 1px solid var(--ms-color-border);
	vertical-align: middle;
}

.ms-body .wp-block-table tbody tr:nth-child(even) td,
.ms-body .wp-block-table tbody tr:nth-child(even) th,
.ms-body figure.wp-block-table tbody tr:nth-child(even) td,
.ms-body figure.wp-block-table tbody tr:nth-child(even) th,
.ms-blog-prose tbody tr:nth-child(even) td,
.ms-blog-prose tbody tr:nth-child(even) th,
.ms-post-prose tbody tr:nth-child(even) td,
.ms-post-prose tbody tr:nth-child(even) th {
	background: var(--ms-color-surface-alt);
}

.ms-body .wp-block-table tbody tr:hover td,
.ms-body .wp-block-table tbody tr:hover th,
.ms-body figure.wp-block-table tbody tr:hover td,
.ms-body figure.wp-block-table tbody tr:hover th,
.ms-blog-prose tbody tr:hover td,
.ms-blog-prose tbody tr:hover th,
.ms-post-prose tbody tr:hover td,
.ms-post-prose tbody tr:hover th {
	background: var(--ms-color-orange-tint);
}

.ms-body .wp-block-table tbody tr:last-child td,
.ms-body .wp-block-table tbody tr:last-child th,
.ms-body figure.wp-block-table tbody tr:last-child td,
.ms-body figure.wp-block-table tbody tr:last-child th,
.ms-blog-prose tbody tr:last-child td,
.ms-blog-prose tbody tr:last-child th,
.ms-post-prose tbody tr:last-child td,
.ms-post-prose tbody tr:last-child th {
	border-bottom: none;
}

/* First column as row label */
.ms-body .wp-block-table tbody td:first-child,
.ms-body .wp-block-table tbody th:first-child,
.ms-body figure.wp-block-table tbody td:first-child,
.ms-body figure.wp-block-table tbody th:first-child,
.ms-blog-prose tbody td:first-child,
.ms-blog-prose tbody th:first-child,
.ms-post-prose tbody td:first-child,
.ms-post-prose tbody th:first-child {
	font-weight: 700;
	color: var(--ms-color-navy);
	background: rgba(27, 43, 75, 0.04);
	text-align: start;
	white-space: nowrap;
}

.ms-body .wp-block-table tbody tr:nth-child(even) td:first-child,
.ms-body .wp-block-table tbody tr:nth-child(even) th:first-child,
.ms-body figure.wp-block-table tbody tr:nth-child(even) td:first-child,
.ms-body figure.wp-block-table tbody tr:nth-child(even) th:first-child,
.ms-blog-prose tbody tr:nth-child(even) td:first-child,
.ms-blog-prose tbody tr:nth-child(even) th:first-child,
.ms-post-prose tbody tr:nth-child(even) td:first-child,
.ms-post-prose tbody tr:nth-child(even) th:first-child {
	background: rgba(27, 43, 75, 0.07);
}

.ms-body .wp-block-table tbody td:not(:first-child),
.ms-body figure.wp-block-table tbody td:not(:first-child),
.ms-blog-prose tbody td:not(:first-child),
.ms-post-prose tbody td:not(:first-child) {
	text-align: center;
}

/* Strip Gutenberg inline background on cells */
.ms-body .wp-block-table .has-background,
.ms-body figure.wp-block-table .has-background {
	background: transparent !important;
}

@media (max-width: 767px) {
	.ms-body .wp-block-table > table,
	.ms-body figure.wp-block-table > table,
	.ms-blog-prose table,
	.ms-post-prose table {
		min-width: 460px;
		font-size: 0.875rem;
	}

	.ms-body .wp-block-table thead th,
	.ms-body figure.wp-block-table thead th,
	.ms-blog-prose thead th,
	.ms-post-prose thead th,
	.ms-body .wp-block-table tbody td,
	.ms-body .wp-block-table tbody th,
	.ms-body figure.wp-block-table tbody td,
	.ms-body figure.wp-block-table tbody th,
	.ms-blog-prose tbody td,
	.ms-blog-prose tbody th,
	.ms-post-prose tbody td,
	.ms-post-prose tbody th {
		padding: 0.65rem 0.75rem;
	}
}
