/* ============================================================
   PROJECT.CSS — JEUNES SCOLARISÉS
   Page: Projects Listing
   Fonts: Cormorant Garamond (display) + Outfit (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ────────────────────────────────────────────
   ROOT TOKENS
──────────────────────────────────────────── */
:root {
  --green-deep:   #1b4d30;
  --green-mid:    #276140;
  --green-vivid:  #34a058;
  --gold:         #c8860a;
  --gold-warm:    #e9a825;
  --amber:        #f5c842;
  --cream:        #faf6ef;
  --parchment:    #f0e9d8;
  --ink:          #161c18;
  --text-dark:    #1a1a1a;
  --text-body:    #2e2e2e;
  --text-muted:   #5a5a5a;
  --white:        #ffffff;
  --border:       rgba(27, 77, 48, 0.11);
  --border-gold:  rgba(200, 134, 10, 0.18);

  --status-active:    #34a058;
  --status-planning:  #c8860a;
  --status-completed: #1a6b8a;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Outfit', sans-serif;

  --radius:       16px;
  --radius-sm:    10px;
  --radius-pill:  50px;
  --shadow:       0 4px 28px rgba(27, 77, 48, 0.08);
  --shadow-hover: 0 18px 56px rgba(27, 77, 48, 0.17);
  --transition:   all 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ────────────────────────────────────────────
   BASE
──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: var(--font-body); color: var(--text-body); background: var(--cream); margin: 0; }

/* ════════════════════════════════════════════
   SECTION WRAPPER
════════════════════════════════════════════ */
.section {
  position: relative;
  padding: 100px 24px 130px;
  max-width: 1240px;
  margin: 0 auto;
}

.section::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent, transparent 47px,
    rgba(27, 77, 48, 0.03) 47px,
    rgba(27, 77, 48, 0.03) 48px
  );
  pointer-events: none;
  z-index: 0;
}

.section::after {
  content: '';
  position: absolute;
  top: -80px; right: -160px;
  width: 640px; height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 200, 66, 0.09) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.section > * { position: relative; z-index: 1; }

/* ════════════════════════════════════════════
   PAGE HEADER
════════════════════════════════════════════ */
.section > h1::before {
  content: 'OUR INITIATIVES';
  display: block;
  font-family: var(--font-body);
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 16px;
}

.section > h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700; line-height: 1.05;
  color: var(--green-deep); letter-spacing: -0.01em;
  margin: 0 0 10px;
  animation: titleIn 0.88s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes titleIn {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section > p:first-of-type {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--text-muted); font-weight: 300; line-height: 1.85;
  max-width: 580px; margin: 0 0 48px;
  padding-left: 22px; border-left: 4px solid var(--gold-warm);
  animation: paraIn 0.88s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}
@keyframes paraIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════
   STATUS FILTER ROW  (.status-filter)
════════════════════════════════════════════ */
.status-filter {
  display: flex;
  flex-direction: row;          /* ← all 3 in one horizontal line */
  align-items: stretch;
  gap: 16px;
  margin-bottom: 36px;
  animation: gridIn 0.88s cubic-bezier(0.22, 1, 0.36, 1) 0.20s both;
}
@keyframes gridIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Each filter card ── */
.filter-card {
  display: flex;
  flex: 1;                      /* equal width for all three */
  flex-direction: row;          /* everything on one horizontal line */
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  text-decoration: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(27, 77, 48, 0.07);
  padding: 14px 20px 14px 22px;
  position: relative;
  transition: var(--transition);
  overflow: hidden;
}

/* Coloured left accent bar */
.filter-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 5px;
  border-radius: var(--radius) 0 0 var(--radius);
  transition: width 0.3s ease;
}

.filter-card:nth-child(1)::before { background: var(--status-active); }
.filter-card:nth-child(2)::before { background: var(--status-planning); }
.filter-card:nth-child(3)::before { background: var(--status-completed); }

.filter-card:hover::before { width: 8px; }

/* Title */
.filter-card h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-deep);
  margin: 0;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.3s ease;
}

/* Coloured dot before title */
.filter-card h4::before {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
  transition: box-shadow 0.3s ease;
}

.filter-card:nth-child(1) h4::before {
  background: var(--status-active);
  box-shadow: 0 0 0 3px rgba(52, 160, 88, 0.20);
  animation: pulse 2s ease-in-out infinite;
}
.filter-card:nth-child(2) h4::before {
  background: var(--status-planning);
  box-shadow: 0 0 0 3px rgba(200, 134, 10, 0.20);
}
.filter-card:nth-child(3) h4::before {
  background: var(--status-completed);
  box-shadow: 0 0 0 3px rgba(26, 107, 138, 0.20);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(52, 160, 88, 0.20); }
  50%       { box-shadow: 0 0 0 6px rgba(52, 160, 88, 0.08); }
}

/* Description — sits right next to the title */
.filter-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 0 10px;           /* spacing from title */
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.3s ease;
}

/* Hover state */
.filter-card:hover {
  box-shadow: 0 8px 28px rgba(27, 77, 48, 0.12);
  transform: translateY(-2px);
  text-decoration: none;
}

.filter-card:nth-child(1):hover h4 { color: var(--status-active); }
.filter-card:nth-child(2):hover h4 { color: var(--status-planning); }
.filter-card:nth-child(3):hover h4 { color: var(--status-completed); }

