/* LlamaPress Pattern Catalog — the light reference surface.
 *
 * WHY A SEPARATE STYLESHEET, AND WHY IT IS ALLOWED TO EXIST
 * --------------------------------------------------------
 * docs/design/2026-08-01-design-congruence-audit.md found the admin already has
 * SIX style families and 24 different h1 treatments, and the standing rule is
 * "no new style family — copy the nearest existing page". This file is the one
 * sanctioned exception, for two reasons:
 *   1. Every other library view (wiki, cookbook, portfolio) opts into the dark
 *      theme with `content_for :body_class, 'lpd-dark lpd-remap'`. The catalog
 *      deliberately does not — it is authored light and STAYS light, so the
 *      dark card primitives in lpd_theme.css (.cb-card and friends, built on
 *      white-alpha gradients and color:#fff) cannot be reused here.
 *   2. This section's whole job is to demonstrate the house design rules. It
 *      has to obey them visibly.
 *
 * So the rules below are not new opinions. They are the existing ones, made
 * literal:
 *   * Neutral is the default; colour is an exception that carries meaning.
 *   * At most three semantic colours plus neutrals, one meaning each:
 *       amber   = a human must act
 *       rose    = broken / destructive
 *       emerald = moving the right way
 *     (from .claude/skills/design_color_icons_contrast — that skill remains the
 *     authority; this file only spends its budget.)
 *   * Blue is INTERACTIVE ONLY. Never a status.
 *   * Never colour alone: every coloured thing here also carries a word.
 *
 * Accent is #2563EB, not the legacy brand #489DF9 — that blue is 2.81:1 on
 * white and fails the 4.5:1 AA floor, which is why lpd_theme.css already
 * remaps it away on the dark side.
 *
 * Everything is scoped under .pc so it cannot leak onto another page.
 * Pure CSS: no ERB, no url() to fingerprinted assets. */

/* ===== palette ===== */
.pc {
  --pc-bg:        #FFFFFF;
  --pc-bg-2:      #FAFAFA;
  --pc-bg-3:      #F3F4F6;
  --pc-ink:       #111827;
  --pc-ink-2:     #374151;
  --pc-ink-3:     #6B7280;
  --pc-ink-4:     #9CA3AF;
  --pc-line:      #E5E7EB;
  --pc-line-2:    #D1D5DB;
  --pc-accent:    #2563EB;   /* interactive ONLY */
  --pc-accent-bg: #EFF6FF;
  --pc-amber:     #B45309;   /* needs a human */
  --pc-amber-bg:  #FFFBEB;
  --pc-rose:      #BE123C;   /* broken / avoid */
  --pc-rose-bg:   #FFF1F2;
  --pc-emerald:   #047857;   /* good / preferred */
  --pc-emerald-bg:#ECFDF5;
  --pc-radius:    0.75rem;

  background: var(--pc-bg);
  color: var(--pc-ink);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
}

.pc h1, .pc h2, .pc h3, .pc h4 {
  font-family: "Poppins", "Inter", ui-sans-serif, system-ui, sans-serif;
  color: var(--pc-ink);
  letter-spacing: -0.02em;
}

/* ===== page furniture ===== */
.pc-wrap    { max-width: 74rem; margin: 0 auto; padding: 0 1rem; }
.pc-narrow  { max-width: 52rem; margin: 0 auto; padding: 0 1rem; }

/* The masthead. A hairline rule, not a coloured band: the catalog opens on the
   same white the content sits on, so nothing competes with the first pattern. */
.pc-masthead { border-bottom: 1px solid var(--pc-line); background: var(--pc-bg); padding: 3.5rem 0 2.25rem; }
.pc-eyebrow  { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--pc-ink-3); }
.pc-h1       { font-size: 2.25rem; font-weight: 800; line-height: 1.15; margin: 0.6rem 0 0.75rem; }
.pc-lede     { font-size: 1.0625rem; line-height: 1.65; color: var(--pc-ink-2); max-width: 44rem; }

.pc-crumb    { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8125rem; font-weight: 600; color: var(--pc-ink-3); text-decoration: none; }
.pc-crumb:hover { color: var(--pc-accent); }

