/* ---------- Cats: list rows (cats/_cat), thumbnails, the history timeline ---------- */

.cat-list {
  padding: 0;
  list-style: none;
}

.cat-row + .cat-row {
  border-top: var(--border);
}

.cat-row__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: inherit;
  text-decoration: none;

  &:hover {
    background: var(--color-surface-hover);
  }
}

.cat-row__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.cat-row__name {
  font-weight: var(--weight-medium);
}

.cat-row__meta {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-row__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-1);
}

.cat-thumb {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.cat-thumb--empty {
  display: grid;
  place-items: center;
  background: var(--color-primary-subtle);
  color: var(--color-primary-text);

  svg {
    width: 55%;
  }
}

.cat-thumb--lg {
  width: 4.5rem;
  height: 4.5rem;
}

.cat-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* The cat's history: newest first, a line down the left */
.timeline {
  padding: var(--space-2) var(--space-4);
  list-style: none;
}

.timeline__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0 var(--space-3) var(--space-4);
  border-left: 2px solid var(--color-border);
  position: relative;

  &::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 1.15rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-primary);
  }
}

.timeline__body {
  flex: 1;
  min-width: 0;
}

.event-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.event-form__title {
  font-size: var(--text-md);
}

.filters__select {
  flex: 0 1 14rem;
}

@media (max-width: 40rem) {
  .cat-row__badges {
    display: none;
  }
}

/* A note in a cat's history: an outlined dot and the text in a soft box, so observations stand
   apart from things that were done (vaccines, treatments…) */
.timeline__item--note::before {
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
}

.timeline__note {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface-sunken);
  font-size: var(--text-sm);

  p + p {
    margin-top: var(--space-1);
  }
}