/* Active / selected state */
.filter-card:nth-child(1).is-active { background: var(--status-active); border-color: var(--status-active); }
.filter-card:nth-child(2).is-active { background: var(--status-planning); border-color: var(--status-planning); }
.filter-card:nth-child(3).is-active { background: var(--status-completed); border-color: var(--status-completed); }

.filter-card.is-active h4,
.filter-card.is-active p { color: var(--white) !important; }

.filter-card.is-active::before { width: 8px; background: rgba(255,255,255,0.35) !important; }

/* Stagger animation */
.filter-card:nth-child(1) { animation: cardIn 0.65s cubic-bezier(0.22,1,0.36,1) 0.26s both; }
.filter-card:nth-child(2) { animation: cardIn 0.65s cubic-bezier(0.22,1,0.36,1) 0.34s both; }
.filter-card:nth-child(3) { animation: cardIn 0.65s cubic-bezier(0.22,1,0.36,1) 0.42s both; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ════════════════════════════════════════════
   ACTIVE FILTER BADGE
════════════════════════════════════════════ */
.section > p.mt-24 {
  display: inline-flex;
  align-items: center; gap: 10px;
  background: rgba(52, 160, 88, 0.09);
  border: 1px solid rgba(52, 160, 88, 0.22);
  border-radius: var(--radius-pill);
  padding: 7px 18px;
  font-size: 0.82rem; font-weight: 500;
  color: var(--green-mid);
  margin-bottom: 28px;
}

.section > p.mt-24 strong {
  font-weight: 700;
  color: var(--green-deep);
}

/* ════════════════════════════════════════════
   PROJECT CARDS GRID
════════════════════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

@media (min-width: 1000px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1240px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Empty state */
.card-grid > p {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-style: italic; font-size: 1.15rem;
  color: var(--text-muted); text-align: center;
  padding: 60px 20px;
  background: var(--parchment);
  border-radius: var(--radius);
  border: 1px dashed var(--border-gold);
}

/* ════════════════════════════════════════════
   PROJECT CARD
════════════════════════════════════════════ */
.card-grid .card.card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}

.card-grid .card.card-link::before {
  content: '';
  display: block;
  height: 5px;
  background: linear-gradient(to right, var(--green-vivid), var(--gold-warm));
  flex-shrink: 0;
  transition: height 0.3s ease;
}

.project-card-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--parchment);
}

.project-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.4s ease;
}

.card-grid .card.card-link:hover .project-card-image img {
  transform: scale(1.06);
  filter: saturate(1.06) brightness(1.03);
}

.card-grid .card.card-link:hover::before { height: 7px; }

.card-grid .card.card-link::after {
  content: '↗';
  position: absolute;
  top: 16px; right: 18px;
  font-size: 1.1rem;
  color: var(--text-muted);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.card-grid .card.card-link:hover::after { opacity: 1; transform: scale(1); }

.card-grid .card.card-link:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(52, 160, 88, 0.22);
  text-decoration: none;
}

.card-grid .card.card-link h4 {
  padding-left: 28px;
  padding-right: 28px;
}

.card-grid .card.card-link h4 {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700;
  color: var(--green-deep);
  margin: 0; line-height: 1.2;
  text-align: justify;
  padding-top: 16px;
  padding-bottom: 18px;
  padding-right: 16px;
  padding-left: 16px;
  transition: color 0.3s ease;
}

.card-grid .card.card-link:hover h4 { color: var(--green-mid); }

/* Stagger project cards */
.card-grid .card.card-link:nth-child(1) { animation: projectIn 0.68s cubic-bezier(0.22,1,0.36,1) 0.30s both; }
.card-grid .card.card-link:nth-child(2) { animation: projectIn 0.68s cubic-bezier(0.22,1,0.36,1) 0.38s both; }
.card-grid .card.card-link:nth-child(3) { animation: projectIn 0.68s cubic-bezier(0.22,1,0.36,1) 0.46s both; }
.card-grid .card.card-link:nth-child(4) { animation: projectIn 0.68s cubic-bezier(0.22,1,0.36,1) 0.54s both; }
.card-grid .card.card-link:nth-child(5) { animation: projectIn 0.68s cubic-bezier(0.22,1,0.36,1) 0.62s both; }
.card-grid .card.card-link:nth-child(6) { animation: projectIn 0.68s cubic-bezier(0.22,1,0.36,1) 0.70s both; }

@keyframes projectIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Focus ring */
.card.card-link:focus-visible,
.filter-card:focus-visible {
  outline: 3px solid var(--gold-warm);
  outline-offset: 3px;
}

/* ════════════════════════════════════════════
   UTILITY
════════════════════════════════════════════ */
.mt-24 { margin-top: 28px !important; }
.mt-48 { margin-top: 56px !important; }
.center { text-align: center !important; }

/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */
@media (max-width: 991.98px) {
  .section { padding: 80px 24px 100px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
}

@media (max-width: 767.98px) {
  .section { padding: 64px 20px 80px; }
  .section > h1 { font-size: clamp(2.2rem, 9vw, 3rem); }
  .section > p:first-of-type { margin-bottom: 44px; padding-left: 16px; border-left-width: 3px; }

  /* Stack filter cards on mobile */
  .status-filter {
    flex-direction: column;
    gap: 12px;
  }

  .filter-card p { white-space: normal; }

  .card-grid { grid-template-columns: 1fr; gap: 18px; }
}