/* ============================================================================
   Shared page shell + event-card system.

   Used by /events and /coaching so both listing pages read as one product.
   Load this BEFORE a page's own <style> block; page-specific rules win.
   ========================================================================= */

:root {
  --bg: #020617;
  --card-bg: #020617;
  --primary: #0ea5e9; /* teal/blue */
  --accent: #f97316;  /* orange */
  --accent-soft: rgba(249, 115, 22, 0.12);
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --border: #1f2937;
  --border-subtle: rgba(148, 163, 184, 0.3);
  --error: #f97373;
}

/* ---------- Page shell ---------- */

.page-shell {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 16px 16px 60px;
}

.page-content {
  width: 100%;
  max-width: 960px;
}

.shell {
  width: 100%;
}

.page-card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.9);
  padding: 22px 20px 22px;
  backdrop-filter: blur(18px);
}

@media (min-width: 640px) {
  .page-card {
    padding: 26px 26px 26px;
  }
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

@media (min-width: 720px) {
  .page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.9);
  object-fit: cover;
}

.brand-text h1 {
  margin: 0;
  font-size: 22px;
}

.brand-text .tagline {
  margin: 2px 0 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #64748b;
}

.page-meta {
  text-align: left;
  font-size: 13px;
  color: var(--text-muted);
}

@media (min-width: 720px) {
  .page-meta {
    text-align: right;
  }
}

.pill {
  display: inline-block;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: #cbd5f5;
  background: rgba(15, 23, 42, 0.9);
  margin-bottom: 6px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.top-links {
  margin-top: 10px;
  font-size: 11px;
  color: #9ca3af;
}

.top-links a {
  color: #7dd3fc;
  text-decoration: none;
}

.top-links a:hover {
  text-decoration: underline;
}

/* ---------- Card grid ---------- */

.events-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 10px;
}

@media (min-width: 640px) {
  .events-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Opt-in: a lone card in a two-up grid leaves half the row empty, which reads
   as "something failed to load" rather than "short calendar". Centre it. */
.events-grid.is-single {
  grid-template-columns: min(100%, 460px);
  justify-content: center;
}

.event-card {
  background: rgba(15, 23, 42, 0.98);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  padding: 16px 14px 14px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.8);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.event-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 55%);
  opacity: 0.6;
}

.event-card-inner {
  position: relative;
  z-index: 1;
}

/* DUPR match cards: a cyan outline so they read as their own thing next to
   open play. Deliberately no halo, no gradient fill, no size change — the
   featured card keeps every one of those to itself. Cyan matches the DUPR
   rating guide's accent elsewhere on the site. */
/* box-sizing: border-box keeps the outer edge put, so a 2px border here still
   lines up with the 1px cards beside it in the grid. */
.event-card-dupr {
  border-width: 2px;
  border-color: rgba(34, 211, 238, 0.72);
  box-shadow:
    0 10px 26px rgba(15, 23, 42, 0.8),
    0 0 0 1px rgba(34, 211, 238, 0.2);
}

.event-card-dupr::before {
  background: radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 55%);
}

.event-card-featured {
  grid-column: 1 / -1;
  order: -1;
  border-color: rgba(249, 115, 22, 0.78);
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.13), rgba(14, 165, 233, 0.08) 55%, rgba(15, 23, 42, 0.98)),
    rgba(15, 23, 42, 0.98);
  box-shadow:
    0 0 0 1px rgba(249, 115, 22, 0.12),
    0 18px 44px rgba(2, 6, 23, 0.9),
    0 0 34px rgba(249, 115, 22, 0.12);
}

.event-card-featured::before {
  background:
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.3), transparent 48%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.2), transparent 48%);
  opacity: 1;
}

.event-featured-badge {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 12px;
  padding: 6px 11px;
  border: 1px solid rgba(251, 146, 60, 0.8);
  border-radius: 999px;
  background: rgba(124, 45, 18, 0.92);
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.55);
  color: #ffedd5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.event-card-featured .event-title {
  color: #fff7ed;
}

.event-card-featured .btn {
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: #fff;
  box-shadow: 0 8px 22px rgba(249, 115, 22, 0.24);
}

.event-card-thumb {
  /* bleeds past the card's 16px top / 14px side padding to fill edge-to-edge */
  width: calc(100% + 28px);
  margin: -16px -14px 0 -14px;
  height: 160px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
  display: block;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.event-card:hover .event-card-thumb {
  opacity: 0.9;
}

/* ---------- Card contents ---------- */

.event-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.event-title {
  font-size: 18px;
  font-weight: 700;
}

.event-chip {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 233, 0.6);
  color: #7dd3fc;
  background: rgba(15, 23, 42, 0.95);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

/* FREE EVENT */
.event-chip.free {
  border: 1px solid rgba(125, 211, 252, 0.35);
  color: #7dd3fc;
  background: rgba(125, 211, 252, 0.08);
}

/* PAID EVENT */
.event-chip.paid {
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  font-weight: 600;
}

.event-date {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.event-details {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  min-height: 2.5em;
}

.event-location {
  margin-top: 2px;
  font-size: 13px;
  color: #cbd5f5;
  line-height: 1.4;
}

.event-topic {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
}

.metrics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
}

.price-tag {
  font-weight: 600;
  font-size: 14px;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 4px;
}

.spots-tag {
  font-size: 13px;
  color: #a5b4fc;
}

.spots-tag.full {
  color: #fecaca;
}

.spots-tag.low {
  color: #fdba74;
  font-weight: 700;
}

/* Compact info chips (price deadline, min players) — one shared row */
.card-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.price-deadline,
.min-note {
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 9px;
  line-height: 1.4;
  white-space: nowrap;
}

.price-deadline {
  color: #fdba74;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.min-note {
  color: #fcd34d;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.28);
}

.badge-full {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.65);
  color: #fecaca;
}

.event-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

/* ---------- Buttons + status ---------- */

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--accent);
  color: #111827;
  box-shadow: 0 10px 22px rgba(249, 115, 22, 0.55);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: #ea580c;
  box-shadow: 0 14px 30px rgba(249, 115, 22, 0.75);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.7);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
  transform: none;
  background: #4b5563;
  color: #e5e7eb;
}

.status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  min-height: 16px;
}

.status.error {
  color: var(--error);
}

.status.info {
  color: var(--text-muted);
}

.empty-state {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
