.channels {
  counter-reset: channel-row;
  width: 100%;
  margin-block-start: var(--space-5);
  display: block;
}

.channels:not(:has(.channel-row)) {
  display: none;
}

.channels::before {
  content: "";
  display: block;
  height: 1px;
  margin-block-end: var(--space-1);
  background-image: repeating-linear-gradient(to right, var(--sky-grey) 0 6px, transparent 6px 12px);
}

.channel-row {
  counter-increment: channel-row;
  position: relative;
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  column-gap: var(--space-3);
  min-height: 52px;
  padding-block: var(--space-3);
  text-decoration: none;
  color: var(--ink);
}

.channel-row + .channel-row {
  border-top: 1px solid var(--sky-grey-pale);
}

.channel-row:focus-visible {
  outline: 2px solid var(--amber-ink);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

.channel-row__index {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-stamp);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--ls-mono);
  color: var(--row-accent, var(--ink));
  min-width: 1.6em;
}

.channel-row__index::before {
  content: counter(channel-row, decimal-leading-zero);
}

.channel-row__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--row-accent, var(--ink));
  transition: transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
}

.channel-row__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

@media (hover: hover) {
  .channel-row:hover .channel-row__icon {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
  }
}

.channel-row:active .channel-row__icon {
  transform: scale(0.98);
}

.channel-row__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.channel-row__name {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-body);
  color: var(--ink-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-row__handle {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-label);
  letter-spacing: var(--ls-mono);
  color: var(--sage);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-row__stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-family: var(--font-mono);
  letter-spacing: var(--ls-mono);
}

.channel-row__stat:not(.has-stat) {
  display: none;
}

.channel-row__stat-num {
  font-size: var(--fs-mono-label);
  font-variant-numeric: tabular-nums;
  color: var(--ink-strong);
}

.channel-row__stat-label {
  font-size: var(--fs-mono-stamp);
  color: var(--olive);
  text-transform: uppercase;
}

.channel-row__cta {
  justify-self: end;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-mono-label);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--amber-ink);
  border: 1px solid var(--amber-ink);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-4);
  white-space: nowrap;
}

@media (max-width: 380px) {
  .channel-row {
    grid-template-columns: auto auto 1fr auto;
  }

  .channel-row__stat {
    display: none;
  }
}

@media (min-width: 1024px) {
  .channel-row {
    min-height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .channel-row__icon {
    transition: none;
  }
}
