/* ========================================
   EVENT PIECES SHARED BY /, /events/ AND /events/event/ — the gallery
   card, the RSVP count and attendee list, the Apply link and the scroll
   reveals. Loaded after /style.css.
   ======================================== */

.js .js-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.js-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Shared stagger: any lede/body that follows a heading into view waits
   the same beat behind it, everywhere this pattern is used. */
.js-reveal--lede {
  transition-delay: 120ms;
}

/* ---- Team, inline on the homepage ---- */

.team {
  background: var(--bg-0);
  border-top: 1px solid var(--line);
  padding: 12vh 6vw;
}

/* Cards deal in from a tilt, one after the other. Must sit after the base
   .js-reveal rules so it wins on equal specificity. */
.js .js-reveal--card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.js-reveal--card.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .js-reveal,
  .js .js-reveal--card {
    opacity: 1;
    transform: none;
    transition: none;
  }

}

.ev-rsvp__count-wrap {
  position: relative;
  display: block;
  margin-top: 0.5rem;
}

.ev-rsvp__count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-dim);
  cursor: pointer;
}

.ev-rsvp__attendees {
  display: none;
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Click to pin open */
.ev-rsvp__attendees.is-open {
  display: block;
}

.ev-rsvp__count:hover {
  text-decoration: underline;
}

.ev-rsvp__attendee {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: background 150ms;
}

a.ev-rsvp__attendee {
  cursor: pointer;
}

a.ev-rsvp__attendee:hover {
  background: var(--bg-2);
}

span.ev-rsvp__attendee {
  opacity: 0.65;
}

.ev-rsvp__attendee-avatar {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.ev-rsvp__attendee-avatar svg {
  width: 22px;
  height: 22px;
}

.ev-rsvp__attendee-name {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--ink);
}

.ev-rsvp__attendees-header {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  padding: 0.5rem 0.75rem 0.2rem;
}

.ev-rsvp__attendees-header:first-child {
  padding-top: 0.25rem;
}

.ev-rsvp__attendees-header--dim {
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  margin-top: 0.25rem;
  padding-top: 0.5rem;
}

/* Apply link — drops down once a user has registered interest */
.rsvp-apply {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  text-decoration: none;
  animation: rsvp-apply-drop 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.rsvp-apply svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

@keyframes rsvp-apply-drop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .rsvp-apply { animation: none; }
}

/* ---- Gallery card ---- */
.ev-gallery__card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color 250ms ease, box-shadow 250ms ease, transform 250ms ease;
}

.ev-gallery__card:hover {
  border-color: var(--teal-line);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.5),
              0 0 40px -16px rgba(69, 216, 197, 0.1);
  transform: translateY(-3px);
}

.ev-gallery__card:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

/* Stretched link: a card whose main link covers it while other links in it
   stay clickable (links can't nest). The card is position: relative; its
   main link gets .stretched-link, the other links .above-stretch. */
.stretched-link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.above-stretch {
  position: relative;
  z-index: 1;
}

/* Cover area */
.ev-gallery__cover {
  position: relative;
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-0) 60%, var(--bg-2) 100%);
  overflow: hidden;
}

.ev-gallery__cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(237, 238, 236, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

.ev-gallery__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.6) brightness(0.7);
  transition: filter 300ms ease;
}

.ev-gallery__card:hover .ev-gallery__cover img {
  filter: grayscale(0.3) brightness(0.85);
}

/* Gradient covers for events without images */
.ev-grad--0 { background: linear-gradient(135deg, rgba(69,216,197,0.15), rgba(45,156,219,0.15)) !important; }
.ev-grad--1 { background: linear-gradient(150deg, rgba(108,92,231,0.15), rgba(166,108,255,0.15)) !important; }
.ev-grad--2 { background: linear-gradient(120deg, rgba(255,107,157,0.15), rgba(255,107,107,0.15)) !important; }
.ev-grad--3 { background: linear-gradient(160deg, rgba(247,183,49,0.15), rgba(32,191,107,0.15)) !important; }
.ev-grad--4 { background: linear-gradient(140deg, rgba(58,175,185,0.15), rgba(108,92,231,0.15)) !important; }
.ev-grad--5 { background: linear-gradient(130deg, rgba(255,107,107,0.15), rgba(247,183,49,0.15)) !important; }
.ev-grad--6 { background: linear-gradient(170deg, rgba(32,191,107,0.15), rgba(58,175,185,0.15)) !important; }
.ev-grad--7 { background: linear-gradient(145deg, rgba(166,108,255,0.15), rgba(255,107,157,0.15)) !important; }

