/* ==========================================================================
   "Your connection" card on member profiles (profile_card_relationship.php,
   markup from functions_connections.php). Mobile first.
   ========================================================================== */

.bc-conn { --tone: var(--bc-accent, #5b4bd1); --tone-soft: rgba(91, 75, 209, 0.1); }
.bc-tone-violet { --tone: #5b4bd1; --tone-soft: rgba(91, 75, 209, 0.1); }
.bc-tone-cyan   { --tone: #0891b2; --tone-soft: rgba(3, 195, 227, 0.12); }
.bc-tone-clay   { --tone: #c2552c; --tone-soft: rgba(212, 116, 79, 0.12); }
.bc-tone-green  { --tone: #15803d; --tone-soft: rgba(22, 163, 74, 0.11); }
.bc-tone-amber  { --tone: #b45309; --tone-soft: rgba(245, 158, 11, 0.14); }
.bc-tone-blue   { --tone: #2563eb; --tone-soft: rgba(37, 99, 235, 0.1); }

.bc-conn a { color: inherit; text-decoration: underline; text-decoration-color: var(--bc-line-strong, rgba(15, 15, 25, 0.12)); text-underline-offset: 3px; }
.bc-conn a:hover { color: var(--tone); text-decoration-color: currentColor; }
.bc-conn a.bc-conn-av { text-decoration: none; }
.bc-conn-dot { margin: 0 6px; color: var(--bc-faint, #9a9aa5); }

/* ---------- Headline: the strongest link ---------- */

.bc-conn-hero {
  position: relative;
  padding: 16px;
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 0% 0%, var(--tone-soft), transparent 70%),
    var(--bc-surface-2, #f6f6f8);
  box-shadow: 0 0 0 1px var(--bc-line, rgba(15, 15, 25, 0.07)) inset;
}

.bc-conn-pair { display: flex; align-items: center; margin-bottom: 12px; }
.bc-conn-pair img,
.bc-conn-pair .bc-av { box-shadow: 0 0 0 3px var(--bc-surface, #fff) !important; }
.bc-conn-badge {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  margin: 0 -6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tone);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 0 0 3px var(--bc-surface, #fff), 0 4px 10px -2px rgba(16, 16, 30, 0.25);
}

.bc-conn-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tone);
}

.bc-conn-headline {
  font-size: 17px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--bc-ink, #0b0b10);
  overflow-wrap: anywhere;
}
.bc-conn-detail {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--bc-muted, #6b6b76);
  overflow-wrap: anywhere;
}

/* ---------- Multi-hop path: you > coach > hub > coach > them ---------- */

.bc-conn-path {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 14px -4px 0;
  padding: 2px 4px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.bc-conn-path::-webkit-scrollbar { display: none; }
.bc-conn-node {
  position: relative;
  flex: 1 1 0;
  min-width: 46px;
  max-width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}
/* connector to the next node */
.bc-conn-node:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 17px;
  left: calc(50% + 21px);
  right: calc(-50% + 21px);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--bc-line-strong, rgba(15, 15, 25, 0.12)), var(--tone));
  opacity: 0.55;
}
.bc-conn-node-name {
  max-width: 100%;
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--bc-ink-2, #3a3a44);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bc-conn-node.is-end .bc-conn-node-name { font-weight: 600; color: var(--bc-ink, #0b0b10); }
.bc-conn-node.is-hub .bc-conn-node-name { font-weight: 650; color: var(--tone); }
.bc-conn-node.is-hub img,
.bc-conn-node.is-hub .bc-av { box-shadow: 0 0 0 3px var(--bc-surface, #fff), 0 0 0 5px var(--tone) !important; }

/* ---------- Avatar stack (shared coaches, mutual friends) ---------- */

.bc-conn-people { display: flex; align-items: center; flex: 0 0 auto; margin-top: 10px; padding-left: 6px; }
.bc-conn-people > a,
.bc-conn-people > div { margin-left: -6px; }
.bc-conn-people img,
.bc-conn-people .bc-av { box-shadow: 0 0 0 2px var(--bc-surface, #fff) !important; }

/* ---------- More links ---------- */

.bc-conn-list { list-style: none; margin: 6px 0 0; padding: 0; }
.bc-conn-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 2px;
  border-top: 1px solid var(--bc-line, rgba(15, 15, 25, 0.07));
}
.bc-conn-list:first-child > .bc-conn-item:first-child { border-top: 0; }
.bc-conn-ico {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--tone-soft);
  color: var(--tone);
  font-size: 14px;
}
.bc-conn-body { flex: 1 1 auto; min-width: 0; padding-top: 1px; }
.bc-conn-title { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--bc-ink, #0b0b10); overflow-wrap: anywhere; }
.bc-conn-item .bc-conn-people { margin-top: 2px; align-self: center; }
.bc-conn-item .bc-conn-path { margin-top: 10px; }

.bc-conn-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bc-surface-2, #f6f6f8);
  box-shadow: 0 0 0 1px var(--bc-line, rgba(15, 15, 25, 0.07)) inset;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bc-ink-2, #3a3a44);
  cursor: pointer;
  list-style: none;
}
.bc-conn-more > summary::-webkit-details-marker { display: none; }
.bc-conn-more > summary::after { content: "\25BE"; font-size: 10px; color: var(--bc-faint, #9a9aa5); }
.bc-conn-more[open] > summary { display: none; }
.bc-conn-more > .bc-conn-list > .bc-conn-item:first-child { border-top: 1px solid var(--bc-line, rgba(15, 15, 25, 0.07)); }

/* ---------- Nothing found ---------- */

.bc-conn-empty { padding: 6px 0 2px; text-align: center; }
.bc-conn-empty .bc-conn-pair { justify-content: center; }
.bc-conn-gap {
  width: 44px;
  height: 0;
  margin: 0 8px;
  border-top: 2px dashed var(--bc-line-strong, rgba(15, 15, 25, 0.12));
}
.bc-conn-empty .bc-conn-headline { font-size: 15px; }
.bc-conn-empty .bc-conn-detail { max-width: 300px; margin: 4px auto 0; }

@media (min-width: 768px) {
  .bc-conn-hero { padding: 16px 14px; }
  .bc-conn-headline { font-size: 18px; }
}

/* Degrees of separation: how each person relates to the one before */
.bc-conn-node-rel {
  margin-top: -3px;
  font-size: 10.5px;
  line-height: 1.2;
  color: var(--bc-muted, #6b6b76);
  white-space: nowrap;
}

/* ==========================================================================
   Strip under the profile hero: strongest link at a glance, the rest opens below
   ========================================================================== */

.bc-conn-strip {
  margin: 0 4px 18px;
  border-radius: 18px;
  background:
    radial-gradient(90% 140% at 0% 0%, var(--tone-soft), transparent 65%),
    var(--bc-surface, #fff);
  box-shadow: 0 0 0 1px var(--bc-line, rgba(15, 15, 25, 0.07)) inset, 0 6px 20px -12px rgba(16, 16, 30, 0.18);
}
.bc-conn-strip.is-empty { background: var(--bc-surface, #fff); }
.bc-conn-strip-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  list-style: none;
}
.bc-conn-strip-sum { display: block; cursor: pointer; list-style: none; }
.bc-conn-strip-sum::-webkit-details-marker { display: none; }
.bc-conn-strip .bc-conn-pair { flex: 0 0 auto; margin: 0; }
.bc-conn-strip .bc-conn-gap { width: 26px; margin: 0 6px; }
.bc-conn-strip-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.bc-conn-strip .bc-conn-eyebrow { margin-bottom: 2px; }
.bc-conn-strip.is-empty .bc-conn-eyebrow { color: var(--bc-muted, #6b6b76); }
.bc-conn-strip .bc-conn-headline { font-size: 16px; }
.bc-conn-strip.is-empty .bc-conn-headline { font-size: 15px; }
.bc-conn-strip-more {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bc-surface-2, #f6f6f8);
  box-shadow: 0 0 0 1px var(--bc-line, rgba(15, 15, 25, 0.07)) inset;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bc-ink-2, #3a3a44);
  white-space: nowrap;
}
.bc-conn-strip-more i { font-size: 11px; transition: transform 0.2s ease; }
.bc-conn-strip-details[open] .bc-conn-strip-more i { transform: rotate(180deg); }
.bc-conn-strip-body { padding: 0 16px 14px; }
.bc-conn-strip-wide { display: block; padding: 0 16px 14px; }
.bc-conn-strip-wide .bc-conn-path { margin-top: 0; }
@media (min-width: 768px) {
  .bc-conn-strip-narrow { display: none; }
  /* Nothing more than the chain, which is already on show: no toggle */
  .bc-conn-strip.is-path-only .bc-conn-strip-sum { pointer-events: none; cursor: default; }
  .bc-conn-strip.is-path-only .bc-conn-strip-sum a { pointer-events: auto; }
  .bc-conn-strip.is-path-only .bc-conn-strip-more { display: none; }
}
.bc-conn-strip-body > .bc-conn-path:first-child { margin-top: 0; }
.bc-conn-strip-body > .bc-conn-list:not(:first-child) { margin-top: 10px; border-top: 1px solid var(--bc-line, rgba(15, 15, 25, 0.07)); }
.bc-conn-strip-body > .bc-conn-list:not(:first-child) > .bc-conn-item:first-child { border-top: 0; }

@media (max-width: 767px) {
  .bc-conn-strip { margin: 0 4px 16px; }
  .bc-conn-strip-wide { display: none; }
  .bc-conn-strip-head { gap: 12px; padding: 12px 14px; }
  .bc-conn-strip .bc-conn-pair img, .bc-conn-strip .bc-conn-pair .bc-av { width: 34px !important; height: 34px !important; }
  .bc-conn-strip .bc-conn-badge { width: 24px; height: 24px; font-size: 11px; }
  .bc-conn-strip .bc-conn-headline { font-size: 15px; }
  .bc-conn-strip-more { padding: 5px 9px; }
  .bc-conn-strip-count { display: none; }
  .bc-conn-strip-body { padding: 0 14px 12px; }
}

/* Long chains never get cut off: in a narrow box the path runs top to bottom */
.bc-conn-strip-body, .bc-conn-item .bc-conn-body { container-type: inline-size; }
@container (max-width: 480px) {
  .bc-conn-path { flex-direction: column; align-items: stretch; gap: 0; margin: 8px 0 0; padding: 0; overflow: visible; }
  .bc-conn-node { flex-direction: row; align-items: center; max-width: none; min-width: 0; gap: 10px; text-align: left; padding: 4px 0; }
  .bc-conn-node:not(:last-child)::after {
    top: 38px; bottom: -4px; left: 16px; right: auto; width: 2px; height: auto;
    background: linear-gradient(180deg, var(--bc-line-strong, rgba(15, 15, 25, 0.12)), var(--tone));
  }
  .bc-conn-node-name { font-size: 13.5px; }
  .bc-conn-node-rel { margin-top: 0; font-size: 12px; }
  .bc-conn-node-rel::before { content: "\00B7"; margin-right: 6px; }
}

/* One render, two slots: under the hero on phones, top of the right column on desktop */
@media (min-width: 768px) { .bc-conn-slot-top { display: none; } .bc-conn-slot-side .bc-conn-strip { margin: 0 16px 22px; } }
@media (max-width: 767.98px) { .bc-conn-slot-side { display: none; } }
