/*
 * The projects index, as a list rather than a tile grid.
 *
 * One column of rows separated by hairlines: a year rail on the left, the
 * writing in the middle, a small plate on the right. The whole row is the
 * link. No cards, no colored rails, no hover-reveal - everything a row has
 * to say is visible before you touch it.
 */

.pindex {
  border-top: 1px solid var(--color-text-primary);
  margin-top: var(--space-lg);
}

.pindex__row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 208px;
  gap: var(--space-xl);
  align-items: start;
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  text-decoration: none;
  color: inherit;
}

/* The row is one link, so the hit area is the row and screen readers get a
   single target instead of three competing ones. */
.pindex__row::after {
  content: '';
  position: absolute;
  inset: 0;
}
.pindex__row:hover .pindex__title,
.pindex__row:focus-visible .pindex__title {
  color: var(--color-accent-text);
}
.pindex__row:focus-visible {
  outline: 2px solid var(--color-accent-text);
  outline-offset: 4px;
}
.pindex__row:hover .pindex__arrow,
.pindex__row:focus-visible .pindex__arrow {
  transform: translateX(4px);
  opacity: 1;
}

.pindex__year {
  font-family: var(--font-meta);
  font-size: var(--text-meta);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
  padding-top: 3px;
  letter-spacing: 0.04em;
}

.pindex__label {
  font-family: var(--font-meta);
  font-size: var(--text-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-text);
}

.pindex__title {
  font-family: var(--font-display);
  font-size: var(--text-h4, 21px);
  font-weight: var(--weight-semi);
  letter-spacing: -0.014em;
  line-height: 1.25;
  margin: 4px 0 0;
  text-wrap: balance;
  transition: color 0.18s ease;
}
.pindex__arrow {
  display: inline-block;
  margin-left: 0.35em;
  opacity: 0.35;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.pindex__meta {
  font-family: var(--font-meta);
  font-size: var(--text-micro);
  color: var(--color-text-secondary);
  margin-top: 5px;
}

.pindex__desc {
  font-size: var(--text-small);
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin: var(--space-xs) 0 0;
  max-width: 58ch;
}

.pindex__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-xs);
}
.pindex__tags span {
  font-family: var(--font-meta);
  font-size: var(--text-micro);
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  padding: 2px 7px;
}

.pindex__plate {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-surface, var(--color-bg));
}
.pindex__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .pindex__title,
  .pindex__arrow { transition: none; }
  .pindex__row:hover .pindex__arrow { transform: none; }
}

/* One column on narrow screens, plate first so each row still opens with
   an image the way the desktop row does when you scan right. */
@media (max-width: 860px) {
  .pindex__row {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
  }
  .pindex__plate { order: -2; aspect-ratio: 2 / 1; }
  .pindex__year { order: -1; padding-top: 0; }
}
