/*
 * specimen.css — the page's own CSS, and nothing else's.
 *
 * This file exists to be honest about a thing every design system elides: the
 * documentation page always needs more than the system provides. Rather than
 * quietly growing chapbook.css until it covers tables, tab groups and
 * swatches that no real site needs, the extras live here, scoped to this page.
 *
 * That is also the recommended pattern for using the system. Take
 * chapbook.css unchanged, add a file like this one beside it, and keep the
 * two separate so you can always see what you added.
 *
 * Everything below obeys the nine rules. No radius, no shadow, no fill except
 * --sunk; hairlines and space do the separating; mono carries structure.
 */

/* The nine rules ---------------------------------------------------------- */
/* A row anatomy without a row's affordances — nothing here is a link, so
   nothing here gets a hover fill or a redrawing hairline. */

.rules { border-top: 1px solid var(--rule); }

.rule {
  padding: 1.5rem 0 1.6rem;
  border-bottom: 1px solid var(--rule);
}

.rule-n {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  color: var(--accent);
}

.rule-title {
  margin-top: 0.45rem;
  max-width: 26ch;
  font-family: var(--display);
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.rule-body {
  margin-top: 0.7rem;
  max-width: var(--measure);
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.55;
  text-wrap: pretty;
}

/* The implementation line. Mono, because it says what kind of thing the rule
   is rather than what the rule means. */
.rule-spec {
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.7;
  color: var(--faint);
  word-break: break-word;
}

.rule-body code,
.rule-spec code,
.small code,
.lede code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--ink);
}

/* The skin picker --------------------------------------------------------- */
/* Rule 08: these do something, so they are bordered controls rather than more
   words in a row of words. */

.skinpick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--rule);
}

/* The skin picker's own label spacing. The buttons themselves are .btn and
   live in the system now; only this page's arrangement of them is here. */
.skinnote { margin-top: 1.1rem; }
.skinnote b { color: var(--ink); font-weight: 500; }

/* A swatch, sized to the mono cap height so it sits on the baseline of the
   hex value beside it rather than floating above it. */
.chip {
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  margin-right: 0.5rem;
  background: var(--c);
  border: 1px solid var(--rule);
  vertical-align: -1px;
}

/* Print ------------------------------------------------------------------- */
/* The skin picker does nothing on paper. The panels do — all of them open, so
   a printed copy carries every palette rather than whichever one happened to
   be on screen. */

/* --- For / not for -------------------------------------------------------
   Two stacks of the same row. No fill and no border box around either column:
   the hairline between rows is the only separation, which is Rule 02 applied
   to a component that every other system would have drawn as two cards. */

.forpair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0 2.5rem;
  margin-top: 1.75rem;
}

.forcol .label { margin-bottom: 0.35rem; }

.forrow {
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule);
}

.forcol .forrow:first-of-type { border-top: 2px solid var(--ink); }

.forrow-t {
  margin: 0;
  color: var(--ink);
}

.forrow-d {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* The one sentence the page is willing to be reduced to. A 2px rule opens it,
   which is the weight the system reserves for opening a document. */
.claim {
  margin-top: 2rem;
  padding-top: 1.35rem;
  border-top: 2px solid var(--ink);
  max-width: var(--measure);
  font-size: 1.0625rem;
  color: var(--ink);
  text-wrap: pretty;
}

@media print {
  .skinpick { display: none !important; }
  .skinpanel { display: block !important; }
  .skinpanel[hidden] { display: block !important; }
  .rule,
  .forrow,
  .claim { break-inside: avoid; }

  /* Two columns at 174mm of text gives about 46 characters a line, which is
     below the floor a measure should hold. On paper the pair becomes one
     column and the two lists read in sequence — For, then Not for, which is
     the order they are argued in anyway. */
  .forpair { display: block; }
  .forcol + .forcol { margin-top: 1.25rem; }

}
