/* ============================================
   KANBAN "FOCUS A BUCKET"
   ============================================
   Projects, Purchase Orders and Opportunities boards (board_focus_controller.js, BoardFocusHelper).
   .board-focused on the board; the expanded bucket is .is-focused, the others are .is-railed.
   Column widths are inline styles on the boards, hence the !important overrides below.
   ============================================ */

/* Only in focus mode: the rail label and the quick filter. */
.board-rail-label,
.board-focus-filter {
  display: none;
}

/* Expand/collapse icon: one of the two shows. */
.board-focus-toggle {
  font-size: 0.95rem;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.pipeline-column:hover .board-focus-toggle,
.board-focus-toggle:focus-visible,
.board-focus-toggle[aria-pressed="true"] {
  opacity: 1;
}
.board-focus-toggle:hover {
  color: var(--bs-primary) !important;
}
.board-focus-icon-collapse,
.board-focus-toggle[aria-pressed="true"] .board-focus-icon-expand {
  display: none;
}
.board-focus-toggle[aria-pressed="true"] .board-focus-icon-collapse {
  display: inline-block;
}

/* --- The expanded bucket: full width, cards in a grid --- */
.board-focused .pipeline-column.is-focused {
  flex: 1 1 0 !important;
  width: auto !important;
  min-width: 0 !important;
}

.board-focused .pipeline-column.is-focused .board-focus-filter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.board-focus-filter .input-group {
  max-width: 22rem;
}
.board-focus-filter-count {
  white-space: nowrap;
}

.board-focused .pipeline-column.is-focused .column-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
  align-content: start;
  align-items: start;
}
.board-focused .pipeline-column.is-focused .column-content > .card {
  margin-bottom: 0 !important;
}
/* Empty and no-match states span the whole grid. */
.board-focused .pipeline-column.is-focused .column-content > :not(.card) {
  grid-column: 1 / -1;
}

/* --- The folded buckets: narrow rails, still drop targets --- */
.board-focused .pipeline-column.is-railed {
  flex: 0 0 3.25rem !important;
  width: 3.25rem !important;
  min-width: 3.25rem !important;
  cursor: pointer;
}
.board-focused .pipeline-column.is-railed .column-content {
  display: none;
}
.board-focused .pipeline-column.is-railed .column-header {
  flex: 1 1 auto !important;
  padding: 0.75rem 0 !important;
  transition: background-color 0.15s ease;
}
.board-focused .pipeline-column.is-railed:hover .column-header {
  background-color: var(--bs-primary-bg-subtle) !important;
}
.board-focused .pipeline-column.is-railed .column-header > :not(.board-rail-label) {
  display: none !important;
}
.board-focused .pipeline-column.is-railed .board-rail-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0;
  writing-mode: vertical-rl;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}
.board-rail-label .badge {
  writing-mode: horizontal-tb;
}

@media (max-width: 768px) {
  /* Too narrow to fit every rail beside the bucket: the bucket keeps most of the screen and the rails
     scroll sideways next to it. */
  .board-focused .pipeline-column.is-focused {
    flex: 0 0 auto !important;
    width: calc(100vw - 6rem) !important;
  }
  .board-focused .pipeline-column.is-railed {
    flex-basis: 2.75rem !important;
    width: 2.75rem !important;
    min-width: 2.75rem !important;
  }
  .board-focused .pipeline-column.is-focused .column-content {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}
