/**
 * Projects list + detail — home teal design system
 */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --pj-primary: #0d7377;
    --pj-primary-light: #14a098;
    --pj-primary-dark: #074f51;
    --pj-bg: #f8fafc;
    --pj-card: #ffffff;
    --pj-text: #0f172a;
    --pj-muted: #64748b;
    --pj-border: #e2e8f0;
    --pj-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --pj-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --pj-radius: 14px;
    --pj-radius-lg: 18px;
    --pj-font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
    --pj-font-body: 'Inter', system-ui, sans-serif;
}

.projects-page {
    font-family: var(--pj-font-body);
    background: var(--pj-bg);
    color: var(--pj-text);
}

.pj-hero,
.pj-detail-hero {
    background: linear-gradient(135deg, var(--pj-primary) 0%, var(--pj-primary-dark) 100%);
    padding: 48px 0 56px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.pj-hero::before,
.pj-detail-hero::before {
    content: '';
    position: absolute;
    top: -40%; right: -12%; width: 48%; height: 180%;
    background: rgba(255,255,255,0.04); transform: rotate(18deg); pointer-events: none;
}
.pj-detail-hero:not(.pj-detail-hero-plain)::after {
    content: '';
    position: absolute; inset: 0;
    background:
        linear-gradient(135deg, rgba(7,79,81,0.88) 0%, rgba(13,115,119,0.78) 100%),
        var(--pj-hero-image) center/cover no-repeat;
    z-index: 0;
}
.pj-hero .container,
.pj-detail-hero .container { position: relative; z-index: 1; }

.pj-breadcrumb {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    list-style: none; padding: 0; margin: 0 0 18px; font-size: 0.85rem;
}
.pj-breadcrumb a { color: rgba(255,255,255,0.75); text-decoration: none; }
.pj-breadcrumb a:hover { color: #fff; }
.pj-breadcrumb span { color: rgba(255,255,255,0.45); }
.pj-breadcrumb .current { color: rgba(255,255,255,0.95); max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pj-hero-title {
    font-family: var(--pj-font-display); font-size: clamp(1.75rem, 4vw, 2.4rem);
    font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px;
}
.pj-hero-sub { margin: 0 0 14px; max-width: 36rem; color: rgba(255,255,255,0.85); line-height: 1.55; }
.pj-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18);
    font-size: 0.82rem; font-weight: 600;
}

.pj-section { padding: 40px 0; }
.pj-section-tight { padding-top: 28px; padding-bottom: 0; }

.pj-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px;
}
.pj-stat {
    background: #fff; border: 1px solid var(--pj-border); border-radius: var(--pj-radius);
    padding: 16px; text-align: center; box-shadow: var(--pj-shadow-sm);
}
.pj-stat-value { font-family: var(--pj-font-display); font-weight: 800; font-size: 1.2rem; color: var(--pj-primary); }
.pj-stat-label { font-size: 0.8rem; color: var(--pj-muted); margin-top: 4px; }

.pj-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pj-filter {
    border: 1px solid var(--pj-border); background: #fff; color: var(--pj-muted);
    border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 0.88rem; cursor: pointer;
}
.pj-filter.is-active, .pj-filter:hover {
    background: var(--pj-primary); border-color: var(--pj-primary); color: #fff;
}

.pj-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}

.pj-card {
    background: var(--pj-card); border: 1px solid var(--pj-border); border-radius: var(--pj-radius-lg);
    box-shadow: var(--pj-shadow-sm); overflow: hidden; display: flex; flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pj-card:hover { transform: translateY(-3px); box-shadow: var(--pj-shadow-md); }

.pj-card-cover { position: relative; aspect-ratio: 16 / 10; background: #e2e8f0; overflow: hidden; }
.pj-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.pj-card-cover-empty {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(13,115,119,0.12), rgba(7,79,81,0.18));
    color: var(--pj-primary); font-size: 2rem;
}

.pj-badge {
    display: inline-flex; padding: 4px 10px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
    background: rgba(15,23,42,0.75); color: #fff;
}
.pj-card-cover .pj-badge { position: absolute; top: 12px; left: 12px; }
.pj-badge-active { background: #059669; }
.pj-badge-completed { background: var(--pj-primary); }
.pj-badge-pending { background: #64748b; }

.pj-card-body { padding: 16px 18px 8px; flex: 1; }
.pj-card-logo {
    width: 44px; height: 44px; border-radius: 10px; overflow: hidden; margin-bottom: 10px;
    border: 1px solid var(--pj-border);
}
.pj-card-logo img { width: 100%; height: 100%; object-fit: cover; }
.pj-card-title {
    font-family: var(--pj-font-display); font-size: 1.1rem; font-weight: 800; margin: 0 0 8px;
    letter-spacing: -0.02em;
}
.pj-card-desc { margin: 0 0 14px; color: var(--pj-muted); font-size: 0.9rem; line-height: 1.5; }

.pj-progress { margin-bottom: 12px; }
.pj-progress-top {
    display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--pj-muted); margin-bottom: 6px; font-weight: 600;
}
.pj-progress-bar {
    height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden;
}
.pj-progress-bar span {
    display: block; height: 100%; background: linear-gradient(90deg, var(--pj-primary), var(--pj-primary-light));
    border-radius: 999px;
}

.pj-funding {
    display: flex; justify-content: space-between; gap: 10px; align-items: flex-end; margin-bottom: 8px;
}
.pj-funding strong { display: block; color: var(--pj-primary); font-family: var(--pj-font-display); }
.pj-funding small { color: var(--pj-muted); }
.pj-days { font-size: 0.8rem; color: var(--pj-muted); font-weight: 600; }

.pj-card-footer {
    display: flex; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--pj-border); margin-top: auto;
}
.pj-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 14px; border-radius: 10px; background: var(--pj-primary); color: #fff;
    text-decoration: none; font-weight: 600; font-size: 0.88rem; border: 1px solid transparent;
}
.pj-btn:hover { background: var(--pj-primary-dark); color: #fff; }
.pj-btn-ghost {
    background: transparent; color: var(--pj-primary); border-color: var(--pj-border);
}
.pj-btn-ghost:hover { border-color: var(--pj-primary); background: rgba(13,115,119,0.06); color: var(--pj-primary); }
.pj-btn-light {
    background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.35); color: #fff;
}
.pj-btn-light:hover { background: rgba(255,255,255,0.22); color: #fff; }
.pj-btn-block { width: 100%; margin-top: 14px; }

.pj-empty {
    text-align: center; padding: 56px 20px; background: #fff; border: 1px dashed var(--pj-border);
    border-radius: var(--pj-radius-lg); color: var(--pj-muted);
}
.pj-empty i { font-size: 2rem; color: var(--pj-primary-light); margin-bottom: 10px; }
.pj-empty h2 { font-family: var(--pj-font-display); color: var(--pj-text); margin: 0 0 6px; }
.pj-empty p { margin: 0 0 14px; }

/* Detail */
.pj-detail-hero .pj-badge { margin-bottom: 12px; }
.pj-detail-logo {
    width: 64px; height: 64px; border-radius: 14px; overflow: hidden; margin-bottom: 12px;
    border: 2px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.12);
}
.pj-detail-logo img { width: 100%; height: 100%; object-fit: cover; }

