/* ── Event Hub: Phase 1 visual foundation ─────────────────────────────────── */
/* Redesign branch — safe to remove entirely to revert                         */

/* ── Hero Banner ── */
.hub-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  padding: 2.5rem 0 2rem;
}
.hub-hero-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}
.hub-hero h1 {
  font-weight: 800;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.hub-hero-badges {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.hub-hero-meta {
  color: rgba(255,255,255,.7);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.hub-hero-meta a {
  color: rgba(255,255,255,.85);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,.3);
}
.hub-hero-meta a:hover {
  color: #fff;
  text-decoration-color: rgba(255,255,255,.6);
}
.hub-hero.crown-event { border-bottom: 3px solid #ffc107; }

/* Org-tinted hero backgrounds */
.hub-hero.org-bad { background: linear-gradient(135deg, #1a1a2e 0%, #2a1f00 50%, #3d2b00 100%); }
.hub-hero.org-srs { background: linear-gradient(135deg, #1a1a2e 0%, #2e1218 50%, #3d1520 100%); }

/* Hero with background image */
.hub-hero.hub-hero-with-image {
  background-size: cover;
  background-position: center;
  padding: 3rem 0 2.5rem;
}

/* ── Sub-navigation (sticky tab bar) ── */
.hub-subnav-wrap {
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  position: sticky;
  top: 0;
  z-index: 40;
}
@media (max-width: 767.98px) {
  .hub-subnav-wrap { position: relative; }
  .hub-subnav-wrap::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 32px;
    background: linear-gradient(to right, transparent, #fff);
    pointer-events: none;
    z-index: 2;
  }
}
.hub-subnav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hub-subnav::-webkit-scrollbar { display: none; }
.hub-subnav .nav-item { flex-shrink: 0; }
.hub-subnav .nav-link {
  font-weight: 600;
  color: #495057;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 0.75rem 1.25rem;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  font-size: 0.95rem;
}
.hub-subnav .nav-link:hover { color: var(--sdh-primary); }
.hub-subnav .nav-link.active {
  color: var(--sdh-primary);
  border-bottom-color: var(--sdh-primary);
}

/* ── Tab Panes ── */
.hub-pane { display: none; }
.hub-pane.active { display: block; }

/* ── Section Headers (org-aware accent) ── */
.hub-section-header {
  font-weight: 700;
  font-size: 1.25rem;
  color: #1a1a2e;
  border-bottom: 3px solid var(--sdh-primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}
[data-org="bad"] .hub-section-header { border-bottom-color: #ffc107; }
[data-org="srs"] .hub-section-header { border-bottom-color: #dc3545; }

/* ── Quick Stats Row ── */
.hub-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}
.hub-stat {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  padding: 1.15rem 0.75rem;
  text-align: center;
}
.hub-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--sdh-primary);
  line-height: 1.2;
}
.hub-stat-value.green { color: #198754; }
.hub-stat-value.gold  { color: #e0a800; }
.hub-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  margin-top: 0.15rem;
}

/* ── Link Cards (scoring/results tab placeholders) ── */
.hub-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.hub-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  border: 2px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.hub-link-card:hover {
  border-color: var(--sdh-primary);
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.hub-link-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.hub-link-title { font-weight: 700; font-size: 1.05rem; }
.hub-link-desc { font-size: 0.82rem; color: #6c757d; margin-top: 0.25rem; }

/* ── Hub Info Box ── */
.hub-info-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
}

/* ── Run Selector Pills ── */
.hub-run-pills {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}
.hub-run-pills::-webkit-scrollbar { display: none; }
.hub-run-pills .nav-link {
  font-weight: 600;
  color: #495057;
  border-radius: 8px;
  padding: 0.45rem 1rem;
  white-space: nowrap;
  background: transparent;
  border: 2px solid #dee2e6;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.9rem;
}
.hub-run-pills .nav-link:hover { border-color: var(--sdh-primary); color: var(--sdh-primary); }
.hub-run-pills .nav-link.active { background: var(--sdh-primary); color: #fff; border-color: var(--sdh-primary); }
.hub-run-pills .nav-link.locked { opacity: 0.6; }
.hub-run-pills .nav-link.locked::after { content: ' \1F512'; font-size: 0.7rem; }

/* ── Inline Scoreboard Table — Schematic ── */
.hub-score-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-family: 'Inter Tight', -apple-system, system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.45;
  font-feature-settings: "ss01", "cv11", "tnum";
  border-top: 1px solid #0a0a0a;
  border-bottom: 1px solid #0a0a0a;
  color: #0a0a0a;
}
.hub-score-table th {
  background: #fff;
  color: #6b7280;
  padding: 8px 12px 7px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-align: left;
  border-bottom: 1px solid #0a0a0a;
  border-radius: 0;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 1px 0 #0a0a0a;
}
.hub-score-table th:first-child,
.hub-score-table th:last-child { border-radius: 0; }
.hub-score-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(10,10,10,.07);
  font-size: 12px;
  vertical-align: baseline;
}
.hub-score-table tbody tr:last-child td { border-bottom: none; }
.hub-score-table tr:hover td { background: #fafafa; }
.hub-score-table .rank-cell {
  font-weight: 500;
  font-size: 11px;
  color: #9ca3af;
  text-align: left;
  width: 34px;
  font-variant-numeric: tabular-nums;
}
.hub-score-table .score-cell {
  font-family: 'Inter Tight', -apple-system, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  text-align: right;
  color: #0a0a0a;
}
.hub-score-table .best-cell {
  font-family: 'Inter Tight', -apple-system, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12px;
  text-align: right;
  color: #0a0a0a;
}
.hub-score-table .nj-cell {
  color: #b91c1c;
  font-size: 9.5px;
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.hub-score-table th.th-right { text-align: right; }
.hub-score-table .dog-name { font-weight: 500; color: #0a0a0a; text-align: left; }
.hub-score-table .handler-cell { color: #6b7280; font-size: 12px; text-align: left; }
.hub-score-table .unscored td { color: #9ca3af; }
.hub-score-table .unscored .dog-name { font-weight: 400; }

/* ── Score Progress Bar ── */
.hub-score-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}
.hub-score-progress .progress {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: #e9ecef;
}
.hub-score-progress .progress-bar {
  border-radius: 4px;
  transition: width 0.5s ease;
}
.hub-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #198754;
  animation: hubPulse 2s infinite;
  flex-shrink: 0;
}
@keyframes hubPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── Inline Results ── */
.hub-results-disc {
  margin-bottom: 1.5rem;
}
.hub-results-disc-header {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-left: 5px solid #198754;
  background: #f8f9fa;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 0 8px 8px 0;
  transition: background 0.15s;
}
.hub-results-disc-header:hover { background: #e9ecef; }
.hub-results-disc-header .chevron { transition: transform 0.2s; }
.hub-results-disc-header.collapsed .chevron { transform: rotate(-90deg); }
.hub-results-disc-header.pending { border-left-color: #6c757d; opacity: 0.7; }
.hub-results-group {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}
.hub-results-group-header {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #dee2e6;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hub-results-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter Tight', -apple-system, system-ui, sans-serif;
  font-size: 12px;
  font-feature-settings: "ss01", "cv11", "tnum";
  border-top: 1px solid #0a0a0a;
  border-bottom: 1px solid #0a0a0a;
  color: #0a0a0a;
}
.hub-results-table th {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #6b7280;
  padding: 8px 12px 7px;
  border-bottom: 1px solid #0a0a0a;
  background: transparent;
  text-align: left;
}
.hub-results-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(10,10,10,.07);
  vertical-align: baseline;
}
.hub-results-table tbody tr:last-child td { border-bottom: none; }
.hub-results-table .rank-cell {
  font-weight: 500;
  text-align: left;
  width: 34px;
  font-size: 11px;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}
.hub-results-table .dog-cell { font-weight: 500; color: #0a0a0a; }
.hub-results-table .handler-cell { color: #6b7280; }
.hub-results-table .score-cell {
  font-family: 'Inter Tight', -apple-system, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}
/* Podium: medal color on the rank only — no row fill */
.hub-results-table tr.podium-1,
.hub-results-table tr.podium-2,
.hub-results-table tr.podium-3 { background: transparent; }
.hub-results-table tr.podium-1 .rank-cell { color: #b8860b; font-weight: 700; }
.hub-results-table tr.podium-2 .rank-cell { color: #6b7280; font-weight: 700; }
.hub-results-table tr.podium-3 .rank-cell { color: #a0522d; font-weight: 700; }

/* Floating group cards (BAD payouts) */
.hub-float-group {
  border: 1px solid #dee2e6;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.hub-float-group-header {
  padding: 0.6rem 0.85rem;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hub-float-group table { width: 100%; }
.hub-float-group td { padding: 0.4rem 0.75rem; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.hub-float-group tr.winner-row { background: #d4edda; }

/* ── Scoring toolbar ── */
.hub-scoring-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hub-hero h1 { font-size: 1.25rem; margin-bottom: 0.35rem; line-height: 1.2; }
  .hub-hero { padding: 1rem 0 0.85rem; }
  .hub-hero.hub-hero-with-image { padding: 1.1rem 0 0.95rem; }
  .hub-hero-badges { gap: 0.3rem; margin-bottom: 0.5rem; }
  .hub-hero-badges .badge { font-size: 0.7rem; padding: 0.3em 0.55em; }
  .hub-hero-meta { font-size: 0.8rem; margin-bottom: 0.2rem; line-height: 1.35; }
  /* Tighten the hero bottom-stack: disciplines + photo gallery + contact */
  .hub-hero .d-flex.justify-content-center.gap-1.flex-wrap.mt-2 { margin-top: 0.4rem !important; }
  .hub-hero .d-flex.justify-content-center.gap-1.flex-wrap.mt-2 .badge {
    font-size: 0.68rem; padding: 0.28em 0.5em;
  }
  .hub-hero .mt-2 .btn-sm { font-size: 0.78rem; padding: 0.25rem 0.6rem; }
  .hub-hero .mt-2 { margin-top: 0.45rem !important; }
  .hub-subnav .nav-link { padding: 0.55rem 0.75rem; font-size: 0.85rem; }
  .hub-stat-row { grid-template-columns: repeat(2, 1fr); }
  .hub-stat-value { font-size: 1.4rem; }
  .hub-links-grid { grid-template-columns: 1fr; }
  .hub-score-table td { padding: 6px 8px; font-size: 11.5px; }
  .hub-score-table th { padding: 6px 8px 5px; font-size: 8.5px; letter-spacing: 0.16em; }
  .hub-score-table .rank-cell { width: 22px; font-size: 10.5px; }
  .hub-score-table .score-cell, .hub-score-table .best-cell { font-size: 11.5px; }
  .hub-score-table .handler-cell { font-size: 11px; }
  .hub-results-table td { padding: 6px 8px; font-size: 11.5px; }
  .hub-results-table th { padding: 6px 8px 5px; font-size: 8.5px; letter-spacing: 0.16em; }
  .hub-results-table .rank-cell { width: 22px; font-size: 10.5px; }
}

/* ── Sun Mode overrides ── */
body.sun-mode .hub-hero { background: #0A1628; }
body.sun-mode .hub-subnav-wrap { background: #1E293B; border-bottom-color: rgba(255,255,255,.1); }
body.sun-mode .hub-subnav .nav-link { color: #94A3B8; }
body.sun-mode .hub-subnav .nav-link:hover { color: #F59E0B; }
body.sun-mode .hub-subnav .nav-link.active { color: #F59E0B; border-bottom-color: #F59E0B; }
body.sun-mode .hub-stat { background: #1E293B; color: #F1F5F9; }
body.sun-mode .hub-stat-value { color: #F59E0B; }
body.sun-mode .hub-stat-label { color: #94A3B8; }
body.sun-mode .hub-link-card { background: #1E293B; color: #F1F5F9; border-color: rgba(255,255,255,.1); }
body.sun-mode .hub-link-card:hover { border-color: #F59E0B; }
body.sun-mode .hub-section-header { color: #F1F5F9; }
body.sun-mode .hub-info-box { background: #1E293B; color: #F1F5F9; }
body.sun-mode .hub-score-table {
  border-top-color: #F1F5F9; border-bottom-color: #F1F5F9; color: #F1F5F9;
}
body.sun-mode .hub-score-table th {
  background: #0A1628; color: #94A3B8;
  border-bottom-color: #F1F5F9;
  box-shadow: 0 1px 0 #F1F5F9;
}
body.sun-mode .hub-score-table td { border-bottom-color: rgba(255,255,255,.1); color: #F1F5F9; }
body.sun-mode .hub-score-table tr:hover td { background: #162035; }
body.sun-mode .hub-score-table .score-cell { color: #F1F5F9; }
body.sun-mode .hub-score-table .best-cell { color: #F59E0B; }
body.sun-mode .hub-score-table .handler-cell { color: #94A3B8; }
body.sun-mode .hub-score-table .rank-cell { color: #94A3B8; }
body.sun-mode .hub-score-table .unscored td { color: #64748B; }
body.sun-mode .hub-run-pills .nav-link { color: #94A3B8; border-color: rgba(255,255,255,.15); }
body.sun-mode .hub-run-pills .nav-link.active { background: #F59E0B; color: #0A1628; border-color: #F59E0B; }
body.sun-mode .hub-results-disc-header { background: #162035; color: #F1F5F9; }
body.sun-mode .hub-results-disc-header:hover { background: #1E293B; }
body.sun-mode .hub-results-group { background: #1E293B; border-color: rgba(255,255,255,.1); }
body.sun-mode .hub-results-table {
  border-top-color: #F1F5F9; border-bottom-color: #F1F5F9; color: #F1F5F9;
}
body.sun-mode .hub-results-table th {
  color: #94A3B8; border-bottom-color: #F1F5F9; background: transparent;
}
body.sun-mode .hub-results-table td { border-bottom-color: rgba(255,255,255,.1); color: #F1F5F9; }
body.sun-mode .hub-results-table .rank-cell { color: #94A3B8; }
body.sun-mode .hub-results-table .handler-cell { color: #94A3B8; }
body.sun-mode .hub-results-table .score-cell { color: #F59E0B; }
body.sun-mode .hub-results-table tr.podium-1 .rank-cell { color: #F59E0B; }
body.sun-mode .hub-results-table tr.podium-2 .rank-cell { color: #CBD5E1; }
body.sun-mode .hub-results-table tr.podium-3 .rank-cell { color: #D97706; }
body.sun-mode .hub-float-group { border-color: rgba(255,255,255,.1); }
body.sun-mode .hub-float-group td { border-bottom-color: rgba(255,255,255,.1); color: #F1F5F9; }
