/* ════════════════════════════════════════════════════════════════════════════
   hub.css (v1.0) : Presentations hub, region-grouped dense index
   (renderPresentations in app.js). Detail-page styles stay in presentations.css.
   ════════════════════════════════════════════════════════════════════════════ */

.hub-page { max-width: 680px; }

/* ── Header ── */
.hub-head { margin-bottom: var(--sp-4); }
.hub-title { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.25; }
.hub-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Search ── */
.hub-search {
  width: 100%;
  min-height: var(--tap-min);
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.hub-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

/* ── Region filter chips ── */
.hub-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: var(--sp-3) 0 0;
}
.hub-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 3px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.hub-chip:hover { border-color: var(--primary); color: var(--primary); }
.hub-chip.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.hub-chip.active .hub-chip__n { color: rgba(255,255,255,0.85); }
.hub-chip__n {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.hub-chip__dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--border);
}

/* Region dot colours (shared by chips and group headings) */
.hub-dot--lumbar     { background: var(--col-lumbar); }
.hub-dot--cervical   { background: var(--col-cervical); }
.hub-dot--thoracic   { background: var(--col-thoracic); }
.hub-dot--shoulder   { background: var(--col-shoulder); }
.hub-dot--hip        { background: var(--col-hip); }
.hub-dot--knee       { background: var(--col-knee); }
.hub-dot--lower-limb { background: var(--col-lower-limb); }
.hub-dot--upper-limb { background: var(--col-upper-limb); }
.hub-dot--multi      { background: var(--col-multi); }
.hub-dot--biopsych   { background: var(--col-pain-psych); }

/* ── Region group ── */
.hub-group { margin-top: var(--sp-6); }
.hub-group__head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
  padding: 0 2px;
}
.hub-group__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.hub-group__xlink {
  margin-left: auto;
  font-size: 11.5px; font-weight: 600;
  text-transform: none; letter-spacing: 0;
  color: var(--text-muted); text-decoration: none;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-height: 28px; display: inline-flex; align-items: center;
}
.hub-group__xlink:hover { color: var(--primary); text-decoration: underline; }
.hub-group__xlink + .hub-group__count { margin-left: 8px; }
.hub-group__count {
  margin-left: auto;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  background: var(--surface-sunken);
  border-radius: 99px; padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}

/* ── Dense row list (card container) ── */
.hub-list {
  list-style: none; padding: 0; margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.hub-row-wrap {
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.hub-row-wrap:last-child { border-bottom: none; }
.hub-row-wrap[hidden] { display: none; }

.hub-row {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
  justify-content: center;
  padding: 9px 12px 9px 14px;
  border-left: 3px solid transparent;
  text-decoration: none;
  min-height: 52px;
  transition: background var(--transition);
}
.hub-row:hover { background: var(--primary-bg); }
.hub-row__title {
  font-size: 14.5px; font-weight: 600; color: var(--text);
  line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hub-row:hover .hub-row__title { color: var(--primary); }
.hub-row__meta {
  font-size: 12px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.hub-row__t1 { color: var(--tier1-color); font-weight: 700; }

/* Region edge bar */
.hub-row--lumbar     { border-left-color: var(--col-lumbar); }
.hub-row--cervical   { border-left-color: var(--col-cervical); }
.hub-row--thoracic   { border-left-color: var(--col-thoracic); }
.hub-row--shoulder   { border-left-color: var(--col-shoulder); }
.hub-row--hip        { border-left-color: var(--col-hip); }
.hub-row--knee       { border-left-color: var(--col-knee); }
.hub-row--lower-limb { border-left-color: var(--col-lower-limb); }
.hub-row--upper-limb { border-left-color: var(--col-upper-limb); }
.hub-row--multi      { border-left-color: var(--col-multi); }
.hub-row--biopsych   { border-left-color: var(--col-pain-psych); }

/* Blueprint quick action */
.hub-row__bp {
  display: flex; align-items: center; justify-content: center;
  width: 46px; flex-shrink: 0;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 17px; text-decoration: none;
  transition: color var(--transition), background var(--transition);
}
.hub-row__bp:hover { color: var(--primary); background: var(--primary-bg); }

/* ── Empty state ── */
.hub-no-results {
  margin-top: var(--sp-6);
  font-size: 14px; color: var(--text-muted);
  text-align: center;
}


/* ── Mobile density ── */
@media (max-width: 767px) {
  .hub-head { margin-bottom: 8px; }
  .hub-sub { margin-top: 0; }
  .hub-chips { gap: 5px; margin-top: 8px; }
  .hub-chip { min-height: 30px; padding: 2px 10px; }
  .hub-group { margin-top: 14px; }
  .hub-group__head { margin-bottom: 6px; }
  .hub-row { padding: 6px 8px 6px 10px; min-height: 46px; }
  .hub-row__bp { width: 40px; }
}
