/* View-specific styles: Priority list (ranked table that becomes cards on narrow screens). */

/* ---------------------------------------------------------------- filters */

.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filters__selects {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.count-note {
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- priority table */

.task-table {
  --columns: 52px 20px minmax(0, 1fr) 250px 170px 140px 104px;
  display: flex;
  flex-direction: column;
}

.task-table__head,
.task-row {
  display: grid;
  grid-template-columns: var(--columns);
  gap: 16px;
  align-items: center;
  padding: 0 20px;
}

.task-table__head {
  padding-top: 10px;
  padding-bottom: 10px;
  background: var(--surface-header);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.task-row {
  padding-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
  /* Long boards: rows off screen skip layout and paint (5,000 tasks render in half the time). */
  content-visibility: auto;
  contain-intrinsic-size: auto 72px;
}

.task-row:last-child {
  border-bottom: 0;
}

.task-row:hover {
  background: color-mix(in oklab, var(--surface), var(--ink) 2.5%);
}

.rank {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.rank--top {
  color: var(--accent);
}

.grip {
  color: var(--border-dashed);
  display: grid;
  place-items: center;
}

button.grip {
  /* A button (for the keyboard) that looks like the drag handle. */
  width: 20px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  font: inherit;
}

button.grip:hover,
button.grip:focus-visible {
  color: var(--ink-2);
}

.task-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.task-main__line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.task-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-title:hover {
  color: var(--link);
  text-decoration: underline;
}

.task-key {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  flex-shrink: 0;
}

.task-desc {
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-projects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.task-people {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-people__name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-org {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.task-org__dept {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.task-org__section {
  font-size: 13px;
  color: var(--ink-2);
}

.cell-label {
  display: none;
}

@media (max-width: 1360px) {
  .task-table {
    --columns: 44px 16px minmax(0, 1fr) 200px 150px 120px 96px;
  }

  .task-table__head,
  .task-row {
    gap: 12px;
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Narrow: every row becomes a card with the rank on the left. */
@media (max-width: 1100px) {
  .task-table__head {
    display: none;
  }

  .task-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas:
      "rank main status"
      "rank projects projects"
      "rank people org";
    row-gap: 10px;
  }

  .task-row > .rank {
    grid-area: rank;
    align-self: start;
  }

  .task-row > .grip {
    display: none;
  }

  .task-row > .task-main {
    grid-area: main;
  }

  .task-row > .task-projects {
    grid-area: projects;
  }

  .task-row > .task-people {
    grid-area: people;
  }

  .task-row > .task-org {
    grid-area: org;
    flex-direction: row;
    gap: 6px;
    align-items: baseline;
  }

  .task-row > .pill {
    grid-area: status;
    align-self: start;
  }

  .task-desc {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

@media (max-width: 560px) {
  .task-row {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-areas:
      "rank main"
      "rank status"
      "rank projects"
      "rank people"
      "rank org";
  }

  .rank {
    font-size: 17px;
  }

  .search-box {
    width: 100%;
  }

  .filters__selects {
    margin-left: 0;
    width: 100%;
  }

  .filters__selects .field {
    flex: 1;
  }
}

/* ---------------------------------------------------------------- placeholder views */

.coming-soon {
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-2);
}
