/* ultimate table view */

.content-view-table {
  border-collapse: collapse;
  width: 100%;
  background-color: var(--color-bg-contrast);
  /* for sticky toolbar */
  margin-top:  calc(var(--base-rhythm) * 5);
}

/* .content-view-table td,
.content-view-table th, */
.content-view-th,
.content-view-td {
  padding: .5rem 1rem;
  border: 1px solid #666;
  vertical-align: top;
}

.content-view-th {
  text-align: left;
  text-transform: uppercase;
  background-color: var(--color-border);
  font-size: .85em;
  font-weight: bold;
}

.content-view-td-type,
.content-view-td-meta {
  background-color: var(--color-bg-main);
  font-size: .85em;
}

.content-view-td-type {
  background-color: var(--color-bg-main);
  text-align: left;
  font-weight: normal;
  text-transform: uppercase;
}

.content-view-table div.document {
  /* TODO */
  display: block;
  max-width: 900px;
}

.content-view-table p:first-child {
  margin-top: 0;
}

.content-view-table p:last-child {
  margin-bottom: 0;
}

.content-view-td:empty {
  width: 1%;
}

.content-view-td-content:not(:empty) {
  min-width: 333px;
  width: 30%;
}

.content-view-td-title:not(:empty) {
  font-weight: bold;
  min-width: 264px;
}

.content-view-td-related:not(:empty) {
  min-width: 264px;
}

.content-view-td-related,
.content-view-td-related > ul.requirement__link {
  font-size: .85rem;
  margin-top: 0;
}

.content-view-td-related > ul.requirement__link:last-child {
  margin-bottom: 0;
}

/* Column visibility toolbar */

.table-toolbar {
  position: sticky;
  top: calc(-5 * var(--base-rhythm));
  left: calc(-9 * var(--base-rhythm));
  z-index: 10;
  width: fit-content;
  height: 0;
  display: flex;
  column-gap: var(--base-rhythm);
  padding-inline: calc(4 * var(--base-rhythm));
  background-color: var(--color-bg-main);
}

.table-toolbar__columns,
.table-toolbar__rows {
  position: relative;
  height: fit-content;
}

.table-toolbar__btn {
  text-transform: uppercase;
}

/* .collapsed and .expanded are classes inside SVG .icon_collapse */
[aria-expanded="false"] .icon_collapse_expand .collapsed {
  display: initial;
}
[aria-expanded="false"] .icon_collapse_expand .expanded {
  display: none;
}
[aria-expanded="true"] .icon_collapse_expand .expanded {
  display: initial;
}
[aria-expanded="true"] .icon_collapse_expand .collapsed {
  display: none;
}

.table-toolbar__panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  min-width: 180px;
}

.table-toolbar__panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: calc(var(--base-rhythm) * 0.5);
}

.table-toolbar__panel-title {
  font-weight: bold;
}

.table-toolbar__reset {
}

.table-toolbar__reset:hover {
  opacity: 1;
}

.table-toolbar__list {
  list-style: none;
  margin: 0;
  padding: .25rem 0;
  max-height: 60vh;
  overflow-y: auto;
}

.table-toolbar__item {
  margin: 0;
}

.table-toolbar__label {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  user-select: none;
}

.table-toolbar__label:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-fg-accent);
}
