/* HYPERPART: kanban */
/* Promoted VERBATIM from Dazzle regions.css (W2, fleet convergence).
 * The Dazzle emitter contract predates the move and is unchanged. */

/* ─────────────────────────── kanban region ──────────────────────
 * Horizontal column board. Each column is a fixed-width tinted
 * surface with a header (status badge + count) and a vertically-
 * scrolling card stack. Cards are tinted surfaces; .is-clickable
 * gives them shadow/border affordance when wired to action_url. */

.dz-kanban-board {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-block-end: var(--space-sm);
  min-height: 12.5rem;
}

.dz-kanban-column {
  flex-shrink: 0;
  width: 16.25rem;
  min-width: 16.25rem;
  background: color-mix(in oklch, var(--colour-bg) 60%, transparent);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
}

.dz-kanban-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-end: var(--space-sm);
  padding-inline: 0.25rem;
}

.dz-kanban-column-count {
  font-size: var(--text-xs);
  color: var(--colour-text-muted);
}

.dz-kanban-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 60vh;
  overflow-y: auto;
}

.dz-kanban-card {
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px oklch(0% 0 0 / 0.04);
}

/* Linear-class rearrange: only when SSR stamped draggable / drop targets */
.dz-kanban-card[draggable="true"] {
  cursor: grab;
  touch-action: none;
}

.dz-kanban-card[draggable="true"]:active,
.dz-kanban-card.is-dragging {
  cursor: grabbing;
  opacity: 0.35;
  box-shadow: none;
}

/* In-transit snapshot (setDragImage clone) — solid, not washed out. */
.dz-kanban-card.is-drag-ghost {
  opacity: 1;
  box-shadow: 0 12px 28px oklch(0% 0 0 / 0.18);
  transform: rotate(1.5deg);
  cursor: grabbing;
}

.dz-kanban-card.is-moving {
  opacity: 0.5;
  pointer-events: none;
}

.dz-kanban-board.is-busy {
  cursor: progress;
}

/*
 * Drop affordance while rearranging (Linear/Trello grammar):
 * - Whole column is the hit surface (not “land on a card”).
 * - Populated stacks grow to fill the column so empty space under cards
 *   is still a valid target.
 * - Cards ignore pointer events so dragover always reaches the stack/column.
 */
.dz-kanban-board.is-dragging .dz-kanban-column {
  display: flex;
  flex-direction: column;
  min-height: 12rem;
  transition: background var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    outline-color var(--duration-fast) var(--ease-out);
}

.dz-kanban-board.is-dragging .dz-kanban-stack[data-dz-to-state] {
  flex: 1 1 auto;
  min-height: 6rem;
  outline: 1px dashed color-mix(in oklch, var(--colour-border) 80%, transparent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
  padding: var(--space-xs);
  transition: background var(--duration-fast) var(--ease-out),
    outline-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

/* Cards must not steal the drop hit-test from the stack. */
.dz-kanban-board.is-dragging .dz-kanban-card:not(.is-dragging) {
  pointer-events: none;
}

/* Column-level glow — clearer than a tight stack outline between cards. */
.dz-kanban-column.is-drop-column {
  background: color-mix(in oklch, var(--colour-brand) 10%, var(--colour-bg));
  box-shadow: 0 0 0 2px var(--colour-brand);
}

.dz-kanban-column.is-drop-column-deny {
  background: color-mix(
    in oklch,
    var(--colour-destructive, oklch(55% 0.2 25)) 8%,
    var(--colour-bg)
  );
  box-shadow: 0 0 0 2px var(--colour-destructive, oklch(55% 0.2 25));
}

.dz-kanban-stack.is-drop-target {
  outline-color: var(--colour-brand);
  outline-width: 2px;
  outline-style: solid;
  background: color-mix(in oklch, var(--colour-brand) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--colour-brand) 40%, transparent);
}

.dz-kanban-stack.is-drop-deny {
  outline-color: var(--colour-destructive, oklch(55% 0.2 25));
  outline-width: 2px;
  outline-style: solid;
  background: color-mix(
    in oklch,
    var(--colour-destructive, oklch(55% 0.2 25)) 10%,
    transparent
  );
}

/* Placeholder stripe at the end of a stack when appending (no .is-drop-before). */
.dz-kanban-stack.is-drop-target:not(:has(.is-drop-before))::after {
  content: "";
  display: block;
  flex: 0 0 2.5rem;
  min-height: 2.5rem;
  margin-block-start: var(--space-xs);
  border-radius: var(--radius-sm);
  border: 1px dashed color-mix(in oklch, var(--colour-brand) 55%, var(--colour-border));
  background: color-mix(in oklch, var(--colour-brand) 6%, transparent);
  pointer-events: none;
}

/* Insert-before line: between cards for in-column (and cross-column) reorder. */
.dz-kanban-card.is-drop-before {
  box-shadow: 0 -3px 0 0 var(--colour-brand);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.dz-kanban-card-move {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-block-start: var(--space-xs);
}

.dz-kanban-card-move label {
  font-size: var(--text-xs);
  color: var(--colour-text-muted);
}

.dz-kanban-card-move select {
  font-size: var(--text-xs);
  max-width: 100%;
}

.dz-kanban-announce {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dz-kanban-card.is-clickable {
  cursor: pointer;
  transition: box-shadow var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.dz-kanban-card.is-clickable:hover {
  box-shadow: 0 2px 8px oklch(0% 0 0 / 0.06);
  border-color: color-mix(in oklch, var(--colour-brand) 50%, var(--colour-border));
}

.dz-kanban-card-body {
  padding: var(--space-sm);
}

.dz-kanban-card-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--colour-text);
  margin-block-end: 0.25rem;
}

.dz-kanban-card-field {
  font-size: var(--text-xs);
  color: var(--colour-text-muted);
}

.dz-kanban-card-attn {
  font-size: var(--text-xs);
  margin-block-start: 0.25rem;
}

.dz-kanban-card-attn[data-dz-attn="critical"] { color: var(--colour-danger); }
.dz-kanban-card-attn[data-dz-attn="warning"]  { color: var(--colour-warning); }
.dz-kanban-card-attn[data-dz-attn="notice"]   { color: var(--colour-brand); }

.dz-kanban-empty {
  font-size: var(--text-xs);
  /* full muted token — the 60%-transparent mix failed WCAG contrast
   * (axe gate on first gallery exposure; shipped that way in Dazzle). */
  color: var(--colour-text-muted);
  text-align: center;
  padding-block: var(--space-md);
}

.dz-kanban-overflow {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-block-start: var(--space-sm);
}

.dz-kanban-overflow-text {
  font-size: var(--text-xs);
  color: var(--colour-text-muted);
}

.dz-kanban-load-all {
  height: 1.5rem;
  padding-inline: var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--colour-text-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.dz-kanban-load-all:hover {
  background: var(--colour-bg);
  color: var(--colour-text);
}
