/* Docs only (kit- prefix): example frames and code blocks. Not part of the kit. */
.kit-demo {
  margin: 1rem 0 0;
  padding: 1.5rem;
  border: 1px solid var(--cmu-line);
  border-bottom: 0;
  display: flow-root; /* keep floated photos inside the box */
  background: #fff;
}
/* Room above a section heading's rule-top line, so the line doesn't crowd a
   table or code block above it */
#content > .content > div > h2.rule-top {
  margin-top: 2rem;
}
/* The template zeroes padding on a section's first and last element; code
   samples keep theirs */
#content .kit-code {
  padding: 1rem 1.25rem;
}
/* After a band with a background, the change of color marks the next
   section, so its heading needs no line */
#content
  > :is(
    .kit-demo--banded,
    .content:is(.grey, .cmu-lightgrey, .darkgrey, .red, .gold, .blue, .teal, .green, .darkgreen)
  )
  + .content
  > div
  > h2.rule-top:first-child {
  border-top: 0;
}
/* A wide example is a real section of the page: no box around it */
.kit-demo--wide {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
/* Examples side by side, wrapping on phones */
.kit-demo--row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}
.kit-demo--row > * {
  flex: 1 1 15rem;
  min-width: 0;
  margin: 0;
}
.kit-demo--row img {
  width: 100%;
  height: auto;
}
/* Beside a screenshot in a browser window, a figure without one drops by
   the window's bar (1.6rem), so the images' tops line up */
.kit-demo--row:has(> .cmu-shot--browser) > figure:not(.cmu-shot--browser) {
  margin-top: 1.6rem;
}
.kit-demo > :last-child:not(dialog) {
  margin-bottom: 0;
}
.kit-code {
  margin: 0 0 2.5rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  background: var(--cmu-tint);
  border: 1px solid var(--cmu-line);
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre;
}
.kit-code code {
  font-family: Menlo, Consolas, monospace;
  background: none;
}
/* An open <dialog> shown in place, as a picture of the real one */
.kit-demo dialog[open].kit-inline {
  position: static;
  margin: 0;
  max-width: 100%;
}
.kit-classes::before {
  content: "Classes: ";
  color: var(--cmu-muted);
}
.kit-classes {
  margin: 0 0 0.5rem;
  color: var(--cmu-muted);
  font-size: 0.9rem;
}
.kit-classes code {
  color: var(--cmu-ink);
}
.cmu-steps .kit-code {
  margin: 0.5rem 0 0;
}
/* A chart of colors or patterns: framed like an example, with its code below */
.kit-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 1.5rem;
  border: 1px solid var(--cmu-line);
  border-bottom: 0;
  background: #fff;
}
.kit-swatches > div {
  padding: 1.5rem 0.75rem 0.5rem;
  font-size: 0.85rem;
}
/* Background patterns: three to a row, wide enough to see the pattern */
.kit-swatches--tall {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 600px) {
  .kit-swatches--tall {
    grid-template-columns: minmax(0, 1fr);
  }
}
.kit-swatches--tall > div {
  min-height: 9rem;
}
/* Try the Header's "Try It" eyebrow takes the section's rule, with room
   between them, since its small text has none of a heading's line height */
#content .cmu-eyebrow.rule-top {
  margin-top: 2rem;
  padding-top: 0.9rem;
}
/* Try the Header: a form of radio buttons and checkboxes in three groups
   side by side, at full size like any form */
.kit-try {
  font-size: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0 2rem;
  align-items: start;
  margin: 0 0 1.5rem;
}
.kit-try > p {
  grid-column: 1 / -1;
}

/* The countdown's Try a Date line, with its option on a line of its own */
.kit-try-date {
  margin: 0 0 1.5rem;
  line-height: 2.4;
}
/* Inline here; the template makes labels blocks */
#content .kit-try-date label {
  display: inline;
  margin-right: 0.5rem;
  font-weight: 700;
}

/* Example code: each line wraps, its continuation hanging four characters in
   from where the line starts (docs.js sets the padding from its indent) */
/* The newlines between lines are for copying; the lines are blocks */
#content .kit-code code:has(> .kit-line) {
  white-space: normal;
}
#content .kit-code .kit-line {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere; /* docs.js sets the padding and the matching text-indent */
}
#content .kit-code .kit-line:empty::before {
  content: " ";
}

/* What a component needs, after its heading's name: Template, CMS
   (cmu-cms.css) or App (cmu-app.css), and Script when it needs cmu-app.js. Shaped like the kit's
   pills (cmu-pill) */
.kit-where {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: 0.5rem;
  vertical-align: middle;
  font-family: "Open Sans", Helvetica, sans-serif;
  line-height: 1.4;
}
.kit-where span {
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: help;
}
.kit-where-template {
  background: var(--cmu-gray-tint);
  color: var(--cmu-gray);
}
.kit-where-cms {
  background: var(--cmu-blue-tint);
  color: var(--cmu-blue);
}
.kit-where-app {
  background: var(--cmu-green-tint);
  color: var(--cmu-green);
}
.kit-where-script {
  background: var(--cmu-amber-tint);
  color: var(--cmu-amber);
}
/* The same labels in running text, as a key */
.kit-key {
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
/* A heading's last word and its labels, kept on one line (docs.js) */
.kit-keep {
  white-space: nowrap;
}
.kit-keep .kit-where {
  white-space: normal;
}
