/* Palette Page Styles
 * ========================================================================== */

/* Enable smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

.style-showcase-container {
  background: var(--color-bg--canvas);
  color: var(--color-ink--canvas);
  min-height: 100vh;
  padding: 2rem;
}

.style-showcase-header {
  text-align: center;
  margin-bottom: 3rem;
}

.style-showcase-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.style-showcase-header p {
  color: var(--color-ink--canvas);
  opacity: 0.8;
  font-size: 1.125rem;
}

/* Table of Contents
 * -------------------------------------------------------------------------- */

.style-showcase-toc {
  max-width: 1200px;
  margin: 2rem auto 3rem;
  padding: 1.5rem;
  background: var(--color-bg--surface);
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px oklch(0 0 0 / 0.08);
}

.style-showcase-toc a {
  color: var(--color-primary);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: 0.25rem;
  transition: all 200ms ease;
}

.style-showcase-toc a:hover {
  background: var(--color-bg--primary-container);
  color: var(--color-ink--primary-container);
  transform: translateX(4px);
}

.style-showcase-section {
  max-width: 1200px;
  margin: 0 auto 4rem;
  position: relative;
  overflow: visible;
}

.style-showcase-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border--light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Surface Hierarchy Demo
 * -------------------------------------------------------------------------- */

.surface-demo {
  padding: 2rem;
  background: var(--color-bg--canvas);
  border-radius: 0.5rem;
}

.surface-level {
  padding: 2rem;
  border-radius: 0.5rem;
  position: relative;
  transition: all 0.2s ease;
}

.surface-level--canvas {
  background: var(--color-bg--canvas);
  color: var(--color-ink--canvas);
  border: 2px dashed var(--color-border--light);
}

.surface-level--surface {
  background: var(--color-bg--surface);
  color: var(--color-ink--surface);
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.05);
}

.surface-level--container {
  background: var(--color-bg--container);
  color: var(--color-ink--container);
  box-shadow: 0 2px 8px oklch(0 0 0 / 0.08);
}

.surface-level--overlay {
  background: var(--color-bg--overlay);
  color: var(--color-ink--overlay);
  box-shadow: 0 8px 32px oklch(0 0 0 / 0.12);
}

.surface-label {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

/* Color Grid
 * -------------------------------------------------------------------------- */

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.color-swatch {
  aspect-ratio: 1;
  border-radius: 0.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.5rem;
  position: relative;
  box-shadow: inset 0 0 0 1px oklch(0 0 0 / 0.1);
  transition: transform 0.2s ease;
}

.color-swatch:hover {
  transform: scale(1.05);
  z-index: 1;
}

.color-swatch:hover .swatch-value {
  opacity: 1;
}

.swatch-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: oklch(0 0 0 / 0.8);
}

.swatch-value {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  right: 0.5rem;
  font-size: 0.625rem;
  font-family: monospace;
  color: oklch(0 0 0 / 0.7);
  opacity: 0;
  transition: opacity 0.2s ease;
  word-break: break-all;
}

.swatch-label--light {
  color: oklch(1 0 0 / 0.9);
}

/* Color Roles
 * -------------------------------------------------------------------------- */

.color-roles {
  display: flex;
  gap: 1rem;
}

.color-role {
  flex: 1;
  display: flex;
  gap: 0.5rem;
}

.role-main,
.role-container {
  flex: 1;
  padding: 1.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all 0.2s ease;
}

.role-main:hover,
.role-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px oklch(0 0 0 / 0.1);
}

/* Surface Grid
 * -------------------------------------------------------------------------- */

.surface-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.surface-card {
  padding: 1.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.surface-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.surface-card p {
  margin-bottom: 1rem;
  opacity: 0.8;
}

.surface-card code {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: oklch(0 0 0 / 0.1);
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-family: monospace;
}

/* Component Demo Styles
 * -------------------------------------------------------------------------- */

.component-demo {
  margin-bottom: 3rem;
}

.component-demo h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Back to TOC link */
.toc-link {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-primary);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 200ms ease;
}

.toc-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.component-description {
  color: var(--color-ink--canvas);
  opacity: 0.8;
  margin-bottom: 2rem;
}

.demo-group {
  margin-bottom: 2.5rem;
}

.demo-group h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.demo-row {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.demo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.demo-item--spaced-top {
  margin-top: 200px;
}

.demo-label {
  font-size: 0.75rem;
  color: var(--color-ink--canvas);
  opacity: 0.7;
  text-align: center;
}

/* FAB demo container */
.fab-demo-container {
  background: var(--color-bg--surface);
  padding: 2rem;
  border-radius: 0.5rem;
  min-height: 120px;
  position: relative;
}

/* Demo FABs (not fixed position) */
.fab--demo {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
}

/* Dark mode adjustments
 * -------------------------------------------------------------------------- */

[data-color-scheme="dark"] .surface-demo {
  background: oklch(0 0 0 / 0.2);
}

[data-color-scheme="dark"] .color-swatch {
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.1);
}

[data-color-scheme="dark"] .surface-card code {
  background: oklch(1 0 0 / 0.1);
}