/* ==========================================================================
   COMPONENTS GALLERY STYLES
   A separated showcase for design tokens, atomic components,
   bento primitives, and animated UI widgets
   ========================================================================== */

.gallery-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.gallery-sidebar {
  width: 260px;
  background-color: var(--color-surface);
  border-right: 1px solid var(--color-hairline);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: var(--space-xl) var(--space-lg);
  flex-shrink: 0;
}

.gallery-sidebar-header {
  margin-bottom: var(--space-xl);
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--color-ink);
}

.sidebar-badge {
  display: inline-block;
  background-color: var(--color-primary);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  margin-top: 4px;
}

.sidebar-nav-group {
  margin-bottom: var(--space-xl);
}

.sidebar-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted-light);
  margin-bottom: var(--space-sm);
  display: block;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-menu a {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease-out);
}

.sidebar-menu a:hover {
  background-color: #ffffff;
  color: var(--color-ink);
  transform: translateX(2px);
}

.sidebar-menu a.active {
  background-color: #ffffff;
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Main Gallery Content */
.gallery-main {
  flex: 1;
  padding: var(--space-xl) var(--space-xxl) var(--space-section);
  max-width: 1100px;
}

.gallery-header {
  margin-bottom: var(--space-section);
  border-bottom: 1px solid var(--color-hairline);
  padding-bottom: var(--space-xl);
}

.gallery-heading {
  font-family: var(--font-display);
  font-size: 42px;
  letter-spacing: -0.5px;
  color: var(--color-ink);
  margin-bottom: var(--space-xs);
}

.gallery-lead {
  font-size: 17px;
  color: var(--color-muted);
  max-width: 700px;
}

/* Component Section Block */
.component-section {
  margin-bottom: var(--space-section);
  scroll-margin-top: 30px;
}

.component-section-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.3px;
  color: var(--color-ink);
  margin-bottom: var(--space-xs);
}

.component-section-desc {
  font-size: 15px;
  color: var(--color-muted);
  margin-bottom: var(--space-lg);
}

/* Component Showcase Card */
.component-card {
  background-color: #ffffff;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.component-preview {
  padding: var(--space-xl);
  background-color: #ffffff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
  min-height: 120px;
}

.preview-tinted {
  background-color: var(--color-surface);
}

.preview-dark {
  background-color: var(--color-ink);
  color: #ffffff;
}

.preview-grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  width: 100%;
}

.component-meta {
  padding: var(--space-md) var(--space-xl);
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.component-name {
  font-size: 13px;
  font-family: monospace;
  font-weight: 600;
  color: var(--color-ink);
}

.copy-btn {
  background: #ffffff;
  border: 1px solid var(--color-hairline);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast);
}

.copy-btn:hover {
  background-color: var(--color-surface);
  border-color: var(--color-muted-light);
}

/* Palette Swatches */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-md);
  width: 100%;
}

.swatch-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-hairline);
  background-color: #ffffff;
}

.swatch-color {
  height: 60px;
  width: 100%;
}

.swatch-details {
  padding: 8px 10px;
}

.swatch-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink);
}

.swatch-hex {
  font-size: 11px;
  color: var(--color-muted);
  font-family: monospace;
}

/* Typography Specimen */
.typography-specimen-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.specimen-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px dashed var(--color-hairline);
  padding-bottom: var(--space-sm);
  flex-wrap: wrap;
  gap: 12px;
}

.specimen-label {
  font-size: 12px;
  font-family: monospace;
  color: var(--color-muted);
  min-width: 140px;
}

.specimen-text {
  flex: 1;
}

/* Bento Primitives Grid */
.bento-primitives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-xl);
  width: 100%;
  align-items: center;
  justify-items: center;
  padding: var(--space-xl) 0;
}

.bento-primitive-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.primitive-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  font-family: monospace;
}

/* Animated Widget Playground */
.widget-playground {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  width: 100%;
}

@media (max-width: 850px) {
  .widget-playground {
    grid-template-columns: 1fr;
  }
}

.widget-frame {
  background: var(--color-surface);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  position: relative;
}

.widget-control-bar {
  margin-top: var(--space-md);
  display: flex;
  gap: var(--space-xs);
}

.btn-control-trigger {
  background: #ffffff;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast);
}

.btn-control-trigger:hover {
  background-color: var(--color-ink);
  color: #ffffff;
}

/* Responsive Gallery */
@media (max-width: 900px) {
  .gallery-layout {
    flex-direction: column;
  }
  .gallery-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--color-hairline);
    padding: var(--space-md);
  }
  .gallery-main {
    padding: var(--space-lg) var(--space-md);
  }
}
