/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright 2018 Mellanox Technologies, Ltd
 */

/* Override readthedocs theme */

/* Spacing before a list item must be bigger than spacing inside the item.
 * Complex list items start with a p.first element. */
.section li > .first {
	margin-top: 18px;
}

/* Table head row more visible */
th.head {
	background-color: #ccc;
}

/* Overview matrix with small cells and yellow cross.
 * Usage: insert the following line in the doc.
 *        .. rst-class:: matrix
 */
table.matrix {
	cursor: default;
	isolation: isolate;
	overflow: hidden;
}
table.matrix.docutils.align-default tr > :is(th, td) > p {
	margin: 0;
	line-height: inherit;
}
table.matrix.docutils.align-default tr > :is(th, td) {
	text-align: center;
	border: solid 1px #ddd;
}
table.matrix.docutils th {
	padding: 0.5em 0;
}
table.matrix.docutils th,
table.matrix.docutils.align-default tr > th > p {
	font-size: 11px;
	white-space: pre-wrap;
	vertical-align: top;
	min-width: 0.9em;
}
table.matrix col:first-child {
	width: 0;
}
table.matrix.docutils.align-default th:first-child {
	vertical-align: bottom;
}
table.matrix.docutils td {
	padding: 1px;
}
table.matrix.docutils td,
table.matrix.docutils.align-default tr > td > p {
	font-size: 11px;
}
table.matrix.docutils.align-default td:first-child {
	padding-left: 1em;
	text-align: left;
}
table.matrix.docutils.align-default tbody tr.row-even td {
	background-color: rgba(210, 210, 210, 0.2);
}
table.matrix :is(th, td):not(:first-child):hover {
	position: relative;
}
table.matrix :is(th, td):not(:first-child):hover::after {
	content: '';
	height: 6000px;
	top: -3000px;
	width: 100%;
	left: 0;
	position: absolute;
	z-index: -1;
	background-color: #ffa;
}
table.matrix.docutils.align-default thead th:not(:first-child):hover,
table.matrix.docutils.align-default tbody tr:hover td {
	background-color: #ffa;
}

/* Set full width for all responsive tables of a page.
 * Usage: insert the following line in the doc.
 *        .. rst-class:: widepage
 */
@media screen and (min-width: 1100px) {
    .wy-nav-content-wrap:has(.widepage) {
        background: #fcfcfc !important;
    }
    .wy-nav-content:has(.widepage) .wy-table-responsive {
        overflow: visible !important;
    }
}

/* Class numbering table rows in the first column.
 * Usage: insert the following line before the table without indent.
 *        .. rst-class:: numbered-table
 */
.numbered-table {
	counter-reset: row-number;
}
.numbered-table tbody tr {
	counter-increment: row-number;
}
.numbered-table tr td:first-child::before {
	content: counter(row-number) " - ";
	display: inline-block;
	min-width: 2.5em;
}
.numbered-table tr td:first-child p {
	display: inline-block;
}

/* Class highlighting non-empty table cells in green color.
 * Usage: insert the following line before the table without indent.
 *        .. rst-class:: punchcard
 */
.punchcard {
	vertical-align: middle;
}
.punchcard th,
.punchcard td:not(:first-child) {
	text-align: center;
}
.punchcard tbody td {
	padding: 4px 12px !important;
}
.punchcard tbody .row-odd td:not(:first-child):not(:empty) {
	background-color: #cf9 !important;
	color: #0c0 !important;
}
.punchcard tbody .row-even td:not(:first-child):not(:empty) {
	background-color: #ce9 !important;
	color: #0b0 !important;
}
