
/* ===== BASE ===== */
/*
 * WordPress Interactivity API Demo
 * Design System: Gutenberg Poetry Press
 *
 * Inspired by Renaissance printing presses and classical poetry books.
 * Cool-toned palette harmonizing with WordPress's iconic blue.
 */

/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* Paper & Ink Colors (cool-toned to harmonize with WP blue) */
  --paper: #FAFBFC;
  --paper-warm: #F4F6F8;
  --paper-aged: #E8EDF2;
  --ink: #1A202C;
  --ink-light: #2D3748;
  --ink-muted: #4A5568;
  --ink-faint: #718096;

  /* Ink Accents */
  --wp-blue: #0073aa;
  --wp-blue-light: #2271b1;
  --indigo: #6366F1;
  --teal: #0D9488;
  --coral: #FF7F50;

  /* Surfaces */
  --surface: #FFFFFF;
  --surface-hover: #F0F4F8;
  --border: #E2E8F0;
  --border-dark: #CBD5E1;

  /* Shadows (soft, cool-toned) */
  --shadow-sm: 0 1px 3px rgba(26, 32, 44, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 32, 44, 0.08);
  --shadow-lg: 0 8px 24px rgba(26, 32, 44, 0.1);
  --shadow-inset: inset 0 2px 4px rgba(26, 32, 44, 0.04);

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Garamond', Georgia, serif;
  --font-body: 'EB Garamond', 'Garamond', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing (generous, book-like) */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Sizing */
  --content-max-width: 1200px;
  --module-max-width: 420px;
  --border-width: 1px;
  --border-width-thick: 2px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* ===== PAPER TEXTURE BACKGROUND ===== */
.paper-texture {
  position: absolute;
  filter: url(#roughpaper);
  inset: 0;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

/* ===== LAYOUT ===== */
/* ===== LAYOUT ===== */
.demo-container {
  position: relative;
  z-index: 1;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-xl);
}

/* ===== HEADER ===== */
.demo-header {
  text-align: center;
  margin-bottom: var(--space-4xl);
  padding-bottom: var(--space-2xl);
  border-bottom: var(--border-width) solid var(--border);
}

.demo-header__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: var(--border-width) solid var(--border);
  padding: var(--space-xs) var(--space-md);
  margin-bottom: var(--space-lg);
}

.demo-header__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: var(--space-md);
  color: var(--ink);
}

.demo-header__title span {
  font-style: italic;
  color: var(--wp-blue);
}

.demo-header__subtitle {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-style: italic;
  color: var(--ink-muted);
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Ornamental Divider */
.demo-header::after {
  content: '❧';
  display: block;
  font-size: 1.5rem;
  color: var(--wp-blue-light);
  margin-top: var(--space-lg);
  opacity: 0.6;
}

/* ===== SECTION ===== */
.demo-section {
  margin-bottom: var(--space-4xl);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.demo-section:nth-child(1) { animation-delay: 0.1s; }
.demo-section:nth-child(2) { animation-delay: 0.25s; }
.demo-section:nth-child(3) { animation-delay: 0.4s; }
.demo-section:nth-child(4) { animation-delay: 0.55s; }

.demo-section__header {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: var(--border-width) solid var(--border);
}

.demo-section__icon {
  font-size: 1.25rem;
  color: var(--wp-blue-light);
  opacity: 0.6;
}

.demo-section__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
}

/* ===== MODULE GRID ===== */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-xl);
}

/* ===== MODULE (Component Container) ===== */
.module {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  overflow: hidden;
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.module:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-md);
}

.module__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  background: var(--paper-warm);
  border-bottom: var(--border-width) solid var(--border);
  font-family: var(--font-mono);
}

.module__label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--wp-blue);
  letter-spacing: 0.05em;
}

.module__number {
  font-size: 0.65rem;
  color: var(--ink-faint);
  font-style: italic;
}

.module__content {
  flex: 1;
  padding: var(--space-lg);
}

.module__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--ink);
}

.module__description {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
  font-style: italic;
}

.module__directives {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: 0.5rem var(--space-lg);
  border-top: var(--border-width) dashed var(--border);
  min-height: 5rem;
  align-items: start;
}

.directive-tag {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 500;
  padding: 2px 6px;
  background: var(--paper-warm);
  border: var(--border-width) solid var(--border);
  color: var(--ink-muted);
}

.directive-tag--wp-blue { color: var(--wp-blue); border-color: rgba(0, 115, 170, 0.25); background: rgba(0, 115, 170, 0.08); }

