/* WP-D1 - templates/portfolio/projects.html only.
 *
 * Every selector here is scoped under .pp-page and every class is prefixed
 * pp- deliberately. The `projects` Page row's already-assigned CSSStyle
 * rows (loaded globally via templates/base.html whenever `page` is in
 * context - see docs/MOCKUP_DECISIONS.md Annex A.1, "page also drives
 * per-page CSS... simply not passing page... would strip the projects
 * page's assigned styles") define their own unprefixed .category-filter,
 * .project-card and .tech-badge rules for the legacy blob layout. Reusing
 * those class names here would silently pull in that unrelated styling
 * (or fight it on cascade order) - this file exists precisely so the new
 * mockup-matching layout does not depend on, or collide with, that legacy
 * CSS. Nothing here is a redesign of the legacy classes; that is out of
 * WP-D1's scope. Palette, layout numbers and selectors are carried over
 * from docs/mockup_projects_and_workfeed.html's own <style> block
 * (the "functional" rules only - the mockup's own documentation chrome
 * such as .viewport/.tag/.wire/.ruling is not reproduced here).
 */

.pp-page {
    --pp-dark-bg: #0B0C10;
    --pp-primary: #66FCF1;
    --pp-secondary: #45A29E;
    --pp-highlight: #A020F0;
    --pp-text: #C5C6C7;
    --pp-text-muted: #8f9ba8;
    --pp-purple-accent: #a78bfa;
    --pp-card-bg: #11141a;
}

.pp-btn-primary {
    background: linear-gradient(135deg, var(--pp-primary), #4ad8d0);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pp-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 252, 241, 0.3);
    color: #000;
}

/* ---------- filter panel ---------- */
.pp-filter-panel {
    background: var(--pp-card-bg);
    border: 1px solid rgba(102, 252, 241, 0.08);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.pp-filter-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--pp-text-muted);
    margin-bottom: 0.75rem;
}

.pp-category-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    min-height: 44px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(102, 252, 241, 0.15);
    color: var(--pp-text);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pp-category-filter:hover {
    border-color: var(--pp-primary);
    color: var(--pp-primary);
    background: rgba(102, 252, 241, 0.06);
}

.pp-category-filter.active {
    background: rgba(102, 252, 241, 0.14);
    border-color: var(--pp-primary);
    color: var(--pp-primary);
    font-weight: 600;
}

.pp-cf-count {
    font-size: 0.7rem;
    color: var(--pp-text-muted);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 0.05rem 0.45rem;
}

.pp-category-filter.active .pp-cf-count {
    color: var(--pp-primary);
    background: rgba(102, 252, 241, 0.18);
}

/* D-07: zero under an active search - muted, still a live anchor */
.pp-category-filter.zero {
    color: var(--pp-text-muted);
    border-color: rgba(255, 255, 255, 0.09);
    opacity: 0.78;
}

.pp-category-filter.zero:hover {
    opacity: 1;
    border-color: var(--pp-primary);
    color: var(--pp-primary);
}

.pp-category-filter.zero .pp-cf-count {
    color: var(--pp-text-muted);
    background: rgba(255, 255, 255, 0.04);
}

.pp-filter-search {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(102, 252, 241, 0.15);
    border-radius: 8px;
    color: var(--pp-text);
    padding: 0.65rem 1rem;
    width: 100%;
}

.pp-filter-search::placeholder {
    color: var(--pp-text-muted);
}

.pp-filter-search:focus {
    outline: none;
    border-color: var(--pp-primary);
    box-shadow: 0 0 0 3px rgba(102, 252, 241, 0.12);
}

.pp-search-hint {
    font-size: 0.72rem;
    color: var(--pp-text-muted);
    margin-top: 0.4rem;
}

.pp-result-count {
    font-size: 0.85rem;
    color: var(--pp-text-muted);
}

.pp-result-count .pp-highlight {
    color: var(--pp-primary);
}

.pp-clear-filter {
    color: var(--pp-purple-accent);
    font-size: 0.8rem;
    text-decoration: none;
}

.pp-clear-filter:hover {
    color: var(--pp-primary);
}

