/* Projects: the Projects table (/projects, projects.html) and the project page (/projects/{id}:
   header, milestone strip, Log beside Tasks, price quotes, Creative tasks). Tokens and the
   style.css components only; the decision slot is styled by its own area. */

/* product silhouettes (the Projects rows, the project header) */
.thumb { width: 44px; height: 28px; flex: 0 0 auto; color: var(--faint); vertical-align: middle; }
.thumb.lg { width: 72px; height: 46px; }

/* --- the Projects table ------------------------------------------------------- */
.plist-hd { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s3) var(--s5); }
.plist-hd h1 { margin: 0; }
.plist-filter { width: 300px; max-width: 100%; margin-left: auto; }
.plist-views { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s4) 0; }
.plist-views .chip { font-size: var(--t-body); line-height: 30px; padding: 0 var(--s3); }
.plist-back { margin: var(--s3) 0 var(--s4); }
.plist-empty { color: var(--muted); }

.plist-tbl { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.plist-tbl td { padding: var(--s3); line-height: 1.4; }
.plist-tbl tbody tr:last-child td { border-bottom: 0; }
.plist-tbl tbody tr:hover td { background: var(--bg); }
.pl-name { min-width: 280px; }
.pl-name a { display: inline-flex; align-items: center; gap: var(--s2); color: var(--ink); font-weight: 600; }
.pl-no { color: var(--muted); font-weight: 400; }
.pl-status { display: block; margin: var(--s1) 0 0 calc(44px + var(--s2)); color: var(--muted); }
.pl-stage { white-space: nowrap; }
.pl-now { min-width: 260px; max-width: 46ch; }
.pl-date { white-space: nowrap; color: var(--muted); }
.now-amber b { color: var(--amber); }
.now-red { color: var(--red); font-weight: 600; }
.now-blue { color: var(--acc); font-weight: 600; }
.now-muted { color: var(--muted); }

@media (max-width: 700px) {
  .plist-filter { width: 100%; margin-left: 0; }
  .plist-tbl, .plist-tbl tbody { display: block; background: none; border: 0; border-radius: 0; overflow: visible; }
  .plist-tbl thead { display: none; }
  .plist-tbl tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name name" "now now" "stage date"; gap: var(--s1) var(--s3); padding: var(--s3) var(--s4); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
  .plist-tbl tr + tr { margin-top: var(--s2); }
  .plist-tbl tbody tr:hover td { background: none; }
  .plist-tbl td { padding: 0; border: 0; min-width: 0; max-width: none; }
  .pl-name { grid-area: name; }
  .pl-now { grid-area: now; }
  .pl-stage { grid-area: stage; }
  .pl-date { grid-area: date; }
  .pl-status { margin-left: 0; }
  .pl-stage { color: var(--muted); }
  .pl-date { text-align: right; }
}

/* --- the project page: header -------------------------------------------------- */
.proj-hd { display: flex; align-items: flex-start; gap: var(--s4); margin-bottom: var(--s5); }
.proj-hd .thumb.lg { margin-top: var(--s1); }
.proj-id { min-width: 0; }
.proj-id h1 { margin: 0; }
.proj-aka { margin: var(--s1) 0 0; color: var(--muted); }
.proj-facts { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); margin: var(--s2) 0 0; color: var(--muted); }
.proj-facts b { color: var(--ink); font-weight: 600; }
.proj-status { max-width: var(--measure); margin: var(--s2) 0 0; font-size: var(--t-lead); line-height: 1.4; }

.proj .card { margin-top: var(--s4); }
.proj .card > .label { margin-bottom: var(--s3); }
.proj-sub { color: var(--muted); }

/* --- the milestone strip ----------------------------------------------------------- */
ol.strip { display: flex; flex-wrap: wrap; row-gap: var(--s4); margin: 0; padding: 0; list-style: none; }
li.node { position: relative; flex: 1 1 130px; min-width: 120px; padding: var(--s5) var(--s2) 0; line-height: 1.35; overflow-wrap: anywhere; }
li.node::before { content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 2px; background: var(--line); }
li.node:first-child::before { left: 50%; }
li.node:last-child::before { right: 50%; }
li.node::after { content: ""; position: absolute; top: 0; left: calc(50% - 8px); width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--rule); background: var(--paper); }
li.node { text-align: center; }
li.node.past::after { background: var(--rule); }
li.node.next::after { border-color: var(--acc); background: var(--acc); }
li.node.fork::after { border-style: dashed; border-color: var(--amber); }
li.node > a.ev { display: inline-block; text-decoration: none; }
li.node > a.ev:hover .node-l { text-decoration: underline dotted; }
.node-l { display: block; color: var(--muted); }
li.node.next .node-l { color: var(--acc); font-weight: 600; }
.node-d { display: block; color: var(--ink); font-weight: 600; }
li.node.future .node-d, li.node.fork .node-d { font-weight: 400; }
.node-was { display: block; color: var(--amber); }
li.node.big .node-was { color: var(--red); }
li.node.fork .node-was { color: var(--muted); }
.proj-undated { margin: var(--s4) 0 0; color: var(--muted); }
.proj-undated:first-child { margin-top: 0; }

/* --- Log beside Tasks ---------------------------------------------------------------- */
.proj-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s4); align-items: start; margin-top: var(--s4); }
.proj-cols > .card { margin-top: 0; }
.proj-cols > .proj-log:only-child, .proj-cols > .proj-tasks:only-child { grid-column: 1 / -1; }
.proj-log li { display: grid; grid-template-columns: 4.5em 8.5em minmax(0, 1fr); gap: var(--s3); align-items: baseline; }
.log-d { color: var(--muted); white-space: nowrap; }
.log-k { color: var(--muted); }
.log-t a.ev, .task-meta a.ev { color: var(--muted); white-space: nowrap; }
.log-t a.ev { margin-left: var(--s1); }
.task-meta { display: flex; flex-wrap: wrap; gap: 0 var(--s3); margin-top: var(--s1); color: var(--muted); }
.task-meta .late { color: var(--red); font-weight: 600; }

/* --- price quotes, Creative tasks --------------------------------------------------- */
.proj-quotes, .proj-creative { overflow-x: auto; }
.proj-quotes table.table, .proj-creative table.table { margin: 0 calc(-1 * var(--s3)); width: calc(100% + 2 * var(--s3)); }

@media (max-width: 860px) {
  .proj-cols { grid-template-columns: 1fr; }
  .proj-tasks { order: -1; }
}
@media (max-width: 700px) {
  .proj-hd { gap: var(--s3); }
  .proj-hd .thumb.lg { width: 44px; height: 28px; }
  .proj .card { padding: var(--s4); }
  li.node { flex-basis: 110px; min-width: 100px; }
  .proj-log li { grid-template-columns: auto 1fr; gap: 0 var(--s3); }
  .log-t { grid-column: 1 / -1; }
}

@media print {
  .plist-views, .plist-filter { display: none !important; }
  .proj-cols { display: block; }
  li.node { break-inside: avoid; }
}