.ev-gallery__cover-text {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink);
  opacity: 0.1;
  pointer-events: none;
}

/* Card body */
.ev-gallery__body {
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ev-gallery__name {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.ev-gallery__date {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}

.ev-gallery__meta {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

.ev-gallery__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.ev-gallery__badges .ev-gallery__status {
  margin-top: 0;
}

.ev-gallery__status {
  display: inline-flex;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-top: 0.15rem;
}

.ev-gallery__status--open {
  color: var(--teal);
  background: var(--teal-dim);
  border: 1px solid var(--teal-line);
}

.ev-gallery__status--soon {
  color: #E8AE2A;
  background: rgba(232, 174, 42, 0.1);
  border: 1px solid rgba(232, 174, 42, 0.3);
}

@media (max-width: 600px) {

  .ev-gallery__cover {
    aspect-ratio: 3 / 2;
  }
}

@media (max-width: 375px) {
  .ev-gallery__body {
    padding: 0.9rem 1rem;
  }

  .ev-gallery__card {
    border-radius: 8px;
  }
}

/* ── Card-level tags: level + sector chips ── */
.ev-card-tags {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.ev-level {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ink-faint);
}

.ev-level--all { color: #A3E635; }

.ev-sectors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.ev-sector-chip {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* Sector chip colour variants (no inline styles — CSP safe) */
.ev-sector--ai_ml          { color: #5B9EFF; border: 1px solid rgba(91,158,255,0.3);  background: rgba(91,158,255,0.08); }
.ev-sector--web_dev        { color: #38BDF8; border: 1px solid rgba(56,189,248,0.3);  background: rgba(56,189,248,0.08); }
.ev-sector--cloud_devops   { color: #67C7EB; border: 1px solid rgba(103,199,235,0.3); background: rgba(103,199,235,0.08); }
.ev-sector--data_analytics { color: #6366F1; border: 1px solid rgba(99,102,241,0.3);  background: rgba(99,102,241,0.08); }
.ev-sector--cybersecurity  { color: #FF6B6B; border: 1px solid rgba(255,107,107,0.3);  background: rgba(255,107,107,0.08); }
.ev-sector--fintech        { color: #F7B731; border: 1px solid rgba(247,183,49,0.45);  background: rgba(247,183,49,0.14); }
.ev-sector--edtech         { color: #FB923C; border: 1px solid rgba(251,146,60,0.45);  background: rgba(251,146,60,0.14); }
.ev-sector--hardware_iot   { color: #DB7A0A; border: 1px solid rgba(219,122,10,0.45);  background: rgba(219,122,10,0.14); }
.ev-sector--gaming         { color: #F472B6; border: 1px solid rgba(244,114,182,0.45); background: rgba(244,114,182,0.14); }
.ev-sector--art_creative   { color: #E879F9; border: 1px solid rgba(232,121,249,0.45); background: rgba(232,121,249,0.14); }
.ev-sector--health_medtech { color: #34D399; border: 1px solid transparent; background: rgba(52,211,153,0.13); }
.ev-sector--sustainability { color: #6EE752; border: 1px solid transparent; background: rgba(110,231,82,0.13); }
.ev-sector--civic_social   { color: #D4D4D4; border: 1px solid transparent; background: rgba(212,212,212,0.13); }
.ev-sector--mobile_app     { color: #C084FC; border: 1px solid transparent; background: rgba(192,132,252,0.13); }

/* Attendee avatar stack on cards */
.ev-attendees {
  display: flex;
  align-items: center;
  margin-top: 0.35rem;
}

.ev-attendees__stack {
  display: flex;
  flex-direction: row-reverse;
}

.ev-attendees__circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--bg-1);
  background: var(--bg-2);
  margin-left: -12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.ev-attendees__circle:last-child {
  margin-left: 0;
}

.ev-attendees__circle svg {
  width: 20px;
  height: 20px;
}

.ev-attendees__overflow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--bg-1);
  background: var(--bg-2);
  margin-left: -12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--ink-dim);
}