.pj-detail-stats {
    display: flex; flex-wrap: wrap; gap: 18px; margin: 18px 0;
}
.pj-detail-stats div { min-width: 110px; }
.pj-detail-stats strong { display: block; font-family: var(--pj-font-display); font-size: 1.15rem; font-weight: 800; }
.pj-detail-stats span { font-size: 0.8rem; color: rgba(255,255,255,0.75); }

.pj-detail-progress { max-width: 420px; margin-bottom: 18px; }
.pj-detail-progress .pj-progress-bar { background: rgba(255,255,255,0.25); height: 10px; }
.pj-detail-progress .pj-progress-bar span { background: #fff; }
.pj-detail-progress-label { margin-top: 6px; font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.9); }
.pj-detail-cta { display: flex; flex-wrap: wrap; gap: 10px; }

.pj-detail-layout {
    display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; align-items: start;
}
.pj-panel {
    background: #fff; border: 1px solid var(--pj-border); border-radius: var(--pj-radius-lg);
    box-shadow: var(--pj-shadow-sm); padding: 22px; margin-bottom: 16px;
}
.pj-panel h2 {
    font-family: var(--pj-font-display); font-size: 1.15rem; font-weight: 800; margin: 0 0 14px;
}
.pj-panel h3 {
    font-family: var(--pj-font-display); font-size: 1rem; font-weight: 700; margin: 18px 0 10px;
}
.pj-prose { color: #334155; line-height: 1.7; }
.pj-gallery img { width: 100%; border-radius: 12px; display: block; }

.pj-timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--pj-border); }
.pj-timeline li { padding: 0 0 18px 18px; position: relative; }
.pj-timeline li::before {
    content: ''; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--pj-primary); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--pj-primary);
}
.pj-timeline strong { display: block; font-family: var(--pj-font-display); }
.pj-timeline span { font-size: 0.82rem; color: var(--pj-muted); }
.pj-timeline p { margin: 6px 0 0; color: #475569; font-size: 0.92rem; }

.pj-fund-list { margin: 0; display: grid; gap: 10px; }
.pj-fund-list > div { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; }
.pj-fund-list dt { color: var(--pj-muted); }
.pj-fund-list dd { margin: 0; font-weight: 700; }
.pj-fund-list .is-good { color: #059669; }
.pj-fund-list .is-warn { color: #dc2626; }

.pj-donors { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.pj-donors li { display: flex; gap: 10px; align-items: center; }
.pj-donor-avatar {
    width: 36px; height: 36px; border-radius: 50%; background: rgba(13,115,119,0.12);
    color: var(--pj-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.pj-donors strong { display: block; font-size: 0.92rem; }
.pj-donors span { font-size: 0.78rem; color: var(--pj-muted); }
.pj-more-donors, .pj-muted { color: var(--pj-muted); font-size: 0.88rem; margin: 12px 0 0; }

.pj-share { display: flex; gap: 8px; }
.pj-share a {
    width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: var(--pj-bg); border: 1px solid var(--pj-border); color: var(--pj-primary); text-decoration: none;
}
.pj-share a:hover { background: var(--pj-primary); color: #fff; border-color: var(--pj-primary); }

.pj-back { text-align: center; margin-top: 12px; }

@media (max-width: 992px) {
    .pj-grid, .pj-stats { grid-template-columns: 1fr 1fr; }
    .pj-detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .pj-grid, .pj-stats { grid-template-columns: 1fr; }
    .pj-card-footer { flex-direction: column; }
    .pj-btn { width: 100%; }
}
