/* ============================================================
   card.css — org card for the browse grid.
   Category-colored left rail. Whole card is a click target.
   Ghost variant (dashed border, no content) for filtered-out slots.
   ============================================================ */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 220ms, border-color 220ms;
  text-align: left;
  min-height: 280px;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* --- Badges: start-up status and/or the org's own note ("Recruiting
       now"). They sit top-right but IN FLOW, not absolutely positioned:
       a floated badge printed itself over the first line of any card
       title long enough to reach the corner, and both the badge text
       and the org names are variable-width, so no fixed inset could be
       trusted. In flow they reserve their own row and wrap when two of
       them (start-up + featured) do not fit side by side. --- */
.card__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-self: stretch;
  gap: var(--space-1);
  margin-bottom: calc(var(--space-2) * -1);
}
.card__badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--card-accent-ink, var(--ink));
  background: var(--card-accent-soft, var(--surface));
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--border)) 35%, transparent);
  white-space: nowrap;
}
/* Start-up status is not a cluster, so it takes the --startup-* accent
   rather than the card's category colour, and keeps a visible border the
   cluster tags do not have — it never reads as a twelfth cluster. */
.card__badge--startup {
  color: var(--startup-ink);
  background: var(--startup-soft);
  border-color: color-mix(in srgb, var(--startup-edge) 45%, transparent);
}

/* --- Category-colored left rail (accent) --- */
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--card-accent, var(--muted));
}

/* --- Head row: emblem tile + name + tag row --- */
.card__head {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.card__emblem {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--card-accent-soft, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--border)) 25%, transparent);
  display: grid; place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}
/* Roster logo, when the source document had one */
.card__logo {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* Fallback for orgs listed without a logo */
.card__initials {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--card-accent-ink, var(--ink));
}
.card__headtext { min-width: 0; }
.card__short {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.card__title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Contact-address fallback line reads as data, not prose */
.card__desc--contact {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  word-break: break-all;
  -webkit-line-clamp: 2;
}

.card__body {
  flex: 1;
}
.card__desc {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.card__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card__meta svg { flex: 0 0 auto; color: #1877F2; }
.card__meta--muted { color: var(--muted); font-style: italic; }
.card__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
  transition: background 160ms;
}
.card:hover .card__cta { background: var(--sun-soft); }

/* --- Ghost / dashed placeholder for filtered-out orgs --- */
.card--ghost {
  cursor: default;
  border-style: dashed;
  border-color: var(--border);
  background: transparent;
  opacity: 0.25;
  pointer-events: none;
  min-height: 280px;
}
.card--ghost:hover { transform: none; box-shadow: none; }
.card--ghost::before { display: none; }

/* ============================================================
   EVENT AND GAME VARIANTS
   Added for the Events tab and the Xavier Cup. Everything above
   is untouched: these cards are the same object with a different
   emblem and one extra row, so the three grids read as one system.
   ============================================================ */

/* --- The "when" row: sits between the head and the tags --- */
.card__when {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.3;
}
.card__when svg {
  width: 14px; height: 14px;
  flex: 0 0 auto;
  color: var(--card-accent, var(--muted));
}
.card__when > span:not(.card__when-rel) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card__when-rel {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--card-accent-soft, var(--surface-2));
  color: var(--card-accent-ink, var(--ink-2));
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* --- Emblem as a calendar date (events) --- */
.card__emblem--date {
  flex-direction: column;
  gap: 0;
  line-height: 1;
  background: var(--card-accent, var(--muted));
  border-color: transparent;
  color: #fff;
}
.date-tile__month {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0.92;
}
.date-tile__day {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.date-tile__year {
  font-size: 9px;
  font-weight: 700;
  opacity: 0.8;
}

/* --- Emblem as a sport glyph (the Cup) --- */
.card__emblem--sport {
  color: var(--card-accent-ink, var(--ink));
}
.sport-glyph { width: 28px; height: 28px; }

/* --- Host logo, spotlight cards only --- */
.event-card__hostlogo {
  width: 40px; height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex: 0 0 auto;
  align-self: center;
}

.card__desc--muted { color: var(--muted); font-style: italic; }

/* --- Scoreline (finished fixtures) --- */
.score {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}
.score__side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.score__side:last-of-type { text-align: right; align-items: flex-end; }
.score__team {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.score__value {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 800;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.score__side.is-winner .score__value { color: var(--card-accent-ink, var(--ink)); }
.score__side.is-winner .score__team { color: var(--ink-2); font-weight: 700; }
.score__sep { color: var(--border-strong); font-size: 18px; }

/* --- Spotlight: the featured treatment.
       Same card, given the full row on a wide screen so the copy
       has somewhere to go. Collapses back to a normal card as soon
       as the grid runs out of width. --- */
@media (min-width: 900px) {
  .card--spotlight {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-4) var(--space-6);
    min-height: 0;
    padding: var(--space-6);
  }
  .card--spotlight .card__head { flex: 1 1 320px; align-items: center; }
  .card--spotlight .card__emblem { width: 64px; height: 64px; }
  .card--spotlight .date-tile__day { font-size: 26px; }
  .card--spotlight .card__title { font-size: 20px; -webkit-line-clamp: 2; }
  .card--spotlight .card__when { flex: 1 1 260px; }
  .card--spotlight .card__tags { flex: 0 0 auto; align-self: center; }
  .card--spotlight .card__body { flex: 1 1 100%; }
  .card--spotlight .card__desc { -webkit-line-clamp: 2; font-size: 14px; }
  .card--spotlight .card__foot { flex: 1 1 100%; }
  .card--spotlight .card__badges {
    position: absolute;
    top: var(--space-4); right: var(--space-5);
    margin: 0;
  }
}
