/* ============================================
   Style Guide Layout — presentation only
   Not part of the design system itself
   ============================================ */

.sg-header {
  text-align: center;
  padding: var(--space-16) var(--space-6) var(--space-10);
  border-bottom: 1px solid var(--color-border-subtle);
}

.sg-header h1 {
  font-size: var(--heading-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-lime);
  margin-bottom: var(--space-2);
}

.sg-subtitle {
  font-size: var(--text-xl);
  color: var(--color-gray-500);
}

.sg-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-6);
  background: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border-subtle);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sg-nav a {
  color: var(--color-gray-500);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.sg-nav a:hover {
  color: var(--color-white);
  background: var(--color-bg-elevated);
}

main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.sg-section {
  padding: var(--space-12) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.sg-section:last-child {
  border-bottom: none;
}

.sg-section > h2 {
  font-size: var(--heading-md);
  color: var(--color-lime);
  margin-bottom: var(--space-8);
}

.sg-section > h3 {
  font-size: var(--text-lg);
  color: var(--color-gray-500);
  margin-bottom: var(--space-4);
  margin-top: var(--space-8);
}

.sg-section > h3:first-of-type {
  margin-top: 0;
}

/* Color swatches */
.sg-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.sg-color-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: 100px;
}

.sg-swatch {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
}

.sg-swatch-label {
  font-size: var(--text-sm);
  color: var(--color-white);
  font-weight: var(--font-weight-medium);
}

.sg-color-swatch code {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
}

/* Surfaces for component demos */
.sg-dark-surface {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.sg-light-surface {
  background: var(--color-gray-100);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

/* Button row */
.sg-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}

/* Spacing visualizer */
.sg-spacing-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sg-spacing-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.sg-spacing-row code {
  width: 80px;
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  flex-shrink: 0;
}

.sg-spacing-bar {
  height: 24px;
  background: var(--color-lime);
  border-radius: var(--radius-sm);
  opacity: 0.7;
}

.sg-spacing-row span {
  font-size: var(--text-sm);
  color: var(--color-gray-700);
  flex-shrink: 0;
}

/* Card grid */
.sg-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-5);
}

/* Type specimen */
.sg-type-specimen {
  margin-bottom: var(--space-8);
}

.sg-type-specimen h3 {
  font-size: var(--text-lg);
  color: var(--color-gray-500);
  margin-bottom: var(--space-4);
}

.sg-type-specimen .sg-dark-surface p {
  margin-bottom: var(--space-3);
}

.sg-type-specimen .sg-dark-surface p:last-child {
  margin-bottom: 0;
}

/* Team theming demo */
.sg-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
}

.sg-theme-demo {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
}

.sg-note {
  font-size: var(--text-md);
  color: var(--color-gray-500);
  margin-bottom: var(--space-6);
}

/* Footer */
.sg-footer {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  color: var(--color-gray-700);
  font-size: var(--text-sm);
}

/* Responsive */
@media (max-width: 768px) {
  .sg-color-grid {
    gap: var(--space-3);
  }

  .sg-color-swatch {
    width: 70px;
  }

  .sg-swatch {
    width: 56px;
    height: 56px;
  }

  .sg-card-grid {
    grid-template-columns: 1fr;
  }

  .sg-theme-grid {
    grid-template-columns: 1fr;
  }

  .submenu-tabs {
    flex-wrap: wrap;
  }
}
