/* ═══════════════════════════════════════════════════════════════════════════
   event-card.css — styles for THE event card (/assets/event-card.js).
   Used by /events/ and /tour/. Moved here verbatim from /events/; the only
   addition is the button block at the bottom, scoped to the card so the card
   looks the same on pages whose own .btn is styled differently (/tour/).
   Relies on the page defining the usual palette vars (--surface, --cyan, …).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Event Cards ── */
.events-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.event-card.upcoming {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.12);
}

.event-card.upcoming .event-card-date {
  color: var(--gold);
}

.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.event-card:hover {
  border-color: var(--border-bright);
  transform: translate3d(0, -4px, 0);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Upcoming: banner in a square cell; blurred copy fills the letterbox for non-square art */
/* The cell follows the artwork's own shape. It used to be hard-locked
   square (padding-top:100%), which suited 1080x1080 Luma posters but
   letterboxed a wide banner — a 1200x630 tour graphic filled barely half
   the height and left a blurred bar top and bottom. --gr is set from the
   image's real aspect once it loads; square stays the fallback. */
.event-card.upcoming .event-card-graphic-cell {
  position: relative; width: 100%;
  /* Default to the house 1200x630 card ratio, not a square. The true
     aspect only arrives once a probe image has loaded, and starting
     square made every wide banner visibly jump on load. */
  aspect-ratio: var(--gr, 1200 / 630);
  overflow: hidden;
  /* A placeholder so the cell reads as "loading", not "broken", before
     the artwork paints. */
  background: linear-gradient(135deg, #0d2136, #0a1526 60%, #0c1120);
}
.event-card.upcoming .event-card-graphic-cell::before,
.event-card.upcoming .event-card-graphic-cell::after {
  opacity: 0; transition: opacity .45s ease;
}
.event-card.upcoming .event-card-graphic-cell.is-loaded::before,
.event-card.upcoming .event-card-graphic-cell.is-loaded::after { opacity: 1; }
/* faint sweep while waiting */
.event-card.upcoming .event-card-graphic-cell:not(.is-loaded) {
  background-image:
    linear-gradient(100deg, transparent 20%, rgba(56,189,248,.10) 42%, transparent 64%),
    linear-gradient(135deg, #0d2136, #0a1526 60%, #0c1120);
  background-size: 220% 100%, 100% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .event-card.upcoming .event-card-graphic-cell:not(.is-loaded) {
    animation: cardShimmer 1.5s ease-in-out infinite;
  }
  @keyframes cardShimmer {
    0%   { background-position: 130% 0, 0 0; }
    100% { background-position: -30% 0, 0 0; }
  }
}
.event-card.upcoming .event-card-graphic-cell::before {
  content: ''; position: absolute; inset: 0; background-image: var(--g); background-size: cover; background-position: center;
  filter: blur(26px) saturate(1.35) brightness(.6); transform: scale(1.3); z-index: 0;
}
.event-card.upcoming .event-card-graphic-cell::after {
  content: ''; position: absolute; inset: 0; background-image: var(--g); background-size: contain; background-repeat: no-repeat; background-position: center; z-index: 1;
}

/* Past: horizontal layout — graphic left, content right */
.event-card.past {
  display: grid;
  grid-template-columns: 200px 1fr;
}

.event-card.past .event-card-graphic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 200px;
}

/* Past with photos: graphic + photo strip on top, content below */
.event-card.past-with-photos {
  display: block;
}

.event-card-images {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 0;
  height: 360px;
  user-select: none;
  -webkit-user-select: none;
}

/* Luma square graphic — show fully */
.event-card-images img:first-child {
  width: 360px;
  height: 360px;
  object-fit: cover;
}

/* Event photo — landscape crop to fill remaining space */
.event-card-images img:last-child {
  width: 100%;
  height: 360px;
  object-fit: cover;
}

/* No-photo variant — single banner shown WHOLE, blurred copy fills the letterbox */
.event-card-images.no-photo {
  grid-template-columns: 1fr;
  position: relative;
  overflow: hidden;
  background: var(--surface, #0c1120);
}

.event-card-images.no-photo img:first-child {
  width: 100%;
  height: 360px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.event-card-images.no-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--amb);
  background-size: cover;
  background-position: center;
  filter: blur(26px) saturate(1.35) brightness(.55);
  transform: scale(1.3) translateZ(0);
  z-index: 0;
}

.event-card-body {
  padding: 28px 32px;
}

.event-card-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(16px, 3.2vw, 19px);
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
  line-height: 1.25;
}
/* the clock time rides along at label size — the DATE is what people scan for */
.event-card-date .t {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-left: 7px;
  white-space: nowrap;
}

.event-card-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.3;
}

.event-card-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.event-card-title a:hover {
  color: var(--cyan);
}

