/* ═══════════════════════════════════════════════════════════════════════════
   samples.css — the public sample gallery.

   The cards show a real, scaled-down slice of the actual document rather than
   an illustration of one. A screenshot would go stale the moment an engine
   changes; this cannot, because it is the document.
   ═══════════════════════════════════════════════════════════════════════════ */

.sm-body { background: var(--bg-alt); }

.sm-top {
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 60;
}
.sm-top-in { display: flex; align-items: center; gap: 18px; padding: 12px 0; }

.sm-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }

.sm-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; color: inherit;
  display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.sm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }

/* The preview: the real document, shrunk and clipped. Pointer events are off
   so the whole card stays one link. */
.sm-peek { position: relative; height: 260px; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--border); }
.sm-peek-in {
  transform: scale(.62); transform-origin: top left;
  width: 161%; padding: 20px 22px 0; pointer-events: none;
}
html[dir="rtl"] .sm-peek-in { transform-origin: top right; }
.sm-peek-in h2 { font-size: 17px !important; margin: 16px 0 8px !important; padding-top: 12px !important; }
.sm-peek-in h2:first-child { margin-top: 0 !important; padding-top: 0 !important; }
.sm-peek-in .doc-stats { margin: 0 0 14px !important; }
.sm-peek-in .doc-stats b { font-size: 1.4rem !important; }

.sm-fade {
  position: absolute; inset-inline: 0; bottom: 0; height: 110px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--card));
}

.sm-meta { display: flex; align-items: center; gap: 13px; padding: 17px 20px; }
.sm-meta .ico { font-size: 24px; line-height: 1; flex: none; }
.sm-meta h3 { font-size: 16px; font-weight: 600; margin: 0 0 3px; }
.sm-meta p { font-size: 13px; color: var(--text-dim); margin: 0; }
.sm-open {
  margin-inline-start: auto; flex: none;
  font-family: var(--font-display); font-size: 12.5px; font-weight: 600; color: var(--kf-purple);
}
html[dir="rtl"] .sm-open { font-family: var(--font-ar); }

.sm-cta { margin-top: 26px; border-color: var(--border-strong); }

@media (max-width: 560px) {
  .sm-peek { height: 210px; }
  .sm-meta { flex-wrap: wrap; }
  .sm-open { margin-inline-start: 0; }
}

/* ── A brief, shown as a sample ──────────────────────────────────────────
   Two of the fifteen tools produce a brief rather than a document — that is
   what they are for, and the gallery says so on the card. Monospaced and
   scrollable, because a brief is read as text and its indentation carries
   meaning the way a document's headings do. */
.kft-brief {
  margin: 14px 0 0;
  padding: 16px 18px;
  max-height: 60vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12.5px/1.65 'JetBrains Mono', Menlo, Consolas, monospace;
  background: var(--bg-page, #f7f7f8);
  border: 1px solid var(--border, #e4e4e7);
  border-radius: 12px;
  color: var(--text, inherit);
}
/* Inside a gallery peek there is no room to scroll, so it simply crops. */
.sm-peek .kft-brief { max-height: none; overflow: hidden; }
