/* sd.allahabadi.dev path lists (/backend/, /frontend/), generated by .claude/sd-platform-kb/tools/build-pages.py.
   One row per question on paper, rows divided by hairlines (round 5, research/listing-page.md):
   position disc in the question's hue | title, brief, facts, your status | attempt counts block + action.
   Versioned by content hash in the generator, so no SD_V bump is needed for an edit here. */

.sdq-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--rule); }

.sdq {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) 300px;
  column-gap: clamp(20px, 2.4vw, 36px); align-items: start;
  padding: 28px var(--gut); border-top: 1px solid var(--rule);
  transition: background-color .2s var(--ease);
}
.sdq:hover { background: var(--paper-2); }
.sdq:has(.sdq-link:focus-visible) { outline: 3px solid var(--focus); outline-offset: -3px; }

.sdq-num {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--sd-h-fill); color: var(--sd-h-on);
  font: 800 1.6rem/1 var(--font-display); font-variant-numeric: tabular-nums;
}

.sdq-main { min-width: 0; }
.sdq-t { margin: 2px 0 6px; font-size: clamp(1.6rem, 2.3vw, 2.3rem); line-height: 1.1; letter-spacing: -0.015em; }
.sdq-link { color: var(--text); text-decoration: none; }
.sdq-link:focus-visible { outline: none; }
/* the title's link covers the whole row, so the row is one link and nothing else in it takes focus */
.sdq-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.sdq-brief { margin: 0; font-size: 1.15rem; line-height: 1.5; }
.sdq-facts {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 12px 0 0; min-height: 2rem; font-size: 1.05rem; color: var(--text-muted);
}

/* your own status: a chip, because it is a value that changes (not started / in progress / finished) */
.sdq-mine {
  display: inline-block; padding: 3px 12px; border-radius: 999px; border: 1px solid;
  font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.5;
}
.sdq-mine[hidden] { display: none; }
.sdq-mine[data-state="finished"] { background: var(--sd-green-bg); border-color: var(--sd-green-bd); }
.sdq-mine[data-state="progress"] { background: var(--sd-amber-bg); border-color: var(--sd-amber-bd); }
.sdq-mine[data-state="gave-up"]  { background: var(--sd-rose-bg);  border-color: var(--sd-rose-bd); }

/* the attempt counts: their own block in the question's hue. Room is reserved, so they arrive without
   moving anything; empty (loading or failed) shows no block at all, never a "0" that means "unknown". */
.sdq-side { display: flex; flex-direction: column; gap: 12px; }
.sdq-count {
  display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px 24px; margin: 0; min-height: 86px;
  padding: 12px 16px; border: 2px solid transparent; border-radius: 6px; box-sizing: border-box;
  color: var(--text); font-size: 1.05rem; line-height: 1.25;
}
.sdq-count:not(:empty) { background: var(--sd-h-bg); border-color: var(--sd-h-bd); }
.sdq-count.is-zero { align-items: center; font-weight: 700; font-size: 1.15rem; }
.sdq-n { display: flex; flex-direction: column; min-width: 0; white-space: nowrap; }
.sdq-n b { font: 800 2.1rem/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* the action: ink, the one action colour (DESIGN.md); its words follow your progress (sd-pro.js) */
.sdq-go {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px;
  padding: 0 18px; border-radius: 6px; background: var(--action); color: var(--action-on);
  font-weight: 700; font-size: 1.1rem;
}
.sdq-go .sd-arw { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.sdq:hover .sdq-go .sd-arw, .sdq:has(.sdq-link:focus-visible) .sdq-go .sd-arw { transform: translateX(5px); }

@media (max-width: 1100px) {
  .sdq { grid-template-columns: 52px minmax(0, 1fr) 272px; }
  .sdq-count { gap: 8px 18px; padding: 12px 14px; font-size: 1rem; }
  .sdq-num { width: 52px; height: 52px; font-size: 1.35rem; }
  .sdq-n b { font-size: 1.8rem; }
}

/* phones and narrow windows: disc beside the title, the counts and the action across the row */
@media (max-width: 760px) {
  .sdq { grid-template-columns: 44px minmax(0, 1fr); padding: 20px var(--gut); column-gap: 14px; }
  .sdq-facts { margin-top: 8px; font-size: 1rem; }
  .sdq-num { width: 44px; height: 44px; font-size: 1.15rem; }
  .sdq-t { margin-top: 4px; font-size: 1.55rem; }
  .sdq-brief { font-size: 1.05rem; }
  .sdq-side { grid-column: 1 / -1; margin-top: 14px; }
  .sdq-side { gap: 10px; }
  .sdq-count { min-height: 70px; padding: 10px 14px; }
  .sdq-n b { font-size: 1.6rem; }
  .sdq-go { min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .sdq, .sdq-go .sd-arw { transition: none; }
}
