/* Lab.rador — project styles layered over Bootstrap 5.3 */

body {
  font-feature-settings: "kern" 1;
}

.navbar-brand {
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* An item of the menu keeps its label on one line; the menu folds behind its button instead. */
.navbar .nav-link {
  white-space: nowrap;
}

/* Privilege-gated elements are hidden by default and revealed by
   labrador.js once /api/me/privileges/ responds. This prevents a flash of
   controls the user cannot use (FR-03). */
[data-privilege] {
  display: none;
}
[data-privilege].privilege-granted {
  display: revert;
}

code {
  font-size: 0.85em;
}

/* A table of a form that stacks below 576 px: every row is a block and every cell a line headed by
   its ``data-label``, so no field is hidden. */
@media (max-width: 575.98px) {
  .table-stack thead {
    display: none;
  }
  .table-stack,
  .table-stack tbody,
  .table-stack tr,
  .table-stack td {
    display: block;
    width: 100%;
  }
  .table-stack tr {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bs-border-color);
  }
  .table-stack td {
    border: 0;
    padding: 0.15rem 0;
  }
  .table-stack td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--bs-secondary-color);
  }
}

/* The columns of a table that labrador.js hid by priority, the cell that opens the row of them,
   and that row. Without the script none of them exists. */
.col-hidden {
  display: none !important;
}
.table-toggle-cell {
  width: 2rem;
  padding-right: 0 !important;
}
.table-detail > td {
  background-color: var(--bs-tertiary-bg);
}

/* The place of a result of the search: a level a line, each inside the one above it. What is shown
   of a result stands at the edge of the card: a row of a table needs its width. */
.kb-tree {
  --kb-step: 1.6rem;
  padding-left: calc(var(--kb-start) * var(--kb-step));
}
.kb-tree ul {
  padding-left: var(--kb-step);
}
.kb-level {
  display: flex;
  gap: 0.35rem;
}
.kb-joint {
  flex: none;
  font-family: var(--bs-font-monospace);
  font-weight: 400;
  letter-spacing: -0.1em;
  user-select: none;
}
.kb-shown {
  margin: 0.35rem 0 0.6rem calc(var(--kb-depth) * var(--kb-step) * -1);
}
.kb-words {
  white-space: pre-line;
}
.kb-rows td,
.kb-rows th,
.kb-names-alone th {
  min-width: 6rem;
  overflow-wrap: break-word;
}
@media (max-width: 575.98px) {
  .kb-tree {
    --kb-step: 0.6rem;
  }
}
/* Where a row would not go in whole it is a block, every cell a line headed by its column. */
@media (max-width: 991.98px) {
  .kb-rows thead {
    display: none;
  }
  .kb-rows,
  .kb-rows tbody,
  .kb-rows tr,
  .kb-rows td,
  .kb-names-alone,
  .kb-names-alone thead,
  .kb-names-alone tr,
  .kb-names-alone th {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .kb-rows tr {
    padding: 0.25rem 0;
  }
  .kb-rows td,
  .kb-names-alone th {
    border: 0;
    padding: 0.1rem 0.4rem;
  }
}