/* ===== DEMO AREA (Inside Module) ===== */
.demo-area {
  background: var(--paper-aged);
  border: var(--border-width) solid var(--border);
  padding: var(--space-lg);
  min-height: 80px;
}

/* ===== COMPONENTS ===== */
/* ===== BUTTONS ===== */
.btn {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border: var(--border-width-thick) solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  background: transparent;
}

.btn:focus-visible {
  outline: 2px solid var(--wp-blue);
  outline-offset: 2px;
}

.btn--primary {
  border-color: var(--wp-blue);
  color: var(--wp-blue);
}

.btn--primary:hover {
  background: var(--wp-blue);
  color: var(--paper);
}

.btn--secondary {
  border-color: var(--teal);
  color: var(--teal);
}

.btn--secondary:hover {
  background: var(--teal);
  color: var(--paper);
}

.btn--secondary:not(.no-outline):focus {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.btn--ghost {
  border-color: var(--border-dark);
  color: var(--ink-muted);
}

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

.btn--ghost.active {
  border-color: var(--wp-blue);
  color: var(--wp-blue);
  background: rgba(0, 115, 170, 0.08);
}

.btn--sm {
  font-size: 0.8125rem;
  padding: var(--space-xs) var(--space-sm);
}

.btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== INPUTS ===== */
.input {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--surface);
  border: var(--border-width-thick) solid var(--border);
  color: var(--ink);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.input:focus {
  border-color: var(--wp-blue);
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

.input--error {
  border-color: var(--wp-blue);
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.input--disabled {
  background: var(--border);
  color: var(--ink-faint);
  cursor: not-allowed;
}

.input--readonly {
  background: var(--paper-warm);
  border-style: dashed;
}

.input--required {
  border-left: 3px solid var(--teal);
}

/* ===== BADGES & TAGS ===== */
.badge {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--paper-warm);
  border: var(--border-width) solid var(--border);
  color: var(--ink-muted);
}

.badge--success {
  background: rgba(13, 148, 136, 0.08);
  color: var(--teal);
  border-color: rgba(13, 148, 136, 0.2);
}

.badge--warning {
  background: rgba(99, 102, 241, 0.08);
  color: var(--indigo);
  border-color: rgba(99, 102, 241, 0.2);
}

.badge--error {
  background: rgba(0, 115, 170, 0.08);
  color: var(--wp-blue);
  border-color: rgba(0, 115, 170, 0.2);
}

/* ===== UTILITIES ===== */
/* ===== UTILITIES ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.text-center { text-align: center; }
.text-muted { color: var(--ink-muted); }
.text-faint { color: var(--ink-faint); }
.text-wp-blue { color: var(--wp-blue); }
.text-teal { color: var(--teal); }
.font-mono { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }
.text-lg { font-size: 1.125rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-base { font-size: 1rem; }
.italic { font-style: italic; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.relative { position: relative; }
.absolute { position: absolute; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root {
    --space-2xl: 2rem;
    --space-3xl: 2.5rem;
    --space-4xl: 3rem;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .demo-header__title {
    font-size: 2rem;
  }

  html {
    font-size: 16px;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-slide-in {
  animation: slideIn 0.4s ease forwards;
}

/* ===== DECORATIVE ELEMENTS ===== */
.fleuron {
  color: var(--teal);
  opacity: 0.5;
  font-size: 1.25rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--ink-faint);
  font-size: 0.75rem;
  margin: var(--space-lg) 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Selection styling */
::selection {
  background: rgba(0, 115, 170, 0.15);
  color: var(--ink);
}

/* ===== DIRECTIVE TAG STATES ===== */
body:not(.show-all-directives) .directive-tag--full {
  /* Full tags hidden by default */
    display: inline;
    width:0;
    height:0;
    visibility: hidden;
}

/* Show full tags when wrapper has the class */
.show-all-directives .directive-tag--full {
  display: inline-flex;
  opacity: 0;
  animation: staggered-directives 1.5s ease forwards;
}

@keyframes staggered-directives {
  to {
      opacity: 1;
  }
}


/* Staggered animation delays for full directive tags */
.show-all-directives .module__directives .directive-tag--full:nth-child(1) { animation-delay: 0.05s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(2) { animation-delay: 0.1s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(3) { animation-delay: 0.15s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(4) { animation-delay: 0.2s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(5) { animation-delay: 0.25s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(6) { animation-delay: 0.3s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(7) { animation-delay: 0.35s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(8) { animation-delay: 0.4s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(9) { animation-delay: 0.45s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(10) { animation-delay: 0.5s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(11) { animation-delay: 0.55s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(12) { animation-delay: 0.6s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(13) { animation-delay: 0.65s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(14) { animation-delay: 0.7s; }
.show-all-directives .module__directives .directive-tag--full:nth-child(15) { animation-delay: 0.75s; }

/* ===== GITHUB CORNER ===== */
.github-corner {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1001;
  text-decoration: none;
}

.github-corner:hover .octo-arm {
  animation: octocat-wave 560ms ease-in-out;
}

.github-corner svg {
  fill: var(--wp-blue, #0073aa);
  color: var(--paper, #FAFBFC);
}

@keyframes octocat-wave {
  0%, 100% { transform: rotate(0); }
  20%, 60% { transform: rotate(-25deg); }
  40%, 80% { transform: rotate(10deg); }
}

@media (max-width: 500px) {
  .github-corner:hover .octo-arm {
    animation: none;
  }
  .github-corner .octo-arm {
    animation: octocat-wave 560ms ease-in-out;
  }
}

/* ===== COUNTER ===== */
/* Counter */
.counter-display {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 400;
  color: var(--wp-blue);
  text-align: center;
  padding-bottom: var(--space-md);
  line-height: 1;
}

/* ===== TOGGLE ===== */
/* Toggle Panel */
.toggle-panel {
  padding: var(--space-md);
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  margin-top: var(--space-md);
  font-style: italic;
  color: var(--ink-muted);
}

/* ===== INPUT-BINDING ===== */
/* Input Binding - No component-specific CSS needed */
/* Uses shared .input, .mt-md, .text-sm, .italic, .text-wp-blue, .font-display, .text-xs, .text-faint, .mt-xs classes */

/* ===== CLASS-TOGGLE ===== */
/* Demo Box for class toggle */
.demo-box {
  padding: var(--space-md);
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  transition: all 0.3s ease;
}

.demo-box.active {
  background: rgba(0, 115, 170, 0.05);
  border-color: var(--wp-blue);
}

.demo-box.highlighted {
  background: rgba(99, 102, 241, 0.05);
  border-color: var(--indigo);
}

/* ===== CONDITIONAL ===== */
/* Conditional - Uses shared input classes */
/* No component-specific CSS needed - uses .input, .input--disabled, .input--readonly, .input--required */
/* These are defined in the shared styles.css under the INPUTS section */

/* ===== DIRECTIVE-TOGGLE ===== */
/* ===== DIRECTIVE TOGGLE FAB ===== */
.directive-toggle-fab {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 1000;
}

.directive-toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--surface);
  border: var(--border-width-thick) solid var(--wp-blue);
  color: var(--wp-blue);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-fast);
}

.directive-toggle-btn:hover {
  background: var(--wp-blue);
  color: var(--paper);
}

.directive-toggle-btn:focus-visible {
  outline: 2px solid var(--wp-blue);
  outline-offset: 2px;
}

.directive-toggle-btn[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--paper);
}

.directive-toggle-icon {
  font-size: 1rem;
}

/* ===== TODO-LIST ===== */
/* Todo List */
.todo-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-bottom: var(--border-width) solid var(--border);
  background: var(--surface);
}

.todo-item:last-child {
  border-bottom: none;
}

.todo-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  font-size: 0.75rem;
}

.todo-checkbox.checked {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--paper);
}

.todo-text {
  flex: 1;
  font-size: 0.9375rem;
}

.todo-text.completed {
  text-decoration: line-through;
  color: var(--ink-faint);
  font-style: italic;
}

.todo-delete {
  opacity: 0;
  transition: opacity var(--transition-fast);
  color: var(--wp-blue);
}

.todo-item:hover .todo-delete {
  opacity: 1;
}

/* ===== TABS ===== */
/* Tab Navigation */
.tab-nav {
  display: flex;
  border-bottom: var(--border-width) solid var(--border);
  gap: var(--space-xs);
}

.tab-btn {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--ink);
}

.tab-btn.active {
  color: var(--wp-blue);
  border-bottom-color: var(--wp-blue);
}

.tab-panel {
  padding: var(--space-md);
  background: var(--surface);
}

/* ===== ACCORDION ===== */
/* Accordion */
.accordion-item {
  border: var(--border-width) solid var(--border);
  margin-bottom: var(--space-sm);
  background: var(--surface);
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--paper-warm);
  cursor: pointer;
  transition: background var(--transition-fast);
  font-family: var(--font-body);
  font-weight: 500;
}

.accordion-header:hover {
  background: var(--surface-hover);
}

.accordion-icon {
  transition: transform var(--transition-base);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.accordion-item.open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  padding: var(--space-md);
  border-top: var(--border-width) solid var(--border);
  font-style: italic;
  color: var(--ink-muted);
}

/* ===== SEARCH-FILTER ===== */
/* Search Filter - uses shared components */

/* Live Search Results */
.search-results {
  max-height: 200px;
  overflow-y: auto;
  border: var(--border-width) solid var(--border);
  margin-top: var(--space-sm);
  background: var(--surface);
}

.search-result-item {
  padding: var(--space-sm) var(--space-md);
  border-bottom: var(--border-width) solid var(--border);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-result-item:hover,
.search-result-item.active {
  background: var(--paper-warm);
}

.search-result-item:last-child {
  border-bottom: none;
}

/* ===== STAR-RATING ===== */
/* Star Rating */
.star {
  font-size: 1.75rem;
  color: var(--border-dark);
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.star:hover {
  transform: scale(1.1);
}

.star.filled {
  color: var(--wp-blue-light);
}

[data-wp-interactive="starRating"].bad
:is( [data-wp-text="state.ratingText"], .filled) {
    color: var(--coral);
}

[data-wp-interactive="starRating"].good
:is( [data-wp-text="state.ratingText"], .filled) {
    color: var(--teal);
}

/* ===== DRAG-DROP ===== */
/* Draggable */
.draggable {
  padding: var(--space-sm) var(--space-md);
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  cursor: grab;
  margin-bottom: var(--space-xs);
  transition: all var(--transition-fast);
  user-select: none;
}

.draggable:active {
  cursor: grabbing;
}

.draggable.dragging {
  opacity: 0.5;
  border-color: var(--wp-blue);
}

.draggable.drop-target {
  border-color: var(--teal);
  background: var(--paper-warm);
}

/* ===== FORM-WIZARD ===== */
/* Form Wizard */
.wizard-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: var(--border-width) solid var(--border);
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  color: var(--ink-faint);
  transition: color var(--transition-fast);
}

.wizard-step.active {
  color: var(--wp-blue);
}

.wizard-step.completed {
  color: var(--teal);
}

.wizard-step-number {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.wizard-step.active .wizard-step-number {
  background: var(--wp-blue);
  color: var(--paper);
}

/* ===== LIVE-SEARCH ===== */
/* Live Search Results */
.search-results {
  max-height: 200px;
  overflow-y: auto;
  border: var(--border-width) solid var(--border);
  margin-top: var(--space-sm);
  background: var(--surface);
}

.search-result-item {
  padding: var(--space-sm) var(--space-md);
  border-bottom: var(--border-width) solid var(--border);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-result-item:hover,
.search-result-item.active {
  background: var(--paper-warm);
}

.search-result-item:last-child {
  border-bottom: none;
}

/* Loading State */
.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--wp-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== DATA-TABLE ===== */
/* Data Table */
.data-table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.data-table th {
  font-family: var(--font-body);
  font-weight: 600;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  background: var(--paper-warm);
  border-bottom: var(--border-width-thick) solid var(--border-dark);
  cursor: pointer;
  user-select: none;
}

.data-table th:hover {
  background: var(--surface-hover);
}

.data-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: var(--border-width) solid var(--border);
}

.data-table tr:hover td {
  background: var(--paper-warm);
}

.sort-icon {
  display: inline-block;
  margin-left: var(--space-xs);
  opacity: 0.3;
  font-size: 0.75rem;
}

.sort-icon.active {
  opacity: 1;
  color: var(--wp-blue);
}

/* ===== ANIMATION ===== */
/* Animation Demo */
.animation-box {
  width: 60px;
  height: 60px;
  background: var(--wp-blue);
}

.animation-box.paused {
  animation-play-state: paused;
}

/* Progress Bar */
.progress-bar {
  height: 4px;
  background: var(--border);
  overflow: hidden;
  border-radius: 2px;
}

.progress-bar__fill {
  height: 100%;
  background: var(--wp-blue);
}

/* ===== KANBAN ===== */
/* ===== KANBAN BOARD - THE MASTERPIECE ===== */

.demo-section--full-width {
  max-width: none;
  margin-left: calc(-1 * var(--space-xl));
  margin-right: calc(-1 * var(--space-xl));
  padding: var(--space-xl);
  background: var(--paper-warm);
  border-top: var(--border-width-thick) solid var(--border);
  border-bottom: var(--border-width-thick) solid var(--border);
}

.demo-section__description {
  font-style: italic;
  color: var(--ink-muted);
  margin-bottom: var(--space-xl);
  max-width: 80ch;
  line-height: 1.7;
}

.kanban-container {
  position: relative;
}

/* Toolbar */
.kanban-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--surface);
  border: var(--border-width) solid var(--border);
}

.kanban-toolbar__search {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.kanban-search {
  flex: 1;
}

.kanban-toolbar__filter {
  min-width: 140px;
}

.kanban-filter {
  font-size: 0.875rem;
}

.kanban-toolbar__actions {
  display: flex;
  gap: var(--space-xs);
}

.kanban-shortcuts {
  margin-left: auto;
}

.kanban-shortcuts kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--paper-aged);
  border: var(--border-width) solid var(--border);
  border-radius: 3px;
}

/* Board Layout */
.kanban-board {
  display: flex;
  gap: var(--space-lg);
  overflow-x: auto;
  padding-bottom: var(--space-md);
}

/* Column */
.kanban-column {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  min-height: 400px;
  transition: all var(--transition-base);
}

.kanban-column.drop-target {
  border-color: var(--wp-blue);
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.kanban-column__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--paper-warm);
  border-bottom: var(--border-width) solid var(--border);
  border-top: 3px solid var(--border);
}

.kanban-column__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}

.kanban-column__count {
  font-size: 0.7rem;
}

.kanban-column__add {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
}

.kanban-column__cards {
  flex: 1;
  padding: var(--space-sm);
  overflow-y: auto;
  min-height: 100px;
}

/* Card */
.kanban-card {
  position: relative;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  cursor: grab;
  transition: all var(--transition-fast);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.editing {
  cursor: default;
}

.kanban-card:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-sm);
}

.kanban-card.dragging {
  opacity: 0.5;
  border-color: var(--wp-blue);
  box-shadow: var(--shadow-md);
}

.kanban-card.drop-before::before,
.kanban-card.drop-after::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--wp-blue);
  border-radius: 2px;
}

.kanban-card.drop-before::before {
  top: -5px;
}

.kanban-card.drop-after::after {
  bottom: -5px;
}

/* Priority indicators */
.kanban-card.high-priority {
  border-left: 3px solid var(--coral);
}

.kanban-card.medium-priority {
  border-left: 3px solid var(--indigo);
}

.kanban-card.low-priority {
  border-left: 3px solid var(--teal);
}

@keyframes revision-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(255, 127, 80, 0.4), 0 0 15px rgba(255, 127, 80, 0.2);
  }
  50% {
    box-shadow: 0 0 15px rgba(255, 127, 80, 0.6), 0 0 30px rgba(255, 127, 80, 0.4);
  }
}

