/* /projects route — layers on top of landing.css.
 *
 * Reuses .rail / .rail-btn / .stage / .row / .row-grid / .project-card /
 * .project-thumb / .project-meta / .btn-primary verbatim. This file only
 * adds the page-specific chrome: header layout, toolbar controls,
 * drop-active overlay, tag chips. No color literals — design tokens
 * track theme switches.
 */

.projects-stage {
  /* The landing's .stage has 56px top padding + 80px hero margin. The
   * projects page is denser — header sits at the top, no hero glow. */
  padding: 40px 56px 80px;
  gap: 32px;
}

/* Suppress the ambient gradient glow that landing's .stage::before
 * paints behind the hero — out of place on a list page. */
.projects-stage::before {
  display: none;
}

.projects-head {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.projects-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.projects-head-title {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.projects-h1 {
  /* Smaller than landing's 44px hero — list page, not a hero. */
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.projects-head-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.projects-import {
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.projects-import:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}

/* ── Toolbar ───────────────────────────────────────────── */

.projects-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.projects-search {
  flex: 1 1 280px;
  min-width: 240px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  transition:
    border-color var(--dur-fast),
    box-shadow var(--dur-fast);
}

.projects-search::placeholder {
  color: var(--text-dim);
}

.projects-search:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.projects-filter {
  display: inline-flex;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  overflow: hidden;
}

.projects-filter-btn {
  padding: 8px 14px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  border-right: 1px solid var(--border);
  transition:
    background var(--dur-fast),
    color var(--dur-fast);
}

.projects-filter-btn:last-child {
  border-right: 0;
}

.projects-filter-btn:hover {
  color: var(--text-primary);
}

.projects-filter-btn.is-active {
  background: var(--accent-dim);
  color: var(--accent-bright);
}

.projects-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.projects-sort select {
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
}

/* ── Grid + cards ──────────────────────────────────────── */

/* Reuse landing's .row-grid responsive grid via the component output;
 * this just provides the empty-state container. */
.projects-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.projects-empty {
  padding: 80px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* Real project thumbnail (ADR-011). The .project-thumb container
 * keeps its gradient class while the image loads, then the img sits
 * on top via object-fit. When no thumbnail exists yet (templates,
 * fresh imports, in-flight backfill) the img isn't rendered and the
 * gradient stays visible. */
.project-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Optional secondary lines on a card — description and tags. Sit
 * alongside the .project-meta h3 + span from landing.css; do not
 * redefine those (they already read from design tokens). */
.project-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 4px 0 6px 0;
  font-family: var(--font-ui);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.project-card-foot {
  display: block;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Drop zone (drag a .json onto the page to import) ──── */

.projects-stage--drop-active::before {
  /* Re-enables .stage::before with new content — the original glow is
   * suppressed by the .projects-stage rule above. */
  content: "Drop to import";
  display: flex;
  position: fixed;
  inset: 16px;
  top: 16px;
  left: 72px;
  right: 16px;
  bottom: 16px;
  width: auto;
  height: auto;
  background: rgba(0, 0, 0, 0.45);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-xl);
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 100;
  transform: none;
}

@media (max-width: 900px) {
  .projects-stage {
    padding: 32px 24px 60px;
  }
  .projects-h1 {
    font-size: 24px;
  }
}
