/* Link preview cards (#20): compact unfurl under a message bubble. Uses only
   surface/border/text tokens, so light and dark both come for free. */

.linkPreviewCard {
  display: flex;
  align-items: stretch;
  gap: var(--sp-3);
  margin-top: 4px;
  max-width: min(100%, 420px);
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  color: inherit;
  font-weight: 400; /* undo the global anchor weight */
}

.linkPreviewCard:hover {
  text-decoration: none; /* the title carries the affordance instead */
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.linkPreviewCard:hover .linkPreviewTitle {
  text-decoration: underline;
}

.linkPreviewBody {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.linkPreviewDomain {
  font-size: var(--fs-xs);
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linkPreviewTitle {
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.35;
  color: var(--link);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.linkPreviewDesc {
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.linkPreviewThumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  align-self: center;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-3);
}

.linkPreviewThumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .linkPreviewCard {
    max-width: 100%;
  }
}
