/* Style-guide page (/style/) — specimen scaffolding only.
   The components on show come from style.css; these rules just lay out the
   swatches, the type scale, the spec captions, and the demo-panel reproduction.
   Everything is scoped under .styleguide and this file is linked only on the
   one page, so it never touches the rest of the site. */

.styleguide .sg-head { margin-bottom: 3rem; max-width: 660px; }
.styleguide .sg-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}
.styleguide .sg-lede { font-size: 1.08rem; line-height: 1.6; }

.styleguide code {
  font-size: 0.9em;
  padding: 0.05em 0.32em;
  border: 1px solid var(--border-color);
}

.styleguide .sg-section { margin: 3.5rem 0; }
.styleguide .sg-section > p { max-width: 640px; line-height: 1.6; margin-bottom: 1rem; }
.styleguide .sg-h3 {
  font-size: 0.82rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin: 2rem 0 1rem;
}
.styleguide .sg-note { color: var(--text-light); font-size: 0.92rem; line-height: 1.55; max-width: 640px; }
.styleguide .sg-spec { color: var(--text-light); font-size: 0.78rem; letter-spacing: 0.02em; }
.styleguide .sg-arrow, .styleguide .sg-ast { color: var(--text-light); }

/* Principles — em-dash list */
.styleguide .sg-list { display: flex; flex-direction: column; gap: 0.7rem; max-width: 660px; }
.styleguide .sg-list li { line-height: 1.5; padding-left: 1.3rem; position: relative; }
.styleguide .sg-list li::before { content: "*"; position: absolute; left: 0; color: var(--text-light); }

/* Type — weights + scale */
.styleguide .sg-weights { display: flex; flex-direction: column; gap: 0.45rem; margin: 1.5rem 0; }
.styleguide .sg-weight { font-size: 1.35rem; margin: 0; }

.styleguide .sg-scale {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.4rem;
}
.styleguide .sg-scale-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.styleguide .sg-scale-sample { min-width: 0; }
.styleguide .sg-scale-sample > * { margin: 0; }
.styleguide .sg-scale-row .sg-spec { flex: 0 0 auto; text-align: right; }
.styleguide .sg-display { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 400; letter-spacing: -0.025em; line-height: 1.05; }
.styleguide .sg-reading { font-size: 1.08rem; line-height: 1.65; }
.styleguide .sg-ui { font-size: 0.85rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.05em; }
.styleguide .sg-micro { font-size: 0.7rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light); }

/* Colour — swatches + roles */
.styleguide .sg-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.styleguide .sg-swatch { display: flex; flex-direction: column; gap: 0.5rem; }
.styleguide .sg-chip { height: 72px; border: 1px solid var(--border-color); }
.styleguide .sg-chip-meta { display: flex; flex-direction: column; gap: 0.15rem; }
.styleguide .sg-chip-meta strong { font-size: 0.9rem; font-weight: 400; }
.styleguide .sg-chip-meta code { border: 0; padding: 0; font-size: 0.8rem; color: var(--text-light); }

.styleguide .sg-table { border-collapse: collapse; width: 100%; max-width: 560px; margin: 1rem 0; }
.styleguide .sg-table td { padding: 0.5rem 1rem 0.5rem 0; border-bottom: 1px solid var(--border-color); vertical-align: baseline; }
.styleguide .sg-table code { border: 0; padding: 0; }

/* Space — scale bars */
.styleguide .sg-bars { display: flex; flex-direction: column; gap: 0.75rem; margin: 1.25rem 0; }
.styleguide .sg-bar-row { display: flex; align-items: center; gap: 1rem; }
.styleguide .sg-bar { height: 1rem; background: var(--text-color); flex: 0 0 auto; }

/* Motifs */
.styleguide .sg-motifs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem 2rem;
  margin-top: 1.25rem;
}
.styleguide .sg-motif { display: flex; flex-direction: column; gap: 0.6rem; }
.styleguide .sg-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 1rem;
  border: 1px solid var(--border-color);
}
.styleguide .sg-ast-lg { color: var(--text-light); letter-spacing: 0.5em; }
.styleguide .sg-arrow-link { border-bottom: 1px solid var(--text-color); }
.styleguide .sg-arrow-link::after { content: " \2192"; color: var(--text-light); }
.styleguide .sg-hairline { display: block; width: 100%; border-top: 1px solid var(--border-color); }

/* Demo control panel — faithful reproduction of the canvas-demo chrome,
   built from the site tokens so it inverts with the theme. */
.styleguide .sg-panel {
  width: 190px;
  padding: 10px 11px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  font-size: 12px;
  line-height: 1.3;
  user-select: none;
}
.styleguide .sg-panel-buttons { display: flex; gap: 6px; margin-bottom: 9px; }
.styleguide .sg-panel button {
  flex: 1;
  font: inherit;
  color: var(--text-color);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 2px 0;
  cursor: pointer;
  transition: border-color 0.15s linear;
}
.styleguide .sg-panel button:hover { border-color: var(--text-color); }
/* Chrome labels are uppercase + tracked, even in the compact demo panel
   (House Style Ruling 2: no lowercase tier). Values stay as data. */
.styleguide .sg-panel button,
.styleguide .sg-panel-lab > span:first-child { text-transform: uppercase; letter-spacing: 0.06em; }
.styleguide .sg-panel-control { display: block; }
.styleguide .sg-panel-lab { display: flex; justify-content: space-between; margin-bottom: 3px; }
.styleguide .sg-panel-val { font-weight: 400; }
.styleguide .sg-panel input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  background: transparent;
  cursor: pointer;
}
.styleguide .sg-panel input[type=range]::-webkit-slider-runnable-track { height: 1px; background: var(--border-color); }
.styleguide .sg-panel input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -5px;
  background: var(--text-color);
  border-radius: 50%;
}
.styleguide .sg-panel input[type=range]::-moz-range-track { height: 1px; background: var(--border-color); }
.styleguide .sg-panel input[type=range]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  background: var(--text-color);
  border: none;
  border-radius: 50%;
}
.styleguide .sg-panel-readout {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid var(--border-color);
}

/* Voice — do / don't */
.styleguide .sg-voice { display: flex; flex-direction: column; gap: 0.75rem; max-width: 640px; margin-top: 1rem; }
.styleguide .sg-do, .styleguide .sg-dont { display: flex; gap: 0.75rem; align-items: baseline; line-height: 1.5; margin: 0; }
.styleguide .sg-dont { color: var(--text-light); }
.styleguide .sg-tag {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1em 0.45em;
  border: 1px solid var(--text-color);
}
.styleguide .sg-tag-dont { color: var(--text-light); border-color: var(--text-light); }

.styleguide .sg-colophon { border-top: 1px solid var(--border-color); margin-top: 4rem; padding-top: 1.5rem; }

@media (max-width: 720px) {
  .styleguide .sg-scale-row { flex-direction: column; gap: 0.3rem; }
  .styleguide .sg-scale-row .sg-spec { text-align: left; }
}
