/* Index page styles (Task 4): accordion state, row counts, kanban board.
   Base tokens and shared rules live in style.css; do not duplicate them here. */

/* Accordions */
section.cat .cat-header::before {
  content: "\25BE"; /* down triangle */
  display: inline-block;
  width: 1.1em;
  color: var(--muted);
}

section.cat.collapsed .cat-header::before {
  content: "\25B8"; /* right triangle */
}

section.cat.collapsed .article-list {
  display: none;
}

/* Per-row counts */
.rs-row-meta {
  display: inline-flex;
  gap: 0.9em;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.rs-zero {
  opacity: 0.45;
}

.rs-wc {
  color: #c0392b;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .rs-wc { color: #ff8a8a; }
}

/* Pipeline status chips (list view). Shows the kanban column an article's
   card currently sits in - live from /api/state, same source the kanban
   board reads. "Imported" is the steady state and gets no chip.
   "Needs screenshots" is the one Max acts on, so it's the loudest. */
.rs-status-coming { background: #eef0f3; color: #5c6470; }
.rs-status-needs-screenshots { background: #fde2e1; color: #b3261e; font-weight: 700; }
.rs-status-in-review { background: #efe0fd; color: #6a3fb0; }
.rs-status-ready { background: #dcf5e3; color: #1c7a3d; }

@media (prefers-color-scheme: dark) {
  .rs-status-coming { background: #2a2d33; color: #aab1bb; }
  .rs-status-needs-screenshots { background: #3a1412; color: #ff8f87; }
  .rs-status-in-review { background: #2a1f42; color: #c9a6f5; }
  .rs-status-ready { background: #123420; color: #6fe3a0; }
}

/* Presence ("who's here"). Avatar styles mirror article.css's
   .rs-presence-avatar; kept separate here since the index page doesn't
   load article.css. */
.rs-online-indicator {
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: 0.6em;
  white-space: nowrap;
}

.rs-row-presence {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  transition: opacity 0.18s ease;
}

.rs-row-presence .rs-presence-avatar {
  width: 16px;
  height: 16px;
}

.rs-presence-avatar {
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--bg);
  background: var(--link, #1a56c4);
  color: #fff;
  font-size: 0.56rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.rs-presence-overflow { background: var(--muted); }

/* Kanban board */
#kanban {
  margin-top: 1.6em;
  overflow-x: auto;
  padding-bottom: 1em;
}

.kb-board {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 940px;
}

.kb-col {
  flex: 1 1 0;
  min-width: 180px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.kb-col.kb-over {
  border-color: var(--link);
}

.kb-col-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border: none;
  padding: 0;
}

.kb-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
}

.kb-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: grab;
}

.kb-card.kb-dragging {
  opacity: 0.5;
}

.kb-card.kb-file-over {
  border-color: var(--link);
  border-style: dashed;
}

.kb-card-head {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  flex-wrap: wrap;
}

.kb-title {
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.35;
}

a.kb-title {
  color: var(--fg);
  text-decoration: none;
}

a.kb-title:hover {
  color: var(--link);
}

.kb-meta {
  display: flex;
  gap: 0.8em;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}

.kb-move {
  margin-top: 6px;
  width: 100%;
  font: inherit;
  font-size: 0.75rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 4px;
}
