/*
 * projects.css - project card presentation for projects.html.
 * Data replaced the stock photo band; these rules dress what replaced it.
 */
/* ===================================================================
   Project cards - data instead of decoration.
   The photo band and its overlay are gone; these rules dress what
   replaced it. Older .image-* rules above are retained only because
   list-view still references them.
   =================================================================== */

.project-card .card-top {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 12px;
}
.project-card .type-badge {
    /* No longer floating over an image. */
    position: static; top: auto; left: auto;
    padding: 3px 9px; border-radius: 999px;
    font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em;
}
.project-card .kind {
    font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--text-tertiary);
    /* A long kind ("NOTEBOOK / RESEARCH") next to a long language ("Jupyter
       Notebook") pushed the health chip onto a second line. Shrinking alone does
       not fix it: the row is flex-wrap, and a flex container wraps before it
       shrinks, so the cap has to be explicit. The kind is the least important
       thing in this row, so it gives way first. */
    min-width: 0; max-width: 22%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The audit result, on the card. Pushed to the right edge of the card top so it
   reads as a status rather than another tag in the sequence, and coloured by
   severity because the whole point is that one critical finding should be
   visible while scanning a grid of 1,331. */
.project-card .language {
    /* Budget for the row: the chip needs ~60px and there are three 10px gaps, so
       the two text labels get 30% and 22% of the card. Measured against the
       longest pair in the estate, "Jupyter Notebook" beside "Notebook / research". */
    min-width: 0; max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-card .health {
    margin-left: auto;
    padding: 3px 9px; border-radius: 999px;
    font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em;
    text-transform: uppercase; white-space: nowrap;
    border: 1px solid currentColor;
}
.project-card .health.sev-critical { color: #ff6b6b; background: rgba(255, 107, 107, 0.1); }
.project-card .health.sev-high     { color: #ffa94d; background: rgba(255, 169, 77, 0.1); }
.project-card .health.sev-medium   { color: #ffd43b; background: rgba(255, 212, 59, 0.09); }
/* Clean is stated, not celebrated: it is a quieter pill than any finding, since
   an audited-clean repo is the unremarkable case. */
.project-card .health.sev-clean {
    color: var(--text-tertiary); background: none; border-color: var(--border);
}

.project-card h3 { margin-bottom: 8px; }
.project-card .card-title {
    background: none; border: 0; padding: 0; cursor: pointer;
    font: inherit; color: var(--text-primary); text-align: left;
}
.project-card .card-title:hover { color: var(--accent); }

.project-card .card-desc {
    font-size: 0.88rem; line-height: 1.6; color: var(--text-secondary);
    margin: 0 0 14px;
    /* Two lines, so every card in a row is the same height. */
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card .facts {
    display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px;
}
.project-card .fact {
    font-family: var(--font-mono); font-size: 0.68rem;
    color: var(--text-tertiary); font-variant-numeric: tabular-nums;
}
.project-card .fact strong { color: var(--accent); font-weight: 500; }

.project-card .flags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.project-card .flag {
    font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.04em;
    padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border);
    color: var(--text-tertiary);
}
.project-card .flag.on { color: #8FBF9F; border-color: rgba(143, 191, 159, 0.3); }
.project-card .flag.off { opacity: 0.55; }
.project-card .flag.warn {
    color: var(--accent-secondary); border-color: rgba(224, 82, 31, 0.4);
    background: rgba(224, 82, 31, 0.08);
}

.project-card .footer {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    border-top: 1px solid var(--border); padding-top: 14px;
}
.project-card .read-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--gradient); color: var(--on-accent); border: 0;
    border-radius: 999px; padding: 8px 16px; cursor: pointer;
    font-size: 0.8rem; font-weight: 600;
}
.project-card .read-btn:hover { filter: brightness(1.08); }
.project-card .gh-btn {
    font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--text-secondary); text-decoration: none;
}
.project-card .gh-btn:hover { color: var(--accent); }

/* Cards are shorter without the photo, so more fit per row. */
.projects-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Rows were ragged: a one-line description made a shorter card than a two-line
   one. The card fills its grid cell and the footer is pushed to the bottom, so
   the actions line up across a row. */
.project-card { display: flex; }
.project-card .content { display: flex; flex-direction: column; flex: 1; }
.project-card .flags { margin-top: auto; }

/* Featured projects wrap each card in .featured-card, so the cards are not grid
   siblings and the grid could not equalise them. The wrapper stretches and
   passes the height through. */
.featured-card { display: flex; }
.featured-card > .project-card { flex: 1; }
