/*
 * File Path: assets/css/admin/entities/entities-book-order.css
 * Draggable reading-order list used by Series and Collections tabs.
 * Component of mbs-admin-settings-entities.css (R-017).
 */

/* ==========================================================================
   BOOK ORDER LIST
   Draggable reading-order <ul> used by Series and Collections tabs.
   ========================================================================== */

/* The scrollable list container. max-height caps very long lists. */
.mbs-book-order-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
    max-height: 400px;
    overflow-y: auto;
}

/* Each row. */
.mbs-book-order-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f1;
    background: #fff;
    user-select: none;
}

.mbs-book-order-item:last-child {
    border-bottom: none;
}

.mbs-book-order-item:hover {
    background: #f6f7f7;
}

/* Drag handle (dashicons-menu hamburger). */
.mbs-book-order-handle {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    color: #8c8f94;
    cursor: grab;
    font-size: 18px;
    line-height: 1.4;
}

.mbs-book-order-handle:active {
    cursor: grabbing;
}

/* Fallback ▲/▼ column — shown when jQuery UI Sortable is unavailable. */
.mbs-book-order-fallback {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mbs-book-order-up,
.mbs-book-order-down {
    padding: 0 4px;
    min-width: 22px;
    font-size: 10px;
    line-height: 1.4;
    cursor: pointer;
}

.mbs-book-order-up:disabled,
.mbs-book-order-down:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Book cover thumbnail (or placeholder swatch). */
.mbs-book-order-thumb,
.mbs-book-order-thumb-placeholder {
    flex-shrink: 0;
    width: 32px;
    height: 48px;
    border-radius: 2px;
    background: #dcdcde;
}

.mbs-book-order-thumb {
    object-fit: cover;
}

.mbs-book-order-thumb-placeholder {
    display: inline-block;
}

/* Book title text — truncated with ellipsis on overflow. */
.mbs-book-order-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #2c3338;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Position / number badge (#1, #2, etc.). */
.mbs-book-order-badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: #646970;
    background: #f0f0f1;
    border-radius: 3px;
    padding: 2px 6px;
}

/* jQuery UI Sortable placeholder — the gap shown while dragging.
   visibility: visible !important is required because jQuery UI sets
   visibility: hidden on the placeholder element; this override ensures
   the drop-zone gap remains visible. */
.mbs-book-order-placeholder {
    background: #fffbe5;
    border: 1px dashed #dba617;
    visibility: visible !important;
}

