/* Project cards share one size: the title and description are clamped and the footer is pinned to the bottom. */
.project-grid:not(.list-view){align-items:stretch;grid-auto-rows:1fr}
.project-grid:not(.list-view) .project-card{display:flex;flex-direction:column;height:100%;min-height:0}
.project-grid:not(.list-view) .project-cover{flex:none;height:132px}
.project-grid:not(.list-view) .project-card>.row:first-of-type{flex:none}
.project-grid:not(.list-view) .project-card h2{flex:none;margin:10px 13px 4px;font-size:17px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.project-grid:not(.list-view) .project-card .project-desc{flex:none;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;margin:0 13px 4px;min-height:calc(2 * 1.5em);line-height:1.5}
.project-grid:not(.list-view) .project-card>p.small{flex:none;margin:0 13px 6px;min-height:1.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.project-grid:not(.list-view) .project-metrics{flex:none;margin:0 13px 10px}
.project-grid:not(.list-view) .project-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:8px 0 0;border-top:1px solid var(--line);color:var(--muted)}
.project-grid:not(.list-view) .project-metrics span{margin:0;padding:0;text-align:left;font-size:12px;white-space:nowrap}
.project-grid:not(.list-view) .project-card>p.small{color:var(--muted);font-size:12px}
/* List view: same height for every row, actions grouped on the left. */
.project-grid.list-view{grid-auto-rows:1fr}
.project-grid.list-view .project-card>p.small{min-height:1.5em;color:var(--muted);font-size:12px}
.project-grid.list-view .project-card>.row:last-child{justify-content:flex-start;gap:8px}
.project-grid.list-view .project-card .project-desc{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}

/* Card footer: the main action on its own line, the other actions in a two-column grid so every label stays readable. */
.project-grid:not(.list-view) .project-card>.row:last-child{display:grid;grid-template-columns:1fr 1fr;gap:6px;flex:none;margin-top:auto;padding:11px 13px 13px}
.project-grid:not(.list-view) .project-card>.row:last-child>*{min-width:0;padding:7px 4px;font-size:12px;line-height:1.3;white-space:nowrap;text-align:center}
.project-grid:not(.list-view) .project-card>.row:last-child>.primary{grid-column:1/-1;padding:9px 6px;font-size:13px}
.project-grid:not(.list-view) .project-card>.row:first-of-type{gap:8px;align-items:center}
.project-grid:not(.list-view) .project-card>.row:first-of-type .project-roles{flex:1;min-width:0;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.project-grid:not(.list-view) .project-card>.row:first-of-type .pill{flex:none;white-space:nowrap}
