/* =========================================================================
   AI House-Design — Examples gallery
   Extends the dashboard drafting aesthetic; all design tokens (paper/ink
   palette, Space Grotesk / IBM Plex type, ink-blue accent, radii, shadows)
   come from styles.css, which is loaded first. This file adds only the
   gallery-specific pieces: intro provenance, example cards, plan frames,
   status footer, caveat notes.
   ========================================================================= */

/* --- intro block --- */
.examples-head { margin-bottom: 26px; }
.examples-head .renders-sub { max-width: 66ch; }

/* "engine <sha>" provenance — a live green tick + mono annotation */
.provenance {
  margin: 14px 0 0;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint);
}
.provenance::before {
  content: ""; flex: 0 0 auto;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--done); box-shadow: 0 0 0 3px var(--done-tint);
}
.provenance b { color: var(--ink-soft); font-weight: 600; }

/* --- responsive card grid --- */
.examples-grid {
  display: grid; gap: 18px;
  /* min(300px, 100%) keeps a single column from overflowing narrow phones */
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
}

.ex-card {
  display: flex; flex-direction: column; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--paper-2); padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.ex-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow); border-color: var(--accent-tint-2);
}

/* --- brief (reads like a typed-in prompt) --- */
.ex-brief-row { display: flex; align-items: baseline; gap: 9px; }
.ex-brief-tag {
  flex: 0 0 auto;
  font-family: var(--font-mono); font-size: 0.56rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 2px 6px; background: var(--paper);
}
.ex-brief {
  margin: 0;
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 500;
  color: var(--ink); line-height: 1.4;
  overflow-wrap: anywhere;
}

/* --- plan render frame --- */
.ex-plan {
  border: 1px solid var(--line-soft); border-radius: var(--r-md);
  background-color: #fff;
  /* faint blueprint grid behind the plan, echoing the page ground */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 16px 16px;
  padding: 12px;
  overflow: auto;   /* scroll rather than distort if a plan is intrinsically wide */
}
.ex-plan svg {
  display: block;
  width: 100%; height: auto;
  max-width: 100%; max-height: 460px;   /* letterbox (svg keeps aspect) if unusually tall */
}
.ex-plan--empty {
  display: grid; place-items: center; min-height: 150px;
  background-image: none;
}
.ex-plan-empty {
  margin: 0;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-faint);
}

/* --- status footer --- */
.ex-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: auto;
}
.ex-foot .badge svg { flex: 0 0 auto; }
.ex-meta {
  margin-left: auto; white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-faint);
}

/* --- honest caveat notes (subtle drafting annotations) --- */
.ex-notes {
  margin: 0; padding: 12px 0 0; list-style: none;
  border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 5px;
}
.ex-notes li {
  position: relative; padding-left: 16px;
  font-size: 0.78rem; color: var(--ink-soft); line-height: 1.45;
  overflow-wrap: anywhere;
}
.ex-notes li::before {
  content: "\2014";   /* em dash — annotation marker */
  position: absolute; left: 0; top: 0;
  color: var(--ink-faint);
}

/* --- narrow screens --- */
@media (max-width: 560px) {
  .ex-meta { margin-left: 0; }
}
