/* 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;
}
/* A banded wide example's code and notes join its grid: a row each */
#content .kit-demo--wide .grid > :is(.kit-code, .cmu-note) {
  flex: 0 0 100%;
  min-width: 0; /* long lines scroll instead of widening the row */
}
/* Code in a dark band keeps dark text on its light box (invert whitens it) */
#content .invert .kit-code,
#content .invert .kit-code code {
  color: var(--cmu-ink);
}
/* 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, .darkgrey, .red, .gold, .blue, .teal, .green, .darkgreen)
  )
  + .content
  > div
  > h2.rule-top:first-child {
  border-top: 0;
}
/* Code under a testimonial in its band */
.cmu-testimonial + .kit-code {
  margin-top: 2rem;
}
/* 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;
}
.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;
}
.kit-swatches--tall > div {
  min-height: 7rem;
}
.kit-try {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--cmu-line);
}
.kit-try > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.kit-try .cmu-label {
  min-width: 13rem;
}
.kit-try .btn {
  margin: 0;
}
/* The countdown example's date field */
.kit-try-date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1.5rem;
}
.kit-try-date label {
  font-weight: 700;
}