/* ===== search + facets ===== */
.pc-search {
  width: 100%; padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--pc-line-2); border-radius: var(--pc-radius);
  font-size: 0.9375rem; color: var(--pc-ink); background: var(--pc-bg);
}
.pc-search:focus { outline: 2px solid var(--pc-accent); outline-offset: 1px; border-color: var(--pc-accent); }
.pc-search::placeholder { color: var(--pc-ink-4); }

.pc-facet-group  { margin-bottom: 0.9rem; }
.pc-facet-label  { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--pc-ink-4); margin-bottom: 0.4rem; }
.pc-facet {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.65rem;
  border: 1px solid var(--pc-line-2); border-radius: 9999px;
  color: var(--pc-ink-2); background: var(--pc-bg); cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.pc-facet:hover    { border-color: var(--pc-accent); color: var(--pc-accent); }
.pc-facet[aria-pressed="true"] { background: var(--pc-accent); border-color: var(--pc-accent); color: #fff; }
.pc-facet-n        { font-size: 0.6875rem; color: var(--pc-ink-4); font-weight: 500; }
.pc-facet[aria-pressed="true"] .pc-facet-n { color: rgba(255,255,255,0.75); }

/* ===== cards ===== */
.pc-grid { display: grid; grid-template-columns: repeat(1, minmax(0,1fr)); gap: 1rem; }
@media (min-width: 640px)  { .pc-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px) { .pc-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }

.pc-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--pc-line); border-radius: var(--pc-radius);
  background: var(--pc-bg); padding: 1.15rem 1.15rem 1rem;
  text-decoration: none; color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.pc-card:hover { border-color: var(--pc-line-2); box-shadow: 0 6px 20px -12px rgba(17,24,39,0.25); transform: translateY(-1px); }
.pc-card.hidden { display: none; }
.pc-card-kind  { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--pc-ink-4); }
.pc-card-title { font-size: 1rem; font-weight: 700; margin: 0.35rem 0 0.3rem; line-height: 1.3; }
.pc-card:hover .pc-card-title { color: var(--pc-accent); }
.pc-card-sum   { font-size: 0.8125rem; line-height: 1.55; color: var(--pc-ink-3); flex: 1; }
.pc-card-foot  { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.85rem; flex-wrap: wrap; }

/* A tag is not a status. Neutral by design — see the colour budget above. */
.pc-tag {
  font-size: 0.625rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 0.1rem 0.45rem; border-radius: 0.35rem;
  background: var(--pc-bg-3); color: var(--pc-ink-3);
}

/* ===== family list ===== */
.pc-fam {
  display: block; padding: 1rem 1.1rem;
  border: 1px solid var(--pc-line); border-radius: var(--pc-radius);
  text-decoration: none; color: inherit; background: var(--pc-bg);
  transition: border-color .15s ease, background .15s ease;
}
.pc-fam:hover     { border-color: var(--pc-accent); background: var(--pc-accent-bg); }
.pc-fam-name      { font-weight: 700; font-size: 0.9375rem; }
.pc-fam-q         { font-size: 0.8125rem; color: var(--pc-ink-3); margin-top: 0.2rem; line-height: 1.5; }
.pc-fam-n         { font-size: 0.6875rem; color: var(--pc-ink-4); font-weight: 600; }

/* ===== callouts — one meaning per colour, and always a word too ===== */
.pc-note { border: 1px solid var(--pc-line); border-left-width: 3px; border-radius: 0.5rem; padding: 0.85rem 1rem; font-size: 0.875rem; line-height: 1.6; background: var(--pc-bg-2); }
.pc-note-title { font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem; }
.pc-note-use    { border-left-color: var(--pc-emerald); background: var(--pc-emerald-bg); }
.pc-note-use    .pc-note-title { color: var(--pc-emerald); }
.pc-note-avoid  { border-left-color: var(--pc-rose); background: var(--pc-rose-bg); }
.pc-note-avoid  .pc-note-title { color: var(--pc-rose); }
.pc-note-watch  { border-left-color: var(--pc-amber); background: var(--pc-amber-bg); }
.pc-note-watch  .pc-note-title { color: var(--pc-amber); }

