/*
 * relay-index-list.css — shared "index list" card layout.
 *
 * The repo standard for area/hub index.html grids: a dense, single-column
 * list of two-line rows — title + status tag + arrow on line 1, a
 * truncated one-line description on line 2 — replacing the old padded
 * card grid. See MAINTENANCE.md "Cards → list".
 *
 * Deliberately reuses the existing card DOM/class contract unchanged
 * (.grid > a.card > .card-top{.card-tag,.card-arrow} + .card-title +
 * .card-desc, plus .is-archived-card / .is-fresh-card and the
 * .card-tag.is-fresh/.is-canon/.is-new modifiers) — this is a visual
 * restyle only. Two things read that markup directly and must keep
 * working without changes: nav.js (parses .section > .section-label +
 * .grid > .card for the sections drawer) and scripts/check_index_cards.py
 * (requires a real <a class="card" href="..."> in an index.html). Don't
 * rename or restructure those without updating both.
 *
 * Link this after /brand/relay-tokens-v35.css. A page that includes this
 * should NOT also define its own .grid/.card* rules — one source, so the
 * look can't drift area-to-area the way the old duplicated-per-page CSS did.
 */

.grid { display: flex; flex-direction: column; }

.card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 16px;
  row-gap: 2px;
  padding: 10px 10px;
  margin: 0 -10px;
  border-bottom: 0.5px solid var(--rly-border);
  border-radius: var(--rly-radius-sm);
  background: none;
  transition: background .14s var(--ease, ease);
}
.grid > .card:last-child { border-bottom: none; }
.card:hover { background: var(--rly-panel); }

/* Row 1: title …………… tag + arrow */
.card-title {
  order: 1;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--rly-text-bright);
  letter-spacing: -0.01em;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-top {
  order: 2;
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

/* Row 2: description, full width */
.card-desc {
  order: 3;
  flex: 0 0 100%;
  width: 100%;
  font-size: 12px;
  font-weight: 400;
  color: var(--rly-text-2);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-tag {
  font-family: var(--rly-font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rly-text-muted);
  background: var(--rly-panel);
  border: 0.5px solid var(--rly-border);
  border-radius: var(--rly-radius-sm);
  padding: 2px 7px;
  white-space: nowrap;
}
.card-tag.is-new { color: var(--rly-accent-text); background: var(--rly-accent-tint); border-color: var(--rly-border-hi); }
.card-tag.is-archived { color: var(--rly-text-muted); background: transparent; border-color: var(--rly-border); opacity: 0.7; }
.card-tag.is-canon { color: var(--rly-bg); background: var(--rly-accent-ui); border-color: var(--rly-accent-ui); }
.card-tag.is-fresh { color: var(--rly-indigo); background: var(--rly-indigo-dim); border-color: color-mix(in srgb, var(--rly-indigo) 40%, transparent); display: inline-flex; align-items: center; gap: 6px; }
.card-tag.is-fresh .fresh-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--rly-indigo); flex-shrink: 0; animation: card-fresh-breathe 1.8s ease-in-out infinite; }
@keyframes card-fresh-breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }
@media (prefers-reduced-motion: reduce) { .card-tag.is-fresh .fresh-dot { animation: none; } }

.card-arrow { color: var(--rly-text-muted); font-size: 12px; flex-shrink: 0; transition: color .18s var(--ease, ease); }
.card:hover .card-arrow { color: var(--rly-accent-text); }
.card.is-fresh-card:hover .card-arrow { color: var(--rly-indigo); }

.card.is-archived-card { opacity: 0.55; }
.card.is-archived-card:hover { opacity: 1; }

/* Cards with no live status tag (explorations, stable references) read quieter. */
.card:not(:has(.card-tag.is-new)):not(:has(.card-tag.is-fresh)):not(:has(.card-tag.is-canon)):not(.is-archived-card) { opacity: 0.6; }
.card:not(:has(.card-tag.is-new)):not(:has(.card-tag.is-fresh)):not(:has(.card-tag.is-canon)):not(.is-archived-card):hover { opacity: 1; }

@media (max-width: 640px) {
  .card { row-gap: 4px; }
  .card-title { white-space: normal; flex-basis: 100%; }
  .card-top { margin-left: 0; order: 2; }
  .card-desc { white-space: normal; overflow: visible; text-overflow: clip; }
}
