/* Entity subscriptions and public feed preview layer. */

.bk-grid-card:has(.bk-entity-card) .bk-card-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.bk-grid-card:has(.bk-entity-card),
.bk-grid-card:has(.bk-entity-card) .bk-card-grid,
.bk-entity-card,
.bk-entity-card * {
  min-width: 0;
}

.bk-entity-card {
  display: grid;
  gap: var(--bk-space-3);
}

.bk-entity-card > .bk-action-row,
.bk-band-card-actions {
  margin-top: auto;
}

.bk-band-card-link-surface {
  display: grid;
  gap: var(--bk-space-3);
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-radius: 22px;
}

.bk-band-card-link-surface:focus-visible {
  outline: 2px solid rgba(56, 189, 248, .72);
  outline-offset: 4px;
}

.bk-band-card-link-surface:hover .bk-card-title {
  color: var(--bk-accent);
}

.bk-band-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 76px;
  padding: 10px 14px;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, .24);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 8%, rgba(139, 92, 246, .20), transparent 58%),
    linear-gradient(135deg, rgba(20, 28, 48, .94), rgba(9, 16, 28, .92));
}

.bk-band-media::before,
.bk-band-media::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(96, 165, 250, .62), transparent);
  opacity: .72;
}

.bk-band-media::before { left: 8%; }
.bk-band-media::after { right: 8%; }

.bk-band-card .bk-band-media .bk-cover {
  position: relative;
  z-index: 1;
  display: block;
  width: min(86%, 330px);
  max-width: none;
  height: 56px;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  transform: scale(1.32);
  transform-origin: center;
}

.bk-band-card .bk-card-header-tight,
.bk-band-card .bk-card-header-tight > div {
  min-width: 0;
}

.bk-band-card .bk-card-title,
.bk-band-card .bk-meta,
.bk-band-card .bk-state-copy,
.bk-band-card .bk-kpi-value,
.bk-band-card .bk-kpi-label {
  overflow-wrap: anywhere;
  word-break: normal;
}

.bk-band-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--bk-space-2);
}

.bk-band-card-actions .bk-button {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  padding-inline: 10px;
  white-space: normal;
  text-align: center;
  font-size: .82rem;
  line-height: 1.2;
}

.bk-entity-feed-preview {
  display: grid;
  gap: var(--bk-space-3);
  padding: var(--bk-space-4);
  border: 1px solid var(--bk-border);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(34, 211, 238, .09), transparent 16rem),
    linear-gradient(145deg, rgba(255, 255, 255, .04), rgba(59, 130, 246, .035));
}

.bk-entity-feed-preview-compact {
  gap: var(--bk-space-2);
  padding: var(--bk-space-3);
  border-radius: 16px;
  background: rgba(255, 255, 255, .025);
}

.bk-entity-feed-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--bk-space-3);
  align-items: start;
}

.bk-entity-feed-head > div,
.bk-entity-feed-preview .bk-state-copy,
.bk-entity-feed-policy,
.bk-entity-feed-settings,
.bk-entity-actions,
.bk-entity-feed-stats,
.bk-entity-post-origin {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bk-entity-feed-head .bk-chip-row {
  justify-content: flex-end;
}

.bk-entity-feed-preview-compact .bk-card-title {
  font-size: .95rem;
  line-height: 1.24;
}

.bk-entity-feed-preview-compact .bk-meta,
.bk-entity-feed-preview-compact .bk-state-copy {
  font-size: .82rem;
  line-height: 1.38;
}

.bk-entity-feed-stats {
  display: block;
  color: var(--bk-muted);
  font-size: .78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.bk-entity-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bk-entity-kpi-grid .bk-kpi {
  min-height: 74px;
  padding: var(--bk-space-3);
}

.bk-entity-kpi-grid .bk-kpi-value {
  font-size: 1.05rem;
  line-height: 1.2;
}

.bk-entity-feed-settings {
  display: grid;
  gap: var(--bk-space-2);
  padding: var(--bk-space-3);
  border: 1px solid rgba(34, 211, 238, .22);
  border-radius: var(--bk-radius-control);
  background: rgba(34, 211, 238, .055);
}

.bk-entity-feed-settings > div {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bk-space-2);
}

.bk-entity-feed-settings p {
  margin: 0;
  color: var(--bk-muted);
  font-size: .86rem;
  line-height: 1.45;
}

.bk-entity-feed-policy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--bk-space-3);
  align-items: center;
  padding: var(--bk-space-3);
  border: 1px solid rgba(251, 191, 36, .24);
  border-radius: var(--bk-radius-control);
  background: rgba(251, 191, 36, .06);
  color: var(--bk-muted);
  font-size: .86rem;
  line-height: 1.45;
}

.bk-entity-feed-policy .bk-chip-row {
  justify-content: flex-end;
}

