/* ================================================================
   Projects Post Form — Frontend Styles
   Matches desktop (2-col grid) and mobile (1-col) layouts
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:wght@600;700&family=Inter:wght@400;500;600&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --ppf-green:      #1a6b3a;
  --ppf-green-dark: #145230;
  --ppf-green-soft: #e8f5ee;
  --ppf-text:       #1a2332;
  --ppf-muted:      #6b7280;
  --ppf-border:     #e5e7eb;
  --ppf-white:      #ffffff;
  --ppf-bg:         #f8faf9;
  --ppf-radius-sm:  8px;
  --ppf-radius-md:  14px;
  --ppf-radius-lg:  20px;
  --ppf-shadow:     0 2px 16px rgba(0,0,0,.08);
  --ppf-shadow-hov: 0 8px 32px rgba(0,0,0,.14);
  --ppf-transition: .25s cubic-bezier(.4,0,.2,1);

  /* Category palette */
  --cat-hunger:  #f97316;
  --cat-hunger-bg: #fff7ed;
  --cat-edu:     #0891b2;
  --cat-edu-bg:  #ecfeff;
  --cat-wash:    #7c3aed;
  --cat-wash-bg: #f5f3ff;
  --cat-women:   #db2777;
  --cat-women-bg:#fdf2f8;

  /* Status palette */
  --st-completed: #16a34a;
  --st-ongoing:   #2563eb;
  --st-suspended: #dc2626;
  --st-pending:   #d97706;
}

/* ── Container ─────────────────────────────────────────── */
.ppf-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
  font-family: 'Inter', sans-serif;
  color: var(--ppf-text);
}

/* ── Filter Bar ────────────────────────────────────────── */
.ppf-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
  padding: 6px 0;
}

.ppf-tab {
  padding: 9px 20px;
  border-radius: var(--ppf-radius-lg);
  border: 2px solid transparent;
  background: #f1f5f2;
  color: var(--ppf-muted);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ppf-transition);
  letter-spacing: .01em;
  white-space: nowrap;
}

.ppf-tab:hover {
  background: var(--ppf-green-soft);
  color: var(--ppf-green);
  border-color: var(--ppf-green-soft);
}

.ppf-tab.active {
  background: var(--ppf-green);
  color: #fff;
  border-color: var(--ppf-green);
  box-shadow: 0 2px 10px rgba(26,107,58,.35);
}

/* ── Project Grid ──────────────────────────────────────── */
.ppf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

/* ── Card ──────────────────────────────────────────────── */
.ppf-card {
  background: var(--ppf-white);
  border-radius: var(--ppf-radius-md);
  overflow: hidden;
  box-shadow: var(--ppf-shadow);
  transition: transform var(--ppf-transition), box-shadow var(--ppf-transition);
  display: flex;
  flex-direction: column;
}

.ppf-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ppf-shadow-hov);
}

/* Card hidden during filter */
.ppf-card.ppf-hidden {
  display: none;
}

/* ── Card Image ────────────────────────────────────────── */
.ppf-card-img-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #e5e7eb;
  aspect-ratio: 17 / 10;   /* ~680×400 ratio */
}

.ppf-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform .4s ease;
}

.ppf-card:hover .ppf-thumb {
  transform: scale(1.04);
}

.ppf-no-img {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--ppf-muted);
  background: var(--ppf-bg);
}

/* ── Status Badge ──────────────────────────────────────── */
.ppf-status-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  padding: 5px 13px;
  border-radius: var(--ppf-radius-lg);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  backdrop-filter: blur(8px);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}

.ppf-status-badge.status-completed  { background: rgba(22,163,74,.88); }
.ppf-status-badge.status-ongoing    { background: rgba(37,99,235,.88); }
.ppf-status-badge.status-suspended  { background: rgba(220,38,38,.88); }
.ppf-status-badge.status-pending    { background: rgba(217,119,6,.88); }

/* ── Card Body ─────────────────────────────────────────── */
.ppf-card-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* ── Category Tag ──────────────────────────────────────── */
.ppf-cat-tag {
  display: inline-block;
  padding: 4px 13px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  width: fit-content;
}

/* Map by slug */
.ppf-cat-tag.cat-hunger-poverty    { background: var(--cat-hunger-bg);  color: var(--cat-hunger); }
.ppf-cat-tag.cat-education         { background: var(--cat-edu-bg);     color: var(--cat-edu);    }
.ppf-cat-tag.cat-wash              { background: var(--cat-wash-bg);    color: var(--cat-wash);   }
.ppf-cat-tag.cat-women-youth       { background: var(--cat-women-bg);   color: var(--cat-women);  }
/* Fallback */
.ppf-cat-tag                       { background: #f1f5f2;               color: var(--ppf-green);  }

/* ── Title ─────────────────────────────────────────────── */
.ppf-card-title {
  margin: 0;
  font-family: 'Lora', Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ppf-text);
}

.ppf-card-title a {
  text-decoration: none;
  color: inherit;
  transition: color var(--ppf-transition);
}

.ppf-card-title a:hover {
  color: var(--ppf-green);
}

/* ── Excerpt ───────────────────────────────────────────── */
.ppf-card-excerpt {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ppf-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* ── Meta Row ──────────────────────────────────────────── */
.ppf-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--ppf-border);
}

.ppf-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
}

/* ── Empty State ───────────────────────────────────────── */
.ppf-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--ppf-muted);
}

.ppf-empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

/* ── Filter animation ──────────────────────────────────── */
@keyframes ppf-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.ppf-card.ppf-animate {
  animation: ppf-fade-in .3s ease both;
}

/* ── Responsive ────────────────────────────────────────── */

/* Tablet */
@media (max-width: 900px) {
  .ppf-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .ppf-card-title {
    font-size: 15px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .ppf-container {
    padding: 0 16px 48px;
  }

  .ppf-filter-bar {
    gap: 8px;
    margin-bottom: 24px;
  }

  .ppf-tab {
    padding: 10px 18px;
    font-size: 14px;
    border-radius: var(--ppf-radius-lg);
    background: #f1f5f2;
    /* Make them feel like pill chips on mobile */
    flex: 0 0 auto;
  }

  /* Full-width active tab on mobile */
  .ppf-tab.active {
    flex: 0 0 100%;
    text-align: center;
  }

  .ppf-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .ppf-card-img-wrap {
    aspect-ratio: 16 / 10;
  }

  .ppf-card-body {
    padding: 18px 18px 20px;
    gap: 9px;
  }

  .ppf-card-title {
    font-size: 18px;
    line-height: 1.3;
  }

  .ppf-card-excerpt {
    font-size: 14px;
    color: #9ca3af;
  }

  .ppf-card-meta {
    flex-direction: column;
    gap: 6px;
  }

  .ppf-meta-item {
    font-size: 13px;
    color: #6b7280;
  }
}