.pp-feed-crosslink {
    font-size: 0.85rem;
    color: var(--pp-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(102, 252, 241, 0.3);
}

.pp-feed-crosslink:hover {
    border-bottom-color: var(--pp-primary);
}

/* ---------- card ---------- */
.pp-card {
    background: linear-gradient(145deg, #1a1e26, #0f1217);
    border: 1px solid rgba(102, 252, 241, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.pp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pp-primary), var(--pp-highlight));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pp-card:hover::before {
    opacity: 1;
}

.pp-card:hover {
    transform: translateY(-4px);
    border-color: rgba(102, 252, 241, 0.3);
    box-shadow: 0 8px 32px rgba(102, 252, 241, 0.08);
}

.pp-card-image {
    height: 180px;
    background: linear-gradient(135deg, #1F2833, #0B0C10);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pp-primary);
    font-size: 3rem;
    border-bottom: 1px solid rgba(102, 252, 241, 0.1);
    overflow: hidden;
}

.pp-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pp-card-image--empty {
    background: linear-gradient(135deg, #15181f, #0d0f14);
    color: rgba(102, 252, 241, 0.22);
}

.pp-category-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.7rem;
    letter-spacing: 0.4px;
    white-space: nowrap;
    background: rgba(167, 139, 250, 0.12);
    color: var(--pp-purple-accent);
    border: 1px solid rgba(167, 139, 250, 0.3);
}

/* Per-category colour, restored per Primarch direction (supersedes the
   single-accent WP-A2 mockup styling): one distinct hue per real
   CATEGORY_VOCABULARY slug (models.py), applied to both the card badge and
   the resting filter pill. :not(.active):not(.zero) keeps this at equal
   specificity to those two state rules earlier in this file regardless of
   cascade order, so a selected or zero-count filter still shows its own
   existing highlight/muted look instead of the category colour. */
[data-category="web-development"] .pp-category-badge,
.pp-category-filter[data-category="web-development"]:not(.active):not(.zero) {
    background: rgba(52, 152, 219, 0.14);
    color: #3498db;
    border-color: rgba(52, 152, 219, 0.4);
}

[data-category="data-management"] .pp-category-badge,
.pp-category-filter[data-category="data-management"]:not(.active):not(.zero) {
    background: rgba(155, 89, 182, 0.14);
    color: #9b59b6;
    border-color: rgba(155, 89, 182, 0.4);
}

[data-category="data-visualization"] .pp-category-badge,
.pp-category-filter[data-category="data-visualization"]:not(.active):not(.zero) {
    background: rgba(233, 30, 99, 0.14);
    color: #e91e63;
    border-color: rgba(233, 30, 99, 0.4);
}

[data-category="machine-learning"] .pp-category-badge,
.pp-category-filter[data-category="machine-learning"]:not(.active):not(.zero) {
    background: rgba(46, 204, 113, 0.14);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.4);
}

[data-category="infrastructure-ai"] .pp-category-badge,
.pp-category-filter[data-category="infrastructure-ai"]:not(.active):not(.zero) {
    background: rgba(243, 156, 18, 0.14);
    color: #f39c12;
    border-color: rgba(243, 156, 18, 0.4);
}

[data-category="scientific-computing"] .pp-category-badge,
.pp-category-filter[data-category="scientific-computing"]:not(.active):not(.zero) {
    background: rgba(26, 188, 156, 0.14);
    color: #1abc9c;
    border-color: rgba(26, 188, 156, 0.4);
}

[data-category="integration-tools"] .pp-category-badge,
.pp-category-filter[data-category="integration-tools"]:not(.active):not(.zero) {
    background: rgba(241, 196, 15, 0.14);
    color: #f1c40f;
    border-color: rgba(241, 196, 15, 0.4);
}

[data-category="process-governance"] .pp-category-badge,
.pp-category-filter[data-category="process-governance"]:not(.active):not(.zero) {
    background: rgba(149, 165, 166, 0.14);
    color: #95a5a6;
    border-color: rgba(149, 165, 166, 0.4);
}

.pp-card-title {
    color: var(--pp-purple-accent);
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0;
}

.pp-card-summary {
    color: var(--pp-text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.pp-block-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--pp-text-muted);
    margin-bottom: 0.4rem;
}

.pp-tech-badge {
    background: rgba(102, 252, 241, 0.1);
    color: var(--pp-primary);
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    border: 1px solid rgba(102, 252, 241, 0.2);
}

.pp-feature-list {
    list-style: none;
    padding-left: 0;
    margin: 0 0 1rem;
}

.pp-feature-list li {
    position: relative;
    padding-left: 1.1rem;
    font-size: 0.8rem;
    color: var(--pp-text-muted);
    margin-bottom: 0.3rem;
    line-height: 1.45;
}

.pp-feature-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--pp-primary);
    opacity: 0.7;
}

.pp-feature-more {
    font-size: 0.72rem;
    color: var(--pp-text-muted);
}

.pp-repo-link {
    font-size: 0.78rem;
    color: var(--pp-text-muted);
    text-decoration: none;
}

.pp-repo-link:hover {
    color: var(--pp-primary);
}

.pp-card .btn-outline-primary {
    border-color: var(--pp-primary);
    color: var(--pp-primary);
}

.pp-card .btn-outline-primary:hover {
    background: var(--pp-primary);
    color: #000;
}

/* ---------- empty state ---------- */
.pp-empty-state {
    border: 1px dashed rgba(102, 252, 241, 0.2);
    border-radius: 12px;
    padding: 3rem 1.5rem;
    text-align: center;
    background: var(--pp-card-bg);
}

.pp-empty-state .pp-empty-icon {
    font-size: 2.5rem;
    color: rgba(102, 252, 241, 0.35);
    margin-bottom: 0.75rem;
}

.pp-empty-state h3 {
    color: #fff;
    font-weight: 600;
    font-size: 1.15rem;
}

.pp-empty-state p {
    color: var(--pp-text-muted);
    font-size: 0.9rem;
    max-width: 34rem;
    margin: 0.5rem auto 1.25rem;
}