.kanban-card.revision-highlight {
  border-color: var(--coral);
  animation: revision-glow 1.5s ease-in-out infinite;
  transition: border-color var(--transition-fast);
}

.kanban-card__content {
  position: relative;
}

.kanban-card__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
}

.kanban-card__priority {
  font-size: 0.75rem;
  font-weight: bold;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}

.high-priority .kanban-card__priority {
  color: var(--coral);
}

.medium-priority .kanban-card__priority {
  color: var(--indigo);
}

.low-priority .kanban-card__priority {
  color: var(--teal);
}

.kanban-card__title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  flex: 1;
}

.kanban-card__description {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: var(--space-xs);
  line-height: 1.5;
  white-space: pre-line;
}

.kanban-card__meta {
  margin-top: var(--space-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-card__assignee {
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-style: italic;
}

.kanban-card__actions {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.kanban-card:hover .kanban-card__actions {
  opacity: 1;
}

.kanban-card__actions .btn {
  padding: 2px 6px;
  font-size: 0.75rem;
}

/* Drop indicators */
.kanban-card__drop-indicator {
  display: none;
  height: 3px;
  background: var(--wp-blue);
  border-radius: 2px;
  margin: var(--space-xs) 0;
}

.kanban-card__drop-indicator--before {
  margin-bottom: var(--space-sm);
}

.kanban-card__drop-indicator--after {
  margin-top: var(--space-sm);
}

/* Card Edit Mode */
.kanban-card__edit {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.kanban-card__edit-input {
  font-size: 0.9375rem;
}

.kanban-card__edit-actions {
  display: flex;
  gap: var(--space-xs);
}

/* Modal */
.kanban-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 32, 44, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.kanban-modal {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  padding: var(--space-xl);
  min-width: 320px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
}

.kanban-modal__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  color: var(--ink);
}

.kanban-modal__field {
  margin-bottom: var(--space-md);
}

.kanban-modal__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: var(--space-xs);
}

.kanban-modal__input,
.kanban-modal__select,
.kanban-modal__textarea {
  font-size: 0.9375rem;
}

.kanban-modal__textarea {
  resize: vertical;
  min-height: 60px;
}

.kanban-modal__actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* Directive tags container */
.kanban-directives {
  margin-top: var(--space-xl);
  padding: var(--space-md);
  background: var(--surface);
  border: var(--border-width) solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
  .demo-section--full-width {
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
    padding: var(--space-md);
  }

  .kanban-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .kanban-toolbar__search {
    max-width: none;
  }

  .kanban-toolbar__shortcuts {
    margin-left: 0;
    text-align: center;
  }

  .kanban-column {
    flex: 0 0 260px;
  }
}

/* ===== KANBAN REVISION PANEL ===== */
.kanban-revision-panel {
  margin-top: var(--space-lg);
  background: var(--surface);
  border: var(--border-width) solid var(--border);
}

.kanban-revision-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--paper-warm);
  border: none;
  border-bottom: var(--border-width) solid var(--border);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.kanban-revision-toggle:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.kanban-revision-count {
  margin-left: auto;
  font-size: 0.7rem;
}

.kanban-revision-timeline {
  display: flex;
  overflow-x: auto;
  gap: var(--space-xs);
  padding: var(--space-sm);
  min-height: 48px;
  align-items: stretch;
}

.kanban-revision-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--space-sm);
}

