/* Shared quickstart box and chip row (templates/public/_quickstart_box.html
 * and the compare kit, driven by quickstart.js) on model and compare pages.
 * The panel, header strip, Copy button, code colours and scroll chevrons
 * come from the shared code block in content-layout.css (.tr-code-head,
 * .tr-code-tools, .tr-code-copy, .tr-code-body); this sheet only adds what
 * the box has of its own: kit Tabs in the strip, the footer, and the phone
 * prompt fold. The chip row scrolls with the shared sideways-scroll
 * chevrons. */

/* Quickstart code box */
.md-code {
  position: relative;
  overflow: hidden;
}

/* Kit Tabs in the strip instead of a label. */
.md-tabs {
  display: flex;
  align-self: stretch;
  gap: 24px;
}

.md-tabs button {
  height: 48px;
  min-height: 48px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--tr-code-muted);
  font: 500 14px/1.2 "ABC Pelikan Condensed", "Arial Narrow", var(--tr-font-family-sans, Archivo, Arial, sans-serif);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.md-tabs button[aria-selected="true"] {
  border-bottom-color: var(--tr-code-cream);
  color: var(--tr-code-cream);
}

.md-tabs button:focus-visible,
.md-expand:focus-visible {
  outline: 2px solid var(--tr-code-cream);
  outline-offset: -4px;
}

/* Tabs need script; without it every panel shows, labelled by its tab. */
html:not(.js-off) .md-code-panel[data-md-inactive] {
  display: none;
}

.js-off .md-copy,
.js-off .md-tabs button[aria-selected="false"] {
  display: none;
}

.js-off .md-code-panel + .md-code-panel {
  border-top: 1.5px solid var(--tr-code-rule);
}

.md-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--tr-code-ink);
  color: var(--tr-code-cream);
  cursor: pointer;
}

.md-expand[hidden] {
  display: none;
}

.md-expand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--tr-code-rule);
  border-radius: 50%;
  background: var(--tr-code-ink);
  transition: transform 160ms ease;
}

.md-expand[aria-expanded="true"] .md-expand-icon {
  transform: rotate(180deg);
}

/* The footer sits on the page below the panel. */
.md-code-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 0;
  font-size: 16px;
}

.md-code-foot .btn.md-cta-small {
  min-height: 44px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 650;
  white-space: nowrap;
}

/* Chip row: one sideways-scrolling row. */
.md-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 8px;
  scrollbar-width: none;
}

.md-chips::-webkit-scrollbar {
  display: none;
}

.md-chips-wrap .md-chips a {
  flex: none;
  padding: 9px 16px;
  border: 1px solid var(--md-line-strong, #33403A);
  border-radius: 999px;
  color: var(--md-text, #EDF8F5);
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
}

.md-chips-wrap .md-chips a:hover {
  border-color: var(--md-accent, #CCE8D7);
  color: var(--md-text, #EDF8F5);
}

/* Phones */
@media (max-width: 760px) {
  .md-tabs {
    gap: 20px;
  }

  .md-code-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    font-size: 15px;
  }

  .md-code-foot .btn.md-cta-small {
    min-height: 48px;
    width: 100%;
    justify-content: center;
  }

  /* Bleeds to the screen edge across a 20px page gutter. */
  .md-chips {
    gap: 8px;
    margin: 0 -20px;
    padding: 0 20px 8px;
  }

  .md-chips-wrap .md-chips a {
    padding: 10px 14px;
    font-size: 15px;
  }
}

/* Phones under 640px show the start of the prompt until the reader expands
 * it, ending at a straight edge (the kit has no fades). Script adds
 * .md-collapsible, so without it the whole prompt shows. */
@media (max-width: 639px) {
  .md-code.md-collapsible:not(.md-expanded) .md-code-body {
    max-height: 132px;
    overflow-y: hidden;
  }
}