.draft-badge { display:inline-block; vertical-align:middle; margin-left:8px; font-family:'JetBrains Mono',monospace; font-size:10px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; color:#fca5a5; border:1px solid rgba(248,113,113,.5); background:rgba(248,113,113,.1); border-radius:6px; padding:2px 7px; }
.event-card.is-draft { border-style:dashed; border-color:rgba(248,113,113,.45); }

/* --- Branded card: an event that brings its own identity ---
   Mirrors the homepage (see public/index.html, .event-card.has-brand) and
   is keyed off the same feed signal: an event that ships a `heroLogo` has
   a look of its own, so nothing is hardcoded to one event.
   Values come from that event's own site — for AI Ultra, the light theme
   on aiultrafestival.com. Keep the two copies in step. */
.event-card.has-brand {
  background: linear-gradient(180deg, #f3f0fe 0%, #e7e1fb 100%);
  border-color: rgba(122,110,205,.35);
  box-shadow: 0 20px 44px -22px rgba(55,35,130,.55);
}
.event-card.has-brand:hover {
  border-color: rgba(88,72,180,.55);
  box-shadow: 0 26px 54px -22px rgba(55,35,130,.6);
}
/* The art dissolves into the card body the way the hero scrim dissolves
   the photo — a mask, because the cell paints its art in ::before/::after
   and an overlay would have to fight them for stacking order. */
.event-card.has-brand .event-card-graphic-cell {
  -webkit-mask-image: linear-gradient(180deg, #000 58%, rgba(0,0,0,.35) 88%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 58%, rgba(0,0,0,.35) 88%, transparent 100%);
  filter: saturate(.86) brightness(1.07) contrast(.94);
}
.event-card.has-brand .event-chapter-chip {
  color: #3b34d6; background: rgba(255,255,255,.82);
  border-color: rgba(122,110,205,.35); backdrop-filter: blur(8px);
}
.event-card.has-brand .event-card-date { color: #3b34d6; }
.event-card.has-brand .event-card-date .t { color: #403b6b; }
.event-card.has-brand .event-card-title,
.event-card.has-brand .event-card-title a { color: #0f0b26; }
.event-card.has-brand .event-card-title a:hover { color: #3b34d6; }
.event-card.has-brand .event-card-summary { color: #403b6b; }
.event-card.has-brand .event-stat {
  color: #0f0b26; background: rgba(255,255,255,.72);
  border: 1px solid rgba(122,110,205,.35); border-radius: 100px; padding: 7px 14px;
}
.event-card.has-brand .event-stat strong { color: #3b34d6; }
.event-card.has-brand .btn-primary {
  background: linear-gradient(100deg, #6d28d9, #c026a3, #2a49d8);
  background-size: 200% 100%; color: #fff;
}
/* Gold "upcoming" ring is a dark-theme cue and goes muddy on lavender. */
.event-card.upcoming.has-brand {
  border-color: rgba(122,110,205,.35);
  box-shadow: 0 20px 44px -22px rgba(55,35,130,.55);
}

.event-card-summary {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.event-card-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.event-stat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-stat strong {
  color: var(--cyan);
  font-size: 14px;
}

.event-card-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s;
}

.event-card-link:hover {
  gap: 10px;
}

@media (max-width: 768px) {
  .event-card.past {
    grid-template-columns: 1fr;
  }

  .event-card.past .event-card-graphic {
    height: 200px;
    min-height: unset;
  }

  .event-card-images {
    grid-template-columns: 140px 1fr;
    height: 140px;
  }

  .event-card-images img:first-child {
    width: 140px;
    height: 140px;
  }

  .event-card-images img:last-child {
    height: 140px;
  }

  .event-card-images.no-photo {
    grid-template-columns: 1fr;
  }

  .event-card-images.no-photo img:first-child {
    width: 100%;
    height: 140px;
  }

  .event-card-body {
    padding: 24px;
  }
}

/* ── Tag colors ── */
.tag-casual    { --tag-color: #22d3ee; }
.tag-signature { --tag-color: #fbbf24; }
.tag-activity  { --tag-color: #3b82f6; }
.tag-co-hosted { --tag-color: #60a5fa; }

/* ── Event tag chips ── */
.event-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.event-tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--tag-color);
  background: rgba(0,0,0,0);
  border: 1px solid color-mix(in srgb, var(--tag-color) 25%, transparent);
  background: color-mix(in srgb, var(--tag-color) 12%, transparent);
}
.event-tag:hover { background: color-mix(in srgb, var(--tag-color) 22%, transparent); }

.event-card { transition: opacity 0.3s ease, transform 0.3s ease; position: relative; }
.event-chapter-chip {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--cyan, #22d3ee); background: rgba(6, 8, 15, 0.78);
  border: 1px solid var(--border-bright, rgba(56, 189, 248, 0.3));
  border-radius: 999px; padding: 4px 11px; backdrop-filter: blur(4px);
}

/* ── Buttons inside the card ──
   Same values as /events/' own .btn, scoped so a page with a different house
   button (/tour/ uses uppercase mono) still gets the card's buttons. The resets
   undo what such a page sets and /events/ doesn't. */
.event-card .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  box-shadow: none;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}
.event-card .btn-primary {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--blue) 100%);
  color: #000;
}
.event-card .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.3);
}
.event-card .btn-ghost {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--border-bright);
}
.event-card .btn-ghost:hover {
  background: rgba(34, 211, 238, 0.08);
  transform: translateY(-2px);
  box-shadow: none;
}