.bk-entity-post-origin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--bk-space-3);
  align-items: start;
  margin-top: var(--bk-space-3);
  padding: var(--bk-space-3);
  border: 1px solid rgba(59, 130, 246, .24);
  border-radius: var(--bk-radius-control);
  background: rgba(59, 130, 246, .055);
}

.bk-entity-post-origin strong {
  display: block;
  line-height: 1.25;
}

.bk-entity-post-origin p {
  margin: var(--bk-space-1) 0 0;
}

.bk-entity-post-origin .bk-chip-row {
  justify-content: flex-end;
}

.bk-entity-actions {
  flex-wrap: wrap;
}

.bk-entity-actions .bk-button {
  flex: 1 1 128px;
  min-width: 0;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.bk-compact-card {
  display: grid;
  grid-template-rows: auto minmax(84px, auto) auto auto;
  gap: var(--bk-space-2);
}

.bk-compact-card .bk-profile-link {
  min-height: 70px;
  align-items: flex-start;
  margin-bottom: 0;
}

.bk-compact-card .bk-chip-row {
  align-content: start;
  min-height: 84px;
}

.bk-profile-compact-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-self: end;
}

.bk-profile-compact-actions .bk-button {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding-inline: 5px;
  white-space: normal;
  text-align: center;
  font-size: .7rem;
  line-height: 1.05;
}

.bk-participant-report-link {
  justify-self: end;
  align-self: end;
  max-width: max-content;
  margin-top: -2px;
  padding: 2px 4px;
  border-radius: 999px;
  color: rgba(148, 163, 184, .56);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  opacity: .72;
}

.bk-participant-report-link:hover,
.bk-participant-report-link:focus-visible {
  color: rgba(251, 113, 133, .9);
  opacity: 1;
  outline: none;
}

@media (max-width: 1180px) and (min-width: 768px) {
  .bk-entity-feed-head,
  .bk-entity-feed-policy,
  .bk-entity-post-origin {
    grid-template-columns: minmax(0, 1fr);
  }

  .bk-entity-feed-head .bk-chip-row,
  .bk-entity-feed-policy .bk-chip-row,
  .bk-entity-post-origin .bk-chip-row {
    justify-content: flex-start;
  }
}

@media (min-width: 1181px) {
  .bk-grid-card:has(.bk-entity-card) .bk-card-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  }

  .bk-entity-feed-preview-compact .bk-entity-feed-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .bk-entity-feed-preview-compact .bk-entity-feed-head .bk-chip-row {
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .bk-band-media {
    min-height: 78px;
    padding-inline: 12px;
  }

  .bk-band-card .bk-band-media .bk-cover {
    width: min(92%, 330px);
    transform: scale(1.22);
  }

  .bk-entity-card,
  .bk-band-card-link-surface,
  .bk-entity-feed-preview {
    gap: 10px;
  }

  .bk-entity-feed-preview {
    padding: 12px;
    border-radius: 16px;
  }

  .bk-entity-feed-preview .bk-state-copy {
    margin: 0;
    font-size: .86rem;
    line-height: 1.42;
  }

  .bk-entity-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .bk-entity-kpi-grid .bk-kpi {
    min-height: 54px;
    padding: 9px 8px;
    border-radius: 12px;
  }

  .bk-entity-kpi-grid .bk-kpi-value {
    font-size: .98rem;
    line-height: 1.05;
  }

  .bk-entity-kpi-grid .bk-kpi-label {
    margin-top: 4px;
    font-size: .67rem;
    line-height: 1.1;
  }

  .bk-entity-feed-settings,
  .bk-entity-feed-policy {
    padding: 10px;
    border-radius: 14px;
  }

  .bk-entity-feed-settings p,
  .bk-entity-feed-policy {
    font-size: .8rem;
    line-height: 1.42;
  }

  .bk-entity-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .bk-entity-actions .bk-button {
    width: 100%;
    min-height: 36px;
    padding-inline: 8px;
    font-size: .8rem;
    line-height: 1.12;
  }

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

  .bk-band-card-actions .bk-button {
    width: 100%;
  }

  .bk-compact-card {
    grid-template-rows: auto auto auto auto;
    gap: 8px;
  }

  .bk-compact-card .bk-chip-row {
    min-height: 0;
  }

  .bk-participant-report-link {
    justify-self: start;
    margin-top: -4px;
    font-size: .66rem;
  }

  .bk-entity-feed-head,
  .bk-entity-feed-policy,
  .bk-entity-post-origin {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--bk-space-2);
  }

  .bk-entity-feed-head .bk-chip-row,
  .bk-entity-feed-policy .bk-chip-row,
  .bk-entity-post-origin .bk-chip-row {
    justify-content: flex-start;
  }
}

@media (max-width: 380px) {
  .bk-entity-kpi-grid,
  .bk-entity-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}