.project_coverage {
  width: 100%;
  /* font-size: 0.875rem; */
}

.project_coverage thead {
  position: sticky;
  z-index: 1;
  top: calc(-1 * var(--base-gap)); /* compensate .main top padding when scrolling */
}

.project_coverage thead th {
  /* adding a background prevents the th-button background from working */
  vertical-align: bottom;
  border-bottom: var(--base-border);
  font-size: 0.875em;
}

.project_coverage thead::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: calc(-1 * var(--base-gap)); /* compensate .main padding to overlap content */
  right: calc(-1 * var(--base-gap)); /* compensate .main padding to overlap content */
  top: calc(-1 * var(--base-gap)); /* compensate .main padding to overlap content */
  bottom: 0;
  background: var(--color-bg-main);
}

.project_coverage th,
.project_coverage td {
  padding: calc(0.5 * var(--base-rhythm)) var(--base-rhythm);
  border-right: var(--base-border);
  position: relative;
}

.project_coverage td {
  text-align: right;
}

.project_coverage th:last-child,
.project_coverage td:last-child {
  border-right: none;
}

.project_coverage tr:first-child th:first-child, /* tr compensate colspan */
.project_coverage td:first-child {
  width: auto;
  text-align: left;
}

.project_coverage td:not(:first-child) {
  width: 1px;
  white-space: nowrap;
}

.project_coverage tr.project_coverage-file:hover {
  background: rgba(255,255,255,0.3);
}

.project_coverage tr.project_coverage-folder td {
  padding-right: 0;
}

.project_coverage-folder-title {
  /* font-weight: bold; */
  display: flex;
  align-items: flex-end;
  column-gap: calc(0.5 * var(--base-rhythm));
  /* font-size: 0.75em; */
  line-height: 1;
  color: #999;
  padding: calc(0.5 * var(--base-rhythm));
  position: relative;
  background: var(--color-bg-secondary);
}

.project_coverage-file-link {
  display: flex;
  /* column-gap: var(--base-rhythm); */
  padding: calc(0.5 * var(--base-rhythm));
  border-radius: calc(0.5 * var(--base-rhythm));
  transition: background .3s;
  border: 1px solid rgba(255,255,255,0);
}

.project_coverage-file-icon {}

.project_coverage-file-title {
  font-size: 1em;
  font-weight: 500;
  line-height: 1.2;
  transition: color .2s;
  display: flex;
  column-gap: var(--base-rhythm);
}

.project_coverage-file-path {
  font-size: 0.75em;
  color: var(--color-fg-secondary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
}

.project_coverage-file-details {
  position: relative;
  flex-grow: 1;
}

.project_coverage-file-link:not([href]):hover  {
  /* color: gray; */
  /* all this file have no links -> they are red */
}

.project_coverage-file_uncovered .project_coverage-file-link,
.project_coverage-file_uncovered .project_coverage-file-title {
  color: var(--color-danger);
  font-weight: 400 !important;
}

.project_coverage-file-link[href]:hover .project_coverage-file-icon,
.project_coverage-file-link[href]:hover .project_coverage-file-title {
  color: var(--color-fg-accent);
}

.project_coverage-file-link[href] .project_coverage-file-icon,
.project_coverage-file-link[href] .project_coverage-file-title {
  color: var(--color-fg-main);
}

/* cols */

.project_coverage-col-line {
  background-color: rgba(255, 155, 0, 0.05) !important;
}

.project_coverage-col-func {
  background-color: rgba(175, 0, 255, 0.05) !important;
}

.sorted_col.project_coverage-col-line,
th.project_coverage-col-line {
  background-color: rgba(255, 155, 0, 0.15) !important;
}

.sorted_col.project_coverage-col-func,
th.project_coverage-col-func {
  background-color: rgba(175, 0, 255, 0.15) !important;
}

/* value_extended */

.value_extended[data-ext]::after {
content: attr(data-ext);
margin-left: 2px;
font-size: 0.85em;
font-weight: 200;
}

/* project_coverage-sort_handler */

.project_coverage-sort_handler {
  cursor: pointer;
}

.project_coverage-sort_handler::after {
  content: '○';
  display: block;
}

.project_coverage-sort_handler::before {
  content: '';
  cursor: pointer;
  position: absolute;
  inset: 0;
  z-index: -1;
}

.project_coverage-sort_handler:hover {
  color: var(--color-blue);
}

.project_coverage-sort_handler:hover::before {
  border: 3px solid white;
}

.project_coverage-sort_handler[sorted]::before {
  border: 3px solid white;
}

/* ▿ ▵ △ ▽ ▾ ▴ */

.project_coverage-sort_handler:hover::after {
  /* the first act: desc */
  content: '▽';
}

.project_coverage-sort_handler[sorted='asc']::after {
  content: '▴';
}

.project_coverage-sort_handler[sorted='dsc']::after {
  content: '▾';
}

.project_coverage-sort_handler[sorted='dsc']:hover::after {
  content: '△';
}

.project_coverage-sort_handler[sorted='asc']:hover::after {
  content: '▽';
}

/* sort_reset */

.project_coverage-sort_reset {
  display: flex;
  flex-direction: column;
  gap: var(--base-padding);
}

.project_coverage-sort_reset::after {
  content: ' ';
  display: block;
}

/* sorted sort_reset */

.project_coverage.sorted .project_coverage-sort_reset {
  cursor: pointer;
}

.project_coverage.sorted .project_coverage-sort_reset::after {
  content: 'reset sorting';
  font-weight: 400;
  text-align: right;
  color: var(--color-fg-accent);
}

.project_coverage.sorted .project_coverage-sort_reset::before {
  content: '';
  cursor: pointer;
  position: absolute;
  inset: 0;
  z-index: -1;
}

.project_coverage.sorted .project_coverage-sort_reset:hover::before {
  background-color: rgb(255 255 255 / 50%);
}

/* sorted mods */

.project_coverage.sorted .project_coverage-folder,
.project_coverage.sorted .project_coverage-file-indent {
  display: none;
}

.project_coverage.sorted .project_coverage-file-path {
  display: block;
}

.project_coverage.sorted .project_coverage-file-details {
  position: relative;
  flex-grow: 1;
  padding: 0 0 var(--base-padding) 0;
}

/* color */

.color-secondary {
  color: var(--color-fg-secondary);
}

.color-uncovered {
  color: var(--color-danger);
}