/* ===== demo frame ===== */
.pc-demo      { border: 1px solid var(--pc-line); border-radius: var(--pc-radius); overflow: hidden; background: var(--pc-bg); }
.pc-demo-bar  { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.85rem; background: var(--pc-bg-2); border-bottom: 1px solid var(--pc-line); }
.pc-demo-bar span.pc-demo-label { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--pc-ink-3); }
.pc-demo iframe { display: block; width: 100%; border: 0; }

/* ===== the Ask Leo block ===== */
.pc-leo      { border: 1px solid var(--pc-line-2); border-radius: var(--pc-radius); overflow: hidden; }
.pc-leo-bar  { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.85rem; background: var(--pc-bg-3); border-bottom: 1px solid var(--pc-line); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--pc-ink-3); }
.pc-leo pre  { margin: 0; padding: 1rem; background: var(--pc-bg-2); font-size: 0.8125rem; line-height: 1.6; white-space: pre-wrap; color: var(--pc-ink-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pc-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; font-weight: 600; padding: 0.3rem 0.7rem;
  border: 1px solid var(--pc-line-2); border-radius: 0.5rem;
  background: var(--pc-bg); color: var(--pc-ink-2); cursor: pointer;
}
.pc-btn:hover { border-color: var(--pc-accent); color: var(--pc-accent); }

/* ===== article body =====
   The entry body is markdown rendered to plain HTML (server-side by
   RenderedMarkdown, or by marked.js as a fallback), so it arrives as bare
   h2/p/ul/table with no classes. Style it here rather than reaching for the
   `prose` plugin, which is themed for the dark remap elsewhere. */
.pc-body { font-size: 0.9375rem; line-height: 1.75; color: var(--pc-ink-2); }
.pc-body > *:first-child { margin-top: 0; }
.pc-body h2 { font-size: 1.375rem; font-weight: 800; margin: 2.25rem 0 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--pc-line); }
.pc-body h2:first-of-type { border-top: 0; padding-top: 0; }
.pc-body h3 { font-size: 1.0625rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.pc-body h4 { font-size: 0.9375rem; font-weight: 700; margin: 1.25rem 0 0.4rem; color: var(--pc-ink-2); }
.pc-body p  { margin: 0.75rem 0; }
.pc-body ul, .pc-body ol { margin: 0.75rem 0; padding-left: 1.35rem; }
.pc-body li { margin: 0.3rem 0; }
.pc-body a  { color: var(--pc-accent); text-decoration: underline; text-underline-offset: 2px; }
.pc-body strong { color: var(--pc-ink); font-weight: 650; }
.pc-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em; background: var(--pc-bg-3); color: var(--pc-ink);
  padding: 0.1em 0.35em; border-radius: 0.3rem;
}
/* The ASCII anatomy diagram. It has to survive as plain text in the raw .md
   Leo reads, so it is a code block here and must not wrap or re-flow. */
.pc-body pre {
  background: var(--pc-bg-2); border: 1px solid var(--pc-line);
  border-radius: 0.6rem; padding: 1rem; overflow-x: auto;
  font-size: 0.8125rem; line-height: 1.5; color: var(--pc-ink);
}
.pc-body pre code { background: none; padding: 0; font-size: inherit; }
.pc-body blockquote {
  margin: 1rem 0; padding: 0.6rem 0 0.6rem 1rem;
  border-left: 3px solid var(--pc-line-2); color: var(--pc-ink-3);
}
/* Wide tables scroll inside their own box; the page never scrolls sideways. */
.pc-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.875rem; display: block; overflow-x: auto; }
.pc-body th { text-align: left; font-weight: 700; color: var(--pc-ink); border-bottom: 2px solid var(--pc-line-2); padding: 0.5rem 0.75rem 0.5rem 0; }
.pc-body td { border-bottom: 1px solid var(--pc-line); padding: 0.5rem 0.75rem 0.5rem 0; vertical-align: top; }
.pc-body hr { border: 0; border-top: 1px solid var(--pc-line); margin: 2rem 0; }