.kanban-revision-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
  width: 20ch;
  padding: var(--space-xs) var(--space-sm);
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.6rem;
  line-height: 1.4;
}

/* Only animate the newest (last) item */
.kanban-revision-item:last-child {
  animation: slideInRight 0.3s ease-out;
}

.kanban-revision-item:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-sm);
}

.kanban-revision-item:focus-visible {
  outline: 2px solid var(--wp-blue);
  outline-offset: 2px;
}

.kanban-revision-item.active {
  border-color: var(--wp-blue);
  background: rgba(0, 115, 170, 0.05);
}

.revision-icon {
  width: 14px;
  height: 14px;
  margin-bottom: 2px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.revision-icon.icon-move {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E");
}

.revision-icon.icon-create {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E");
}

.revision-icon.icon-edit {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366F1' stroke-width='2'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
}

.revision-icon.icon-delete {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF7F50' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M8 8l8 8M16 8l-8 8'/%3E%3C/svg%3E");
}

.revision-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.revision-card {
  color: var(--ink);
  font-style: italic;
  word-break: break-word;
  margin-bottom: 2px;
}

.revision-move {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.55rem;
}

.revision-in-column {
  display: flex;
  align-items: center;
  gap: 3px;
}

.revision-reorder {
  color: var(--ink-muted);
  font-size: 0.6rem;
}

.revision-create-col {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.55rem;
}

.revision-create-col::before {
  content: '+';
  color: var(--teal);
  font-weight: bold;
}

.revision-title-change {
  gap: 3px;
  font-size: 0.55rem;
}

.revision-priority {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.55rem;
}

.revision-from {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: var(--border-dark);
}

.revision-arrow {
  color: var(--wp-blue);
  font-weight: bold;
}

.revision-to {
  color: var(--teal);
  font-weight: 500;
}

.revision-renamed {
  color: var(--indigo);
  font-size: 0.7rem;
  font-weight: bold;
}

.revision-desc {
  color: var(--ink-muted);
  font-style: italic;
}

.revision-time {
  color: var(--ink-faint);
  font-size: 0.625rem;
  font-style: italic;
  margin-top: 2px;
}

/* Initial state button */
.kanban-revision-initial {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 50px;
  padding: var(--space-xs);
  background: var(--paper-warm);
  border: var(--border-width) dashed var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.55rem;
  color: var(--ink-faint);
}

.kanban-revision-initial:hover {
  border-color: var(--border-dark);
  background: var(--surface);
}

.kanban-revision-initial.active {
  border-style: solid;
  border-color: var(--wp-blue);
  background: rgba(0, 115, 170, 0.05);
  color: var(--ink-muted);
}

.kanban-revision-initial-icon {
  font-size: 0.875rem;
  margin-bottom: 2px;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
