/* ==========================================================
   R19.8 — All Projects + Project Archive visual overhaul
   ========================================================== */

/* ---------- All Projects header ---------- */

.page-head {
    gap: 18px;
}

.page-head > div:first-child h2 {
    margin-bottom: 6px !important;
}

.page-head > div:first-child p {
    max-width: 680px;
    color: #9eb8dc !important;
    line-height: 1.55;
}

/* ---------- Project filters only; Vault filters excluded ---------- */

form.filter-bar:not(.r197-filter-bar) {
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin: 18px 0 22px !important;
    padding: 14px !important;
    border: 1px solid rgba(123, 177, 250, .18) !important;
    border-radius: 14px !important;
    background: linear-gradient(145deg, rgba(13, 39, 68, .74), rgba(5, 18, 33, .88)) !important;
}

form.filter-bar:not(.r197-filter-bar) label {
    display: grid !important;
    flex: 1 1 180px;
    gap: 6px;
    color: #a8c3e7 !important;
    font-size: 10px;
    font-weight: 850;
}

form.filter-bar:not(.r197-filter-bar) input,
form.filter-bar:not(.r197-filter-bar) select {
    min-height: 39px !important;
    border-color: rgba(126, 184, 255, .22) !important;
    background: rgba(3, 14, 28, .72) !important;
}

form.filter-bar:not(.r197-filter-bar) button {
    min-height: 39px !important;
    padding-inline: 15px !important;
}

/* ---------- Active projects cards ---------- */

.project-grid.project-library-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 16px !important;
}

.project-card-shell {
    position: relative;
    min-width: 0;
    border: 1px solid rgba(121, 177, 252, .20) !important;
    border-radius: 15px !important;
    background: linear-gradient(145deg, rgba(13, 39, 68, .90), rgba(5, 18, 33, .98)) !important;
    box-shadow: 0 13px 30px rgba(0, 0, 0, .18);
    overflow: hidden;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.project-card-shell:hover {
    border-color: rgba(127, 188, 255, .48) !important;
    box-shadow: 0 18px 38px rgba(0, 0, 0, .28);
    transform: translateY(-3px);
}

.project-card {
    display: block !important;
    height: 100%;
    color: inherit !important;
    text-decoration: none !important;
}

.project-card-poster,
.project-card .project-poster,
.project-card img {
    display: block;
    width: 100%;
    height: 215px;
    border-bottom: 1px solid rgba(128, 182, 251, .15);
    background: linear-gradient(135deg, #12325a, #091a30);
    object-fit: cover;
}

.project-card-body {
    display: grid !important;
    gap: 8px;
    padding: 15px !important;
}

.project-card-body h3,
.project-card-body strong {
    margin: 0 !important;
    overflow: hidden;
    color: #f0f6ff !important;
    font-size: 16px !important;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card-body p {
    margin: 0 !important;
    color: #9eb8db !important;
    font-size: 11px;
    line-height: 1.5;
}

.project-card-body small {
    color: #83b5ff !important;
    font-size: 10px;
    font-weight: 850;
}

.project-card-more-menu {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    z-index: 3;
}

.project-card-more-menu > summary {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    border: 1px solid rgba(184, 212, 255, .28);
    border-radius: 8px;
    color: #e7f1ff !important;
    background: rgba(5, 19, 35, .78);
    cursor: pointer;
    list-style: none;
    backdrop-filter: blur(8px);
}

.project-card-more-menu > summary::-webkit-details-marker {
    display: none;
}

.project-card-more-menu > div,
.project-card-more-menu > form,
.project-card-more-menu[open] > *:not(summary) {
    margin-top: 6px;
}

.project-card-more-menu[open] {
    min-width: 155px;
    padding: 7px;
    border: 1px solid rgba(129, 184, 255, .26);
    border-radius: 10px;
    background: rgba(5, 18, 33, .98);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .28);
}

.project-card-more-menu a,
.project-card-more-menu button {
    display: flex !important;
    width: 100%;
    min-height: 33px;
    align-items: center;
    padding: 0 9px;
    border: 0;
    border-radius: 6px;
    color: #c9ddfa !important;
    background: transparent !important;
    font-size: 10px;
    font-weight: 850;
    text-align: start;
    text-decoration: none !important;
}

.project-card-more-menu a:hover,
.project-card-more-menu button:hover {
    color: #fff !important;
    background: rgba(52, 114, 204, .25) !important;
}

/* ---------- Archive page ---------- */

.archive-project-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)) !important;
    gap: 16px !important;
}

.archive-project-card {
    display: grid !important;
    grid-template-columns: 105px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(146, 151, 182, .23) !important;
    border-radius: 14px !important;
    background: linear-gradient(145deg, rgba(34, 39, 55, .86), rgba(11, 16, 27, .96)) !important;
}

.archive-project-poster {
    min-height: 178px;
    background: rgba(4, 13, 25, .72);
}

.archive-project-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.archive-project-body {
    display: grid !important;
    align-content: start;
    gap: 8px;
    padding: 14px !important;
}

.archive-project-body h3 {
    margin: 0 !important;
    color: #eff4ff !important;
    font-size: 15px !important;
}

.archive-project-body p {
    margin: 0 !important;
    color: #a8b3ca !important;
    font-size: 10px;
    line-height: 1.5;
}

.archive-label {
    display: inline-flex !important;
    align-items: center;
    width: fit-content;
    min-height: 22px;
    padding: 0 7px;
    border: 1px solid rgba(238, 187, 122, .35);
    border-radius: 999px;
    color: #ffe1b9 !important;
    background: rgba(173, 111, 38, .18);
    font-size: 9px;
    font-weight: 900;
}

.archive-reason {
    padding: 8px;
    border-left: 2px solid rgba(236, 180, 104, .58);
    border-radius: 5px;
    background: rgba(189, 120, 37, .09);
}

.archive-project-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 4px;
}

.archive-project-actions form,
.archive-project-actions a,
.archive-project-actions button {
    margin: 0 !important;
}

/* ---------- Empty cards ---------- */

.empty-state,
.project-grid + .empty-state,
.archive-project-grid + .empty-state {
    display: grid !important;
    place-items: center;
    min-height: 210px;
    padding: 25px;
    border: 1px dashed rgba(126, 183, 255, .28);
    border-radius: 14px;
    color: #abc4e7;
    background: rgba(7, 22, 38, .48);
    text-align: center;
}

.empty-state strong {
    color: #e9f3ff !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
    form.filter-bar:not(.r197-filter-bar) {
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .project-grid.project-library-grid,
    .archive-project-grid {
        grid-template-columns: 1fr !important;
    }

    .project-card-poster,
    .project-card .project-poster,
    .project-card img {
        height: 185px;
    }

    .archive-project-card {
        grid-template-columns: 88px minmax(0, 1fr);
    }
}
