/* ---- Routes listing page ---- */

.routes-filters {
  margin-bottom: 24px;
}

.routes-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.route-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 120ms ease, transform 120ms ease;
}

.route-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.route-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.route-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
}

.route-card-head h2 {
  font-size: 17px;
  margin: 0;
  line-height: 1.3;
  /* Stay at the name's natural single-line width up to the full row;
     once the name needs to wrap, h2 fills the line and the region drops
     to the next row instead of floating at the top-right. */
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
}

.route-card-region {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.route-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.route-card-owner {
  font-size: 12px;
  margin-top: auto;
  align-self: flex-start;
}
