/* The showcase's own furniture (/work/showcase, app/views/showcase/). Never used by app markup. */

.sg-page { max-width: 72rem; margin: 0 auto; padding: var(--space-6) var(--space-4) 8rem; }
.sg-page > header { max-width: var(--measure); margin: 0 auto var(--space-7); font-size: var(--size-text); line-height: var(--leading); text-align: center; }
.sg-title { font-size: 2em; font-weight: 400; font-variant-caps: all-small-caps; letter-spacing: var(--tracking-caps-wide); }
.sg-lede { margin-top: var(--space-4); }

.sg-section { margin-top: var(--space-7); padding-top: var(--space-5); border-top: var(--stroke-hair) solid var(--color-rule); }
.sg-heading { margin-bottom: var(--space-5); font-size: 1.4rem; font-weight: 400; font-variant-caps: all-small-caps; letter-spacing: var(--tracking-caps); text-align: center; }
.sg-subheading { margin: var(--space-6) 0 var(--space-3); font-size: 1.15rem; font-weight: 400; font-style: italic; }
.sg-note { max-width: var(--measure); margin-bottom: var(--space-4); color: var(--color-ink-muted); font-style: italic; }

/* A specimen: the class or token name in monospace above the thing itself. */
.sg-specimen { margin-bottom: var(--space-5); }
.sg-label { display: block; margin-bottom: var(--space-2); color: var(--color-ink-muted); font-family: var(--font-mono); font-size: 0.8rem; overflow-wrap: anywhere; }
.sg-text { font-size: var(--size-text); line-height: var(--leading); }

.sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: var(--space-4); padding: 0; list-style: none; }
.sg-swatch { display: flex; align-items: center; gap: var(--space-3); }
.sg-swatch__chip { flex: none; width: 3rem; height: 3rem; border: var(--stroke-hair) solid var(--color-rule); }
.sg-swatch__chip[data-swatch='paper'] { background: var(--color-paper); }
.sg-swatch__chip[data-swatch='ink'] { background: var(--color-ink); }
.sg-swatch__chip[data-swatch='ink-muted'] { background: var(--color-ink-muted); }
.sg-swatch__chip[data-swatch='rule'] { background: var(--color-rule); }
.sg-swatch__chip[data-swatch='rule-faint'] { background: var(--color-rule-faint); }
.sg-swatch__chip[data-swatch='link'] { background: var(--color-link); }
.sg-swatch__chip[data-swatch='link-missing'] { background: var(--color-link-missing); }
.sg-swatch__chip[data-swatch='current'] { background: var(--color-current); }
.sg-swatch__chip[data-swatch='code-background'] { background: var(--color-code-background); }
.sg-swatch__chip[data-swatch='mark'] { background: var(--color-mark); }
.sg-swatch__chip[data-swatch='target'] { background: var(--color-target); }
.sg-swatch__chip[data-swatch='error-background'] { background: var(--color-error-background); }
.sg-swatch__chip[data-swatch='paper-grain'] { background-color: var(--color-paper); background-image: var(--paper-grain); }

.sg-table { border-collapse: collapse; border-block: var(--stroke-table) solid var(--color-ink); font-size: 0.95rem; font-variant-numeric: lining-nums tabular-nums; }
.sg-table :is(th, td) { padding: 0.35em 0.8em; text-align: left; vertical-align: baseline; }
.sg-table th { border-bottom: var(--stroke-hair) solid var(--color-ink); font-weight: 600; }
.sg-table tbody tr + tr td { border-top: var(--stroke-hair) solid var(--color-rule-faint); }
.sg-table-wrap { max-width: 100%; overflow-x: auto; }

/* A composed page. The frame is a containing block for position: fixed (transform does that), so the work layout's fixed sidebar
   and panels stay inside it; the media queries still answer to the window, as they will on the real page. */
.sg-surface { margin-top: var(--space-7); }
.sg-surface__name { font-size: 1.2rem; font-weight: 400; font-style: italic; }
.sg-surface__uses { margin: var(--space-1) 0 var(--space-3); color: var(--color-ink-muted); font-family: var(--font-mono); font-size: 0.8rem; overflow-wrap: anywhere; }
.sg-frame { position: relative; overflow: hidden; border: var(--stroke-hair) solid var(--color-rule); background-color: var(--color-paper); background-image: var(--paper-grain); transform: translateZ(0); }
.sg-frame--work { min-height: 36rem; }
.sg-frame .c-page { padding-bottom: var(--space-6); }
/* A frame as wide as the window, out of the showcase's column, for a page whose list is fixed at the window's right edge
   (c-toc--book). */
.sg-frame--window { width: 100vw; min-height: 34rem; margin-left: calc(50% - 50vw); border-inline: 0; }
body:has(.sg-frame--window) { overflow-x: clip; } /* 100vw counts a classic scrollbar too */

/* On a phone a frame spans the whole window, as the page it shows would; with the page's side padding and borders the story index
   title would have less room than on the real page and wrap. */
@media (max-width: 36rem) {
  .sg-frame { margin-inline: calc(-1 * var(--space-4)); border-inline: 0; }
}
