/* ============================================================
   EVENTS.CSS — JEUNES SCOLARISÉS
   Page: Events
   Aesthetic: Live energy · calendar pulse · community motion
   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;
  --rust:         #b84c1a;
  --sky:          #1a6b8a;
  --text-dark:    #1a1a1a;
  --text-body:    #2e2e2e;
  --text-muted:   #5a5a5a;
  --white:        #ffffff;
  --border:       rgba(27, 77, 48, 0.11);

  --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: 1200px;
  margin: 0 auto;
}

/* ── Concentric circle watermark (background) ── */
.section::before {
  content: '';
  position: fixed;
  top: -200px;
  right: -200px;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  border: 80px solid rgba(52, 160, 88, 0.04);
  box-shadow:
    0 0 0 160px rgba(52, 160, 88, 0.025),
    0 0 0 280px rgba(233, 168, 37, 0.018);
  pointer-events: none;
  z-index: 0;
}

/* ── Bottom-left green glow ── */
.section::after {
  content: '';
  position: fixed;
  bottom: -120px;
  left: -100px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27, 77, 48, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

/* ════════════════════════════════════════════
   PAGE HEADER
════════════════════════════════════════════ */

/* Eyebrow */
.section > h1::before {
  content: 'WHAT\'S HAPPENING';
  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;
}

/* Title */
.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);    }
}

/* Subtitle */
.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: 560px;
  margin: 0 0 72px;
  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);    }
}

/* ════════════════════════════════════════════
   SECTION HEADINGS  (h2 — Upcoming / Past)
════════════════════════════════════════════ */
.section > h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--green-deep);
  margin: 0 0 32px;
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Coloured pill tag beside heading */
.section > h2:first-of-type::after {
  content: 'UPCOMING';
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--green-vivid);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* "Past Events" heading — muted pill */
.section > h2:last-of-type::after,
.section > h2.mt-48::after {
  content: 'ARCHIVE';
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(90, 90, 90, 0.10);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* Decorative rule beneath h2 */
.section > h2::before {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.section > h2:first-of-type::before {
  background: linear-gradient(135deg, var(--green-vivid), var(--gold-warm));
}

.section > h2.mt-48::before,
.section > h2:last-of-type::before {
  background: rgba(90, 90, 90, 0.15);
}

/* ════════════════════════════════════════════
   CARD GRID
════════════════════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 26px;
  margin-bottom: 20px;
}

/* 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: 52px 20px;
  background: var(--parchment);
  border-radius: var(--radius);
  border: 1px dashed rgba(200, 134, 10, 0.30);
}

/* ════════════════════════════════════════════
   EVENT CARD — UPCOMING  (.card.card-link)
   First .card-grid's cards
════════════════════════════════════════════ */
.card.card-link {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 0;
  transition: var(--transition);
  cursor: pointer;
}

/* ── Top colour strip (upcoming = vivid green) ── */
.card-grid:first-of-type .card.card-link::before,
.card-grid .card.card-link::before {
  content: '';
  display: block;
  height: 5px;
  width: 100%;
  background: linear-gradient(to right, var(--green-vivid), var(--gold-warm));
  flex-shrink: 0;
  transition: height 0.3s ease;
}

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

.event-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--parchment);
}

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

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

/* ── Inner padding wrapper ── */
.card.card-link h4,
.card.card-link p {
  padding-left: 28px;
  padding-right: 28px;
}

.card.card-link h4 {
  padding-top: 26px;
}

.card.card-link p:last-child {
  padding-bottom: 28px;
}

/* ── Hover lift ── */
.card.card-link:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(52, 160, 88, 0.25);
  text-decoration: none;
}

/* ── Event title ── */
.card.card-link h4 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.22;
  color: var(--green-deep);
  margin: 0 0 14px;
  transition: color 0.3s ease;
}

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

/* ── Date + venue line (first p) ── */
.card.card-link p:first-of-type {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Calendar icon before date */
.card.card-link p:first-of-type::before {
  content: '◷';
  font-size: 1rem;
  color: var(--green-vivid);
  font-style: normal;
  flex-shrink: 0;
}

/* ── Summary text (second p) ── */
.card.card-link p:nth-of-type(2) {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.70;
  margin: 0 0 0;
  font-weight: 300;
  flex: 1;
}

/* ── "View event" ghost link at bottom ── */
.card.card-link::after {
  content: 'View event →';
  display: block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green-mid);
  padding: 14px 28px 22px;
  transition: color 0.3s ease, padding-left 0.3s ease;
  letter-spacing: 0.02em;
}

.card.card-link:hover::after {
  color: var(--gold);
  padding-left: 36px;
}

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

