/* Profile social layer: friendship, follows, personal feed policy and relationship controls. */

.bk-profile-social-card {
  position: relative;
  overflow: hidden;
}

.bk-profile-social-card,
.bk-profile-social-card * {
  min-width: 0;
}

.bk-profile-social-card .bk-profile-cover-stack {
  position: relative;
  display: block;
  width: calc(100% + var(--bk-space-10));
  margin: calc(var(--bk-space-5) * -1) calc(var(--bk-space-5) * -1) 0;
  overflow: hidden;
  border-radius: var(--bk-radius-card) var(--bk-radius-card) 0 0;
  border-bottom: 1px solid var(--bk-border);
  background: var(--bk-panel-2);
}

.bk-profile-social-card .bk-profile-cover-stack .bk-cover {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  aspect-ratio: 6 / 2;
  max-height: 220px;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  object-position: center;
}

.bk-profile-cover-back,
.bk-profile-return-row {
  display: none;
}

.bk-shell-profile-back {
  min-height: 34px;
  width: auto;
  padding-inline: 12px;
  border-radius: 999px;
  border-color: rgba(148, 163, 184, .28);
  background: rgba(7, 12, 22, .72);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
  white-space: nowrap;
}

.bk-shell-profile-back-desktop {
  order: -1;
}

.bk-profile-social-card .bk-profile-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: var(--bk-space-4);
  margin-top: var(--bk-space-3);
}

.bk-profile-social-card .bk-profile-head > div {
  display: grid;
  gap: var(--bk-space-2);
  min-width: 0;
}

.bk-profile-social-card .bk-title,
.bk-profile-social-card .bk-meta,
.bk-profile-feed-policy,
.bk-profile-feed-policy span,
.bk-profile-social-actions,
.bk-social-card .bk-card-body,
.bk-social-card .bk-social-actions {
  overflow-wrap: anywhere;
}

.bk-profile-social-card .bk-chip-row,
.bk-profile-social-card .bk-tab-row,
.bk-social-card .bk-chip-row,
.bk-social-card .bk-action-row {
  max-width: 100%;
}

.bk-profile-social-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bk-profile-social-kpis .bk-kpi {
  min-width: 0;
}

.bk-profile-feed-policy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: var(--bk-space-4);
  padding: var(--bk-space-4);
  border: 1px solid var(--bk-border);
  border-radius: 22px;
  background: rgba(255, 255, 255, .035);
}

.bk-profile-feed-policy > div {
  min-width: 0;
}

.bk-profile-feed-policy strong,
.bk-profile-feed-policy span {
  display: block;
}

.bk-profile-feed-policy span {
  margin-top: var(--bk-space-1);
  color: var(--bk-muted);
  line-height: 1.45;
}

.bk-profile-feed-policy .bk-chip-row {
  justify-content: flex-end;
  min-width: 0;
}

.bk-profile-social-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bk-space-2);
  width: 100%;
}

.bk-profile-social-actions .bk-button {
  flex: 1 1 160px;
  min-width: 0;
}

.bk-profile-card .bk-chip-row .bk-badge {
  max-width: 100%;
  white-space: normal;
}

.bk-social-card .bk-card-body p {
  line-height: 1.55;
}

.bk-social-card .bk-action-row {
  flex-wrap: wrap;
}

.bk-social-card .bk-social-actions .bk-button {
  flex: 1 1 128px;
  min-width: 0;
}

.bk-social-card .bk-social-actions > span {
  display: inline-flex;
  min-width: 0;
}

@media (max-width: 1180px) and (min-width: 768px) {
  .bk-profile-social-card .bk-profile-head {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: var(--bk-space-3);
    margin-top: var(--bk-space-3);
  }

  .bk-profile-social-card .bk-avatar-lg {
    width: 82px;
    height: 82px;
  }

  .bk-profile-social-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bk-profile-feed-policy {
    grid-template-columns: minmax(0, 1fr);
  }

  .bk-profile-feed-policy .bk-chip-row {
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .bk-profile-social-card {
    gap: 12px;
  }

  .bk-profile-social-card .bk-profile-cover-stack {
    width: calc(100% + var(--bk-space-8));
    margin: calc(var(--bk-space-4) * -1) calc(var(--bk-space-4) * -1) 0;
  }

  .bk-profile-social-card .bk-profile-cover-stack .bk-cover {
    aspect-ratio: 16 / 8;
    max-height: 180px;
  }

  .bk-shell-profile-back-mobile {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 12px);
    right: 58px;
    z-index: 80;
    min-height: 34px;
    padding-inline: 11px;
  }

  .bk-mobile-reference-home {
    display: none !important;
  }

  .bk-feed-desktop-block {
    display: block !important;
  }

  .bk-composer-card,
  .bk-dashboard-greeting-card,
  .bk-dashboard-card-reference,
  .bk-quick-actions-card,
  .bk-feed-filter-card,
  .bk-social-card {
    border-radius: 18px;
  }

  .bk-dashboard-greeting-card,
  .bk-dashboard-card-reference,
  .bk-quick-actions-card {
    display: grid;
    gap: 12px;
  }

  .bk-feed-filter-card .bk-chip-row,
  .bk-social-card .bk-social-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .bk-social-card .bk-social-actions > span,
  .bk-social-card .bk-social-actions .bk-button,
  .bk-social-card .bk-social-actions > span .bk-badge {
    width: 100%;
    justify-content: center;
  }

  .bk-social-card .bk-card-header {
    align-items: flex-start;
  }

  .bk-social-card .bk-card-title,
  .bk-social-card .bk-meta,
  .bk-social-card .bk-card-body,
  .bk-social-card .bk-card-body p {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .bk-profile-social-card .bk-profile-head {
    grid-template-columns: 60px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    margin-top: var(--bk-space-3);
  }

  .bk-profile-social-card .bk-avatar-lg {
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }

  .bk-profile-social-card .bk-title {
    font-size: clamp(1.18rem, 6vw, 1.48rem);
    line-height: 1.08;
  }

  .bk-profile-social-card .bk-meta {
    font-size: .78rem;
    line-height: 1.35;
  }

  .bk-profile-social-card .bk-chip-row {
    gap: 6px;
  }

  .bk-profile-social-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bk-profile-social-kpis .bk-kpi {
    min-height: 64px;
  }

  .bk-profile-feed-policy {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--bk-space-3);
    padding: var(--bk-space-3);
    border-radius: 16px;
  }

  .bk-profile-feed-policy .bk-chip-row {
    justify-content: flex-start;
  }

  .bk-profile-social-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .bk-profile-social-actions .bk-button {
    width: 100%;
    justify-content: center;
  }

  .bk-social-card .bk-social-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--bk-space-2);
  }

  .bk-social-card .bk-social-actions > span,
  .bk-social-card .bk-social-actions .bk-button:last-child {
    grid-column: 1 / -1;
  }

  .bk-social-card .bk-social-actions > span,
  .bk-social-card .bk-social-actions > span .bk-badge,
  .bk-social-card .bk-social-actions .bk-button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .bk-shell-profile-back-mobile {
    right: 56px;
  }

  .bk-profile-social-card .bk-profile-head {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
  }

  .bk-profile-social-card .bk-avatar-lg {
    width: 54px;
    height: 54px;
    border-radius: 16px;
  }

  .bk-profile-social-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .bk-social-card .bk-social-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}