/*
  LOBEE.CA — Design-system docs helpers (prefix ds-)
  Loaded ONLY by example.html (HTML Library), after lobee.css and lobee-nebula.css:
    <link href="/assets/css/lobee-docs.css?v=docs5" rel="stylesheet">
  Uses the tokens from lobee.css. Keep it off every other page (speed).
  Demo helpers ONLY. The Library's text, headings, Contents, tables, lists, callouts and code
  blocks are the shared post components from lobee.css (document-post layout, same as the CSC108
  guide); nothing here restyles them. Live demos sit between .prose blocks inside article.post.
  Spacing rule: token-only, same as lobee.css. The fixed sizes in the demo helpers (swatch chips,
  spacing bars, radius tiles, width bars) are intentional.
  After ANY edit: bump the ?v= tag (docs5 -> docs6 ...) in example.html (1-year immutable cache).
*/

/* A .prose block that follows a demo and opens with a heading keeps the heading's normal top gap
   (.prose > :first-child zeroes it), so the rhythm is the same as one continuous .prose */
.post > :not(.prose) + .prose > h2:first-child { margin-top: var(--flow-h2); }
.post > :not(.prose) + .prose > :is(h3, h2.prose-h3):first-child { margin-top: var(--flow-h3); }
.ds-demo { min-width: 0; margin-block: var(--flow-block); padding: var(--pad-inset); border: 1px dashed var(--color-border); border-radius: var(--radius-md); }
.ds-demo > .page-header-block { margin-bottom: 0; }
.ds-demo > .btn-back { margin-bottom: 0; }
.ds-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.ds-btn { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--pad-control); font-size: var(--text-sm); font-weight: 600; color: var(--color-text); text-decoration: none; }
.ds-btn--accent { color: #fff; }
.ds-panel { padding: var(--pad-inset); }
.ds-themes { display: grid; gap: var(--space-4); margin-block: var(--flow-block); }
@media (min-width: 720px) { .ds-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ds-theme { min-width: 0; padding: var(--pad-inset); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-canvas); color: var(--color-text); }
.ds-theme > h3 { margin: 0 0 var(--flow-heading); font-size: var(--text-sm); }
.ds-sws { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.25rem, 1fr)); gap: var(--space-3); list-style: none; }
.ds-sw { min-width: 0; font-size: var(--text-xs); line-height: 1.35; color: var(--color-text-muted); }
.ds-sw__chip { display: block; height: 2.5rem; margin-bottom: var(--space-1); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.ds-sw__name { display: block; font-family: var(--font-mono); color: var(--color-text); overflow-wrap: anywhere; }
.ds-sw__val { display: block; font-family: var(--font-mono); overflow-wrap: anywhere; }
.ds-c-bg { background: var(--color-bg); }
.ds-c-canvas { background: var(--color-canvas); }
.ds-c-surface { background: var(--color-surface); }
.ds-c-surface-2 { background: var(--color-surface-2); }
.ds-c-border { background: var(--color-border); }
.ds-c-divider { background: var(--color-divider); }
.ds-c-text { background: var(--color-text); }
.ds-c-text-muted { background: var(--color-text-muted); }
.ds-c-text-faint { background: var(--color-text-faint); }
.ds-c-accent { background: var(--color-accent); }
.ds-c-accent-hover { background: var(--color-accent-hover); }
.ds-c-accent-bg { background: var(--color-accent-bg); }
.ds-c-accent-border { background: var(--color-accent-border); }
.ds-c-header-bg { background: var(--color-header-bg); }
.ds-c-face-top { background: var(--btn-3d-face-top); }
.ds-c-face-bottom { background: var(--btn-3d-face-bottom); }
.ds-c-side { background: var(--btn-3d-side); }
.ds-c-3d-border { background: var(--btn-3d-border); }
.ds-c-accent-top { background: var(--btn-3d-accent-top); }
.ds-c-accent-bottom { background: var(--btn-3d-accent-bottom); }
.ds-sh { height: 2.75rem; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); font-size: var(--text-xs); line-height: 2.75rem; text-align: center; color: var(--color-text-muted); }
.ds-sh-sm { box-shadow: var(--shadow-sm); }
.ds-sh-md { box-shadow: var(--shadow-md); }
.ds-sh-lg { box-shadow: var(--shadow-lg); }
.ds-shs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
.ds-t-xs { font-size: var(--text-xs); }
.ds-t-sm { font-size: var(--text-sm); }
.ds-t-base { font-size: var(--text-base); }
.ds-t-lg { font-size: var(--text-lg); }
.ds-t-xl { font-size: var(--text-xl); }
.ds-t-2xl { font-size: var(--text-2xl); }
.ds-sp { display: block; height: 0.75rem; border-radius: var(--radius-sm); background: var(--color-accent); }
.ds-sp-0_5 { width: var(--space-0_5); }
.ds-sp-1 { width: var(--space-1); }
.ds-sp-2 { width: var(--space-2); }
.ds-sp-3 { width: var(--space-3); }
.ds-sp-4 { width: var(--space-4); }
.ds-sp-5 { width: var(--space-5); }
.ds-sp-6 { width: var(--space-6); }
.ds-sp-8 { width: var(--space-8); }
.ds-sp-10 { width: var(--space-10); }
.ds-sp-12 { width: var(--space-12); }
.ds-sp-16 { width: var(--space-16); }
.ds-sp-20 { width: var(--space-20); }
.ds-rad { display: block; width: 4.5rem; height: 3rem; border: 1px solid var(--color-accent-border); background: var(--color-accent-bg); }
.ds-r-sm { border-radius: var(--radius-sm); }
.ds-r-md { border-radius: var(--radius-md); }
.ds-r-lg { border-radius: var(--radius-lg); }
.ds-r-xl { border-radius: var(--radius-xl); }
.ds-r-full { border-radius: var(--radius-full); }
.ds-w { height: 1.5rem; margin-bottom: var(--space-2); border-radius: var(--radius-sm); background: var(--color-accent-bg); border: 1px solid var(--color-accent-border); font-size: var(--text-xs); line-height: 1.4rem; padding-inline: var(--space-2); color: var(--color-text); }
.ds-w-narrow { max-width: var(--content-narrow); }
.ds-w-default { max-width: var(--content-default); }
.ds-w-wide { max-width: var(--content-wide); }