/* ── Staggered card entrance (upcoming) ── */
.card-grid:first-of-type .card.card-link:nth-child(1) { animation: cardIn 0.7s cubic-bezier(0.22,1,0.36,1) 0.26s both; }
.card-grid:first-of-type .card.card-link:nth-child(2) { animation: cardIn 0.7s cubic-bezier(0.22,1,0.36,1) 0.34s both; }
.card-grid:first-of-type .card.card-link:nth-child(3) { animation: cardIn 0.7s cubic-bezier(0.22,1,0.36,1) 0.42s both; }
.card-grid:first-of-type .card.card-link:nth-child(4) { animation: cardIn 0.7s cubic-bezier(0.22,1,0.36,1) 0.50s both; }
.card-grid:first-of-type .card.card-link:nth-child(5) { animation: cardIn 0.7s cubic-bezier(0.22,1,0.36,1) 0.58s both; }
.card-grid:first-of-type .card.card-link:nth-child(6) { animation: cardIn 0.7s cubic-bezier(0.22,1,0.36,1) 0.66s both; }

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

/* ════════════════════════════════════════════
   PAST EVENTS — SEPARATE VISUAL TREATMENT
   Second .card-grid (past events)
════════════════════════════════════════════ */

/* Past cards are more compact + desaturated */
.card-grid:last-of-type .card.card-link {
  background: var(--parchment);
  border-color: rgba(27, 77, 48, 0.07);
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  min-height: auto;
}

.card-grid:last-of-type .event-card-image {
  width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
}

.card-grid:last-of-type .card.card-link p:nth-of-type(2) {
  display: block;
  padding: 0 24px 22px;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Remove top strip for past cards */
.card-grid:last-of-type .card.card-link::before {
  display: none;
}

/* Left accent bar instead */
.card-grid:last-of-type .card.card-link {
  border-left: 4px solid rgba(90, 90, 90, 0.18);
  transition: var(--transition);
}

.card-grid:last-of-type .card.card-link:hover {
  border-left-color: var(--gold-warm);
  transform: translateX(6px);
  box-shadow: var(--shadow);
}

/* Past card inner layout */
.card-grid:last-of-type .card.card-link h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
  padding: 20px 20px 20px 24px;
  margin: 0;
  flex: 1;
  line-height: 1.3;
}

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

/* Date on right side of past card */
.card-grid:last-of-type .card.card-link p:first-of-type {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  padding: 20px 22px 20px 12px;
  white-space: nowrap;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
}

/* Remove calendar icon from past cards */
.card-grid:last-of-type .card.card-link p:first-of-type::before {
  display: none;
}

/* Remove "View event" pseudo-link from past cards */
.card-grid:last-of-type .card.card-link::after {
  display: none;
}

/* Past card staggered entrance */
.card-grid:last-of-type .card.card-link:nth-child(1) { animation: cardInLeft 0.6s cubic-bezier(0.22,1,0.36,1) 0.30s both; }
.card-grid:last-of-type .card.card-link:nth-child(2) { animation: cardInLeft 0.6s cubic-bezier(0.22,1,0.36,1) 0.38s both; }
.card-grid:last-of-type .card.card-link:nth-child(3) { animation: cardInLeft 0.6s cubic-bezier(0.22,1,0.36,1) 0.46s both; }
.card-grid:last-of-type .card.card-link:nth-child(4) { animation: cardInLeft 0.6s cubic-bezier(0.22,1,0.36,1) 0.54s both; }
.card-grid:last-of-type .card.card-link:nth-child(5) { animation: cardInLeft 0.6s cubic-bezier(0.22,1,0.36,1) 0.62s both; }
.card-grid:last-of-type .card.card-link:nth-child(6) { animation: cardInLeft 0.6s cubic-bezier(0.22,1,0.36,1) 0.70s both; }

@keyframes cardInLeft {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0);     }
}

/* Past cards grid — 2 columns feels better for compact rows */
.card-grid:last-of-type {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

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

/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */
@media (max-width: 991.98px) {
  .section {
    padding: 80px 24px 100px;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .card-grid:last-of-type {
    grid-template-columns: 1fr;
  }
}

@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: 52px;
    padding-left: 16px;
    border-left-width: 3px;
  }

  .section > h2 {
    font-size: clamp(1.4rem, 6vw, 1.9rem);
    gap: 12px;
  }

  .section > h2::before {
    width: 28px;
    height: 28px;
  }

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

  .card-grid:last-of-type {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Stack past cards vertically on mobile */
  .card-grid:last-of-type .card.card-link {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-grid:last-of-type .event-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .card-grid:last-of-type .card.card-link p:first-of-type {
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 10px 24px 16px;
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .section > h2::after {
    display: none; /* hide pill tags on very small screens */
  }
}