/**
 * Trending section styles.
 *
 * Lives between the hero and the card list on the homepage. Also used
 * on the Worker-rendered /trending/ and /trending/YYYY-W##/ pages,
 * which reuse the same markup shape for consistency.
 */

.trending {
  margin: 2rem 0 2.5rem;
}

.trending__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.trending__heading {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--color-text-primary);
}

.trending__more {
  font-size: 0.9rem;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
}

.trending__more:hover,
.trending__more:focus-visible {
  text-decoration: underline;
}

.trending-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.trending-card {
  position: relative;
}

.trending-card > a {
  display: grid;
  grid-template-columns: auto 56px 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: var(--color-surface-raised, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
  color: var(--color-text-primary);
  text-decoration: none;
  transition: background-color 120ms ease, transform 120ms ease;
}

.trending-card > a:hover,
.trending-card > a:focus-visible {
  background: var(--color-surface-hover, rgba(255, 255, 255, 0.07));
  outline: none;
}

.trending-card > a:focus-visible {
  box-shadow: 0 0 0 2px var(--color-accent);
}

.trending-card__rank {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--color-text-tertiary, rgba(255, 255, 255, 0.5));
  font-size: 0.95rem;
  min-width: 2ch;
  text-align: right;
}

.trending-card__img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--color-skeleton, rgba(255, 255, 255, 0.04));
}

.trending-card__img--none {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--color-skeleton, rgba(255, 255, 255, 0.04));
}

.trending-card__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.trending-card__name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trending-card__neighborhood {
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.7));
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* /trending/ standalone page: heavier treatment since it's the primary content. */
.trending--standalone .trending__heading {
  font-size: 1.75rem;
}
.trending--standalone .trending-list {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.trending--standalone .trending-card > a {
  padding: 0.85rem 1rem;
}
