/* /crews/ shared styles — directory + create + detail. Mirrors the
   /events/ visual rhythm (page-header + card list) so the two
   community pages feel like siblings. */

.crews-page,
.crew-detail {
  max-width: 880px;
  margin: 0 auto;
}

/* Create form sits in a narrower column than the directory/detail
   lists — matches the .event-detail wrapper used by /events/create/
   so the two create pages line up visually. */
.crew-create {
  max-width: 760px;
  margin: 0 auto;
}

.crews-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Visual parity with /events/ event-card: shared dark panel, lift on
   hover, head row (title left, region wraps to a second line if the
   name is long), shared .stats divider for the metadata grid, owner
   footer pinned to the bottom. */
.crew-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 120ms ease, transform 120ms ease;
}

.crew-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.crew-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.crew-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
}

.crew-card-head h2 {
  font-size: 17px;
  margin: 0;
  line-height: 1.3;
  /* Match .event-card-head h2: stay at the title's natural width until
     it needs to wrap, at which point the region drops to a new line. */
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
}

.crew-card-region {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.crew-card-description {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: anywhere;
  /* Cap at ~3 lines so a long bio doesn't unbalance the grid; the
     full text is on the detail page. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.crew-card-owner {
  font-size: 12px;
  margin-top: auto;
  align-self: flex-start;
}

/* Narrow phones: collapse the 2-column stats grid to a single column
   so labels don't crowd the values, and let the region wrap. Mirrors
   the event-card breakpoint. */
@media (max-width: 480px) {
  .crew-card .stats {
    grid-template-columns: 1fr;
  }
  .crew-card-region {
    white-space: normal;
  }
}

/* Edge-to-edge stacked cards on phones, mirroring /events/. Cards lose
   side borders + radius + gap, the doubled inner border collapses, the
   hover-lift is suppressed (it hid the previous card's bottom edge),
   and even-indexed cards take the lighter --panel-2 shade so each crew
   reads as a clear band while scrolling. */
@media (max-width: 700px) {
  .crews-list {
    grid-template-columns: 1fr;
    gap: 0;
    margin-left: -16px;
    margin-right: -16px;
  }
  .crews-list .crew-card {
    border-left: none;
    border-right: none;
    border-radius: 0;
  }
  .crews-list .crew-card + .crew-card {
    border-top: none;
  }
  .crews-list .crew-card:hover {
    transform: none;
  }
  .crews-list .crew-card:nth-child(even) {
    background: var(--panel-2);
  }
}

.crews-empty {
  padding: 32px 16px;
  text-align: center;
}
.crews-empty p {
  margin: 0 0 8px;
}

.crews-loadmore {
  margin-top: 16px;
  text-align: center;
}

/* "Only crews I'm in" toggle inside the crews filter panel. Sits as
   its own row in the filters grid; the inline checkbox keeps the
   widget compact next to the region checklist. */
.crews-mine-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.crews-mine-filter input[type="checkbox"] {
  margin: 0;
}

/* --- Detail (used by /crews/crew/) --- */

.crew-detail-header {
  margin-bottom: 16px;
}
.crew-detail-header h1 {
  margin: 0 0 4px;
}
.crew-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}
.crew-detail-description {
  margin: 12px 0 16px;
  font-size: 1rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.crew-detail-cta-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
/* Buttons in the CTA row use .cta-btn for shared chrome (see
   /styles.css). The variants below provide muted + destructive
   flavors for the secondary actions (leave / cancel / delete); they
   share the borderless cta-btn shape so the cluster reads as one
   uniform set of pills. */
.cta-btn.cta-btn-ghost {
  background: var(--panel-2);
  color: var(--text);
}
.cta-btn.cta-btn-ghost:hover {
  background: var(--border);
}
.cta-btn.cta-btn-danger {
  background: var(--bad, #c44);
  color: #fff;
}
.cta-btn.cta-btn-danger:hover {
  background: var(--bad-dim, #a33);
}

.crew-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}
.crew-tab {
  background: none;
  border: none;
  padding: 8px 14px;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.crew-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.crew-tab-panel {
  min-height: 120px;
}

/* Members + events + leaderboard share the /top/ leaderboard-table
   chrome — see top/styles.css; the only crew-specific addition is the
   Owner/Member role badge below. */
/* Eject button on owner-viewed member rows. Compact, muted by default
   so the destructive action doesn't shout from every row; hover paints
   it in the warning color so the consequence is obvious before click. */
.crew-eject-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: pointer;
}
.crew-eject-btn:hover {
  background: var(--bad, #c44);
  color: #fff;
  border-color: var(--bad, #c44);
}

.crew-role-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Requests tab still uses its own row layout — approve/deny is a
   purpose-built control surface, not a leaderboard. */
.crew-requests-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.crew-request-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.crew-request-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.crew-request-message {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.crew-request-actions {
  display: flex;
  gap: 6px;
}
/* Approve/deny inside the requests list use the shared .cta-btn
   chrome (primary accent + ghost) but at a smaller scale so they sit
   within the row without dominating it. */
.crew-request-actions .cta-btn {
  padding: 6px 14px;
  font-size: 13px;
}
