/* The styleguide is a working surface, not a gallery. Its controls stay near
   the eye, its sections are easy to jump between, and every sample still
   comes from the app's real CSS and helpers. */

.styleguide {
  --styleguide-rail: 14rem;
}

.styleguide-shell {
  display: grid;
  grid-template-columns: var(--styleguide-rail) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.styleguide-rail {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.styleguide-panel {
  padding: 1rem;
}

.styleguide-panel-title {
  margin-bottom: 0.65rem;
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.styleguide-nav {
  display: grid;
  gap: 0.15rem;
}

.styleguide-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.42rem 0.55rem;
  color: var(--muted);
  border-radius: var(--bs-border-radius-sm);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.styleguide-nav a::after {
  content: "›";
  color: var(--line);
  font-size: 1.1rem;
  line-height: 1;
}

.styleguide-nav a:hover,
.styleguide-nav a:focus-visible {
  color: var(--ink);
  background-color: var(--wash);
}

.styleguide-appearance {
  display: grid;
  gap: 1rem;
}

.styleguide-appearance .theme-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.styleguide-appearance .theme-swatch {
  gap: 0.2rem;
  font-size: 0.7rem;
}

.styleguide-appearance .theme-swatch-dot {
  width: 1.75rem;
  height: 1.75rem;
}

.styleguide-content {
  min-width: 0;
}

.styleguide-section {
  scroll-margin-top: 1rem;
}

.styleguide-section + .styleguide-section {
  margin-top: 3.5rem;
}

.styleguide-token {
  height: 3.5rem;
  background-color: var(--token);
  border: 1px solid var(--line);
  border-radius: var(--bs-border-radius-sm);
}

.styleguide-table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--bs-border-radius);
  background: var(--card);
}

.styleguide-table-wrap .table > :not(caption) > * > * {
  padding: 0.8rem 1rem;
}

.styleguide-table-wrap .table > tbody > tr:last-child > * {
  border-bottom-width: 0;
}

.styleguide-notices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.styleguide-notices .alert {
  margin-bottom: 0;
}

.styleguide-form-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-top: calc(1.5em + 0.5rem);
}

@media (max-width: 991.98px) {
  .styleguide-shell {
    grid-template-columns: 1fr;
  }

  .styleguide-rail {
    position: static;
  }

  .styleguide-rail .styleguide-panel:last-child {
    order: -1;
  }

  .styleguide-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .styleguide-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .styleguide-notices {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .styleguide-nav a {
    transition: none;
  }
}
