/* stylelint-disable media-feature-range-notation */

/* hugo start */

.main:has(> .project-table) {
  max-width: var(--nav-width);
  /* margin: var(--gap); */
}

.post-content:has(+ .project-table) {
  max-width: var(--main-width);
  margin: auto;
}

.gridjs-table {
  width: unset;
}

.monospace {
  font-family: monospace;
}

.chip {
  display: inline-block;
  padding: 0 10px;
  border: solid;
  border-radius: 25px;
  margin-bottom: 10px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.period li {
  padding-right: 2rem;
  float: left;
}

@media screen {
  .truncated > * {
    display: -webkit-box;
    overflow: hidden;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-clamp: 5;
  }

  .importance-1,
  .importance-1 + td {
    opacity: 0.8;
  }

  .importance-2,
  .importance-2 + td,
  .importance-3,
  .importance-3 + td,
  .importance-4,
  .importance-4 + td {
    background-color: #68a1fe42 !important;
  }

  .importance-5,
  .importance-5 + td {
    background-color: #fff20050 !important;
  }
}

@media screen and (min-width: 1280px) {
  .importance-1 + td {
    opacity: unset;
  }

  .importance-2 + td,
  .importance-3 + td,
  .importance-4 + td {
    background-color: unset !important;
  }

  .importance-5 + td {
    background-color: unset !important;
  }
}

.project-table .gridjs-tr {
  display: grid;
}

.project-table tr {
  align-items: center;
  margin: 1rem 0;
  grid-auto-flow: row;
  grid-template-columns: 2fr 1fr;
  list-style-position: inside;
}

.project-table td {
  height: 100%;
  box-sizing: border-box;
  align-content: center;
}

.project-table td:not(.truncated) {
  text-align: center;
}

.project-table .gridjs-tbody td:first-child {
  grid-row: 1 / 2;
}

.project-table .gridjs-tbody td:last-child {
  grid-area: 3 / 1 / 4 / 2;
}

.project-table h3,
.project-table h4 {
  display: inline;
}

.project-table a:has(h3),
.project-table a:has(h4) {
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}

.project-table h3:hover,
.project-table h4:hover {
  color: inherit;
}

.project-table ul {
  margin-bottom: 0px;
  padding-inline-start: 0px;
}

@media screen and (min-width: 1280px) {
  .main:has(> .project-table) {
    max-width: calc(100% - var(--gap) * 2);
  }

  .project-table tr {
    grid-template-columns: 2fr 1fr 1fr 1fr 2fr;
    margin: 0;
  }

  .project-table .gridjs-thead th:last-child {
    display: none;
  }

  .project-table .gridjs-tbody td:first-child {
    grid-area: 1 / 1 / 4 / 2;
  }

  .project-table .gridjs-tbody td:last-child {
    grid-column: 2 / 6;
  }
}

@media print {
  .gridjs-search,
  .gridjs-thead,
  .gridjs-sort {
    display: none;
  }

  .project-table .period > * {
    display: inline-block;
    overflow: hidden;
  }

  .project-table .period time {
    max-width: 10ch;
    white-space: nowrap;
  }
}

/* hugo end */

/* grid.js custom start */

@media screen {
  .gridjs-search {
    max-width: calc(var(--main-width) + var(--gap) * 2);
    margin: auto;
    float: unset;
  }
}

th.gridjs-th .gridjs-th-content {
  width: unset;
}
.gridjs-thead {
  font-size: 0.9rem;
}

.gridjs-tbody,
td.gridjs-td {
  background-color: unset;
}

tr.gridjs-tr {
  background-color: #fff;
}

td.gridjs-td:first-child,
td.gridjs-td:last-child {
  border: 1px solid #e5e7eb;
}

.gridjs-wrapper {
  border-color: unset;
  box-shadow: unset;
}

@container style(--color-scheme: dark) {
  tr.gridjs-tr {
    border-color: #1a1814;
    background-color: #000;
    box-shadow:
      0 1px 3px 0 rgb(255 255 255 / 10%),
      0 1px 2px 0 rgb(255 255 255 / 26%);
  }

  .gridjs-container {
    color: #fff;
  }

  .gridjs-footer {
    border-color: #1a1814;
    border-top: 1px solid #1a1814;
    background-color: #000;
    box-shadow:
      0 1px 3px 0 rgb(255 255 255 / 10%),
      0 1px 2px 0 rgb(255 255 255 / 26%);
  }

  input.gridjs-input {
    border: 1px solid #2d2923;
    background-color: #000;
  }

  input.gridjs-input:focus {
    border-color: #643d08;
    box-shadow: 0 0 0 3px rgb(106 66 12 / 50%);
  }

  .gridjs-pagination {
    color: #c2bfbb;
  }

  .gridjs-pagination .gridjs-pages button {
    border: 1px solid #2d2923;
    background-color: #000;
  }

  .gridjs-pagination .gridjs-pages button:focus {
    box-shadow: 0 0 0 2px rgb(106 66 12 / 50%);
  }

  .gridjs-pagination .gridjs-pages button:hover {
    background-color: #080808;
    color: #c3bda8;
  }

  .gridjs-pagination .gridjs-pages button:disabled,
  .gridjs-pagination .gridjs-pages button[disabled],
  .gridjs-pagination .gridjs-pages button:hover:disabled {
    background-color: #000;
    color: #948d7f;
  }

  .gridjs-pagination .gridjs-pages button.gridjs-spread {
    background-color: #000;
  }

  /* stylelint-disable-next-line selector-class-pattern */
  .gridjs-pagination .gridjs-pages button.gridjs-currentPage {
    background-color: #080808;
  }

  /* stylelint-disable-next-line no-descending-specificity */
  .gridjs-pagination .gridjs-pages button:last-child {
    border-right: 1px solid #2d2923;
  }

  button.gridjs-sort-neutral,
  button.gridjs-sort-asc,
  button.gridjs-sort-desc {
    filter: invert(100%);
  }

  td.gridjs-td,
  td.gridjs-td:first-child,
  td.gridjs-td:last-child {
    border: 1px solid #1a1814;
  }

  th.gridjs-th {
    border: 1px solid #1a1814;
    background-color: #060504;
    color: #6b7280;
  }

  th.gridjs-th-sort:hover {
    background-color: #1a1814;
  }

  th.gridjs-th-sort:focus {
    background-color: #1a1814;
  }

  th.gridjs-th-fixed {
    box-shadow: 0 1px 0 0 #1a1814;
  }

  @supports (-moz-appearance: none) {
    th.gridjs-th-fixed {
      box-shadow: 0 0 0 1px #1a1814;
    }
  }

  .gridjs-tr-selected td {
    background-color: #140a00;
  }

  .gridjs-loading-bar {
    background-color: #000;
  }

  .gridjs-loading-bar::after {
    background-image: linear-gradient(
      90deg,
      rgb(51 51 51 / 0%) 0,
      rgb(51 51 51 / 20%) 20%,
      rgb(51 51 51 / 50%) 60%,
      rgb(51 51 51 / 0%)
    );
  }

  .gridjs-resizable:hover {
    background-color: #643d08;
  }
}
