/* =============================================================================
 * Via Hive Admin - AI helpers and "Preview as user" in the category / service editors (ADM-16)
 * -----------------------------------------------------------------------------
 * Scope: the two boxes added to the main category editor and the subcategory (service) editor:
 *   .vh-ai  drafts of AI suggestions next to the current values (Accept / edit / Discard)
 *   .vh-pv  how the website will show the card and the page header with the current, unsaved values
 * Namespaced `.vh-ai` / `.vh-pv`, so no other screen is affected. Consumes ONLY the semantic --vh2-* roles
 * (no hard-coded brand colours), so light and dark both follow the token layer. Text is at least 13px.
 * The preview is a plain mock of the website, not the website: a few lines of it use fixed light colours on
 * purpose, through variables below, so it looks like the (light) public site in both Admin themes.
 * ========================================================================== */

.vh-ai,
.vh-pv {
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid var(--vh2-border-default);
  border-radius: 12px;
  background: var(--vh2-surface);
  color: var(--vh2-text-primary);
  font-size: 14px;
  line-height: 1.5;
}
.vh-ai-title,
.vh-pv-title { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.vh-ai-lead,
.vh-pv-lead { margin: 0 0 12px; color: var(--vh2-text-secondary); font-size: 14px; }

.vh-ai-bar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; margin-bottom: 12px; }
.vh-ai-provider { display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
.vh-ai-provider label { margin: 0; font-size: 14px; font-weight: 600; }
.vh-ai-status { color: var(--vh2-text-secondary); font-size: 14px; }
.vh-ai-empty { color: var(--vh2-text-secondary); font-size: 14px; margin: 8px 0; }

.vh-ai-drafts { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.vh-ai-draft { padding: 12px 14px; border: 1px solid var(--vh2-border-default); border-radius: 10px; background: var(--vh2-bg-subtle); }
.vh-ai-field { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.vh-ai-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vh-ai-col-title { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 600; color: var(--vh2-text-secondary); }
.vh-ai-source { font-weight: 400; }
.vh-ai-edited { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--vh2-info-bg); color: var(--vh2-info-fg); font-size: 12px; font-weight: 600; }
.vh-ai-value { padding: 8px 10px; min-height: 40px; border: 1px solid var(--vh2-border-subtle); border-radius: 8px; background: var(--vh2-surface); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 190px; overflow: auto; }
.vh-ai-empty-value { color: var(--vh2-text-tertiary); font-style: italic; }
.vh-ai-sees { margin: 6px 0 0; color: var(--vh2-text-secondary); font-size: 14px; }
.vh-ai-buttons,
.vh-ai-all { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

@media (max-width: 767px) {
  .vh-ai-compare { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------- preview */
.vh-pv { --vh-pv-site-bg: #ffffff; --vh-pv-site-ink: #111827; --vh-pv-site-muted: #6b7280; --vh-pv-site-line: #e5e7eb; --vh-pv-site-accent: #b8340f; }
.vh-pv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vh-pv-toggle { padding: 0; }
.vh-pv-warnings { margin: 0 0 12px; padding: 8px 12px 8px 28px; border: 1px solid var(--vh2-warning-border); border-radius: 8px; background: var(--vh2-warning-bg); color: var(--vh2-warning-fg); font-size: 14px; }
.vh-pv-block { margin: 14px 0; }
.vh-pv-label { margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--vh2-text-secondary); }
.vh-pv-note { margin: 6px 0 0; color: var(--vh2-text-secondary); font-size: 14px; overflow-wrap: anywhere; }

.vh-pv-card,
.vh-pv-page,
.vh-pv-search { background: var(--vh-pv-site-bg); color: var(--vh-pv-site-ink); border: 1px solid var(--vh-pv-site-line); border-radius: 12px; }
.vh-pv-card { width: 240px; max-width: 100%; overflow: hidden; }
.vh-pv-card-img,
.vh-pv-hero-img { position: relative; background: #f3f4f6; }
.vh-pv-card-img { aspect-ratio: 4 / 3; }
.vh-pv-card-img img,
.vh-pv-hero-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vh-pv-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--vh-pv-site-muted); font-size: 14px; }
.vh-pv-card-body { padding: 12px 14px; }
.vh-pv-card-name { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vh-pv-card-sub .vh-pv-card-name { text-align: center; }
.vh-pv-card-link { margin-top: 8px; color: var(--vh-pv-site-accent); font-size: 14px; font-weight: 500; }

.vh-pv-page { padding: 14px 16px; }
.vh-pv-crumbs { color: var(--vh-pv-site-muted); font-size: 14px; margin-bottom: 10px; }
.vh-pv-hero { display: flex; gap: 20px; align-items: flex-start; }
.vh-pv-hero-text { flex: 1 1 0; min-width: 0; }
.vh-pv-hero-img { flex: 0 0 200px; width: 200px; height: 200px; border-radius: 10px; overflow: hidden; }
.vh-pv-h1 { font-size: 28px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.vh-pv-sub { margin-top: 8px; color: var(--vh-pv-site-muted); overflow-wrap: anywhere; }
.vh-pv-default { font-style: italic; }
.vh-pv-desc { margin-top: 12px; color: var(--vh-pv-site-muted); font-weight: 300; line-height: 1.7; overflow-wrap: anywhere; }
.vh-pv-desc h1,
.vh-pv-desc h2,
.vh-pv-desc h3 { color: var(--vh-pv-site-ink); font-size: 18px; margin: 12px 0 6px; }

.vh-pv-search { padding: 12px 14px; max-width: 620px; }
.vh-pv-search-title { color: #1a0dab; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.vh-pv-search-desc { color: #4d5156; font-size: 14px; overflow-wrap: anywhere; }

@media (max-width: 767px) {
  .vh-pv-hero { flex-direction: column-reverse; }
  .vh-pv-hero-img { width: 100%; flex-basis: auto; height: 220px; }
}
