/* Open Graph Preview — a split: the social-card previews and the generated
   HTML on the left, the metadata inspector on the right, the secondary fields
   in the Options sheet (layout from styles/components/form.css). The counters
   and the status pill are styles/components/tag.css; generated HTML uses
   text-output.css. Only social-card previews are the page's own. */

.og-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.og-hint.is-warn {
  color: var(--warning);
}

.og-preview-grid {
  display: grid;
  gap: var(--space-3);
}

.og-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev-2);
}

.og-card__image {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1200 / 630;
  background:
    linear-gradient(135deg, var(--bg-fill), transparent),
    var(--bg-recessed);
  overflow: hidden;
}

.og-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.og-card__image.has-image img {
  display: block;
}

.og-card__image.has-image .og-card__empty {
  display: none;
}

.og-card__image--small {
  aspect-ratio: 2 / 1;
}

.og-card__empty {
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
}

.og-card__body {
  padding: 12px 14px 14px;
}

.og-card__domain {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.og-card h3 {
  margin: 5px 0 5px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.og-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.og-card--compact {
  display: grid;
  grid-template-columns: minmax(120px, 38%) 1fr;
}

.og-card--compact .og-card__body {
  min-width: 0;
}

.og-card--compact h3 {
  font-size: 15px;
}

.og-code { --code-output-max-h: 340px; }

@media (max-width: 560px) {
  .og-card--compact {
    grid-template-columns: 1fr;
  }

  .og-pane__head {
    align-items: flex-start;
  }
}

/* Keep the empty-image placeholder legible against the near-black recessed
   fill that dark mode would otherwise leave as a flat void. */
@media (prefers-color-scheme: dark) {
  .og-card__image {
    background:
      linear-gradient(135deg, var(--bg-fill), transparent),
      var(--bg-elev-2);
  }

  .og-card__empty {
    color: var(--text-dim);
  }
}
