/* ==========================================================================
   Auction Results Block — auction-results.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   Wrapper
   -------------------------------------------------------------------------- */
.arb-wrapper {
    --arb-radius: 6px;
    --arb-border: #d1d5db;
    --arb-bg-head: #f9fafb;
    --arb-bg-row-alt: #f9fafb;
    --arb-text: #111827;
    --arb-text-muted: #6b7280;
    --arb-accent: #1d4ed8;
    --arb-accent-hover: #1e40af;
    --arb-tag-bg: #eff6ff;
    --arb-tag-text: #1d4ed8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 0.9375rem;
    color: var(--arb-text);
    max-width: 100%;
}

@media (prefers-color-scheme: dark) {
    .arb-wrapper {
        --arb-border: #374151;
        --arb-bg-head: #1f2937;
        --arb-bg-row-alt: #1f2937;
        --arb-text: #f9fafb;
        --arb-text-muted: #9ca3af;
        --arb-accent: #60a5fa;
        --arb-accent-hover: #93c5fd;
        --arb-tag-bg: #1e3a5f;
        --arb-tag-text: #93c5fd;
    }
}

/* --------------------------------------------------------------------------
   Controls bar
   -------------------------------------------------------------------------- */
.arb-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.arb-search,
.arb-filter-category,
.arb-filter-year {
    padding: 0.4375rem 0.75rem;
    border: 1px solid var(--arb-border);
    border-radius: var(--arb-radius);
    font-size: 0.875rem;
    color: var(--arb-text);
    background: transparent;
    outline-offset: 2px;
    transition: border-color 0.15s;
}

.arb-search {
    flex: 1 1 200px;
    min-width: 160px;
}

.arb-search:focus,
.arb-filter-category:focus,
.arb-filter-year:focus {
    border-color: var(--arb-accent);
    outline: 2px solid color-mix(in srgb, var(--arb-accent) 30%, transparent);
}

.arb-count {
    font-size: 0.8125rem;
    color: var(--arb-text-muted);
    margin-left: auto;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Table wrapper (horizontal scroll on small screens)
   -------------------------------------------------------------------------- */
.arb-table-wrap {
    border: 1px solid var(--arb-border);
    border-radius: var(--arb-radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------------------------
   Table
   -------------------------------------------------------------------------- */
.arb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto;
}

/* Header */
.arb-table thead {
    background: var(--arb-bg-head);
    border-bottom: 1px solid var(--arb-border);
}

.arb-th {
    padding: 0.6875rem 0.875rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    color: var(--arb-text-muted);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.arb-th:hover {
    color: var(--arb-text);
}

.arb-th[aria-sort] {
    color: var(--arb-accent);
}

.arb-th--right {
    text-align: right;
}

.arb-sort-icon {
    display: inline-block;
    min-width: 1ch;
}

/* Rows */
.arb-tbody tr {
    border-bottom: 1px solid var(--arb-border);
}

.arb-tbody tr:last-child {
    border-bottom: none;
}

.arb-tbody tr:nth-child(even) {
    background: var(--arb-bg-row-alt);
}

.arb-tbody tr.arb-row:hover {
    background: color-mix(in srgb, var(--arb-accent) 6%, transparent);
}

.arb-td {
    padding: 0.625rem 0.875rem;
    vertical-align: middle;
}

.arb-td--lot {
    font-size: 0.8125rem;
    color: var(--arb-text-muted);
    white-space: nowrap;
    min-width: 60px;
}

.arb-td--title {
    font-weight: 500;
    min-width: 180px;
}

.arb-td--cat {
    white-space: nowrap;
}

.arb-td--date {
    white-space: nowrap;
    color: var(--arb-text-muted);
    font-size: 0.875rem;
}

.arb-td--price {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

/* Category tag pill */
.arb-tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--arb-tag-bg);
    color: var(--arb-tag-text);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Empty state */
.arb-empty-row td {
    padding: 2rem;
    text-align: center;
    color: var(--arb-text-muted);
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.arb-pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.875rem;
    justify-content: flex-end;
}

.arb-page-info {
    font-size: 0.8125rem;
    color: var(--arb-text-muted);
}

.arb-btn {
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--arb-border);
    border-radius: var(--arb-radius);
    background: transparent;
    color: var(--arb-accent);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.arb-btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--arb-accent) 10%, transparent);
}

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

/* ==========================================================================
   Editor preview styles (inside the Gutenberg block editor)
   ========================================================================== */
.arb-editor-preview {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.arb-editor-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.arb-editor-note {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: normal;
}

.arb-editor-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.arb-editor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.arb-editor-table thead {
    background: #f9fafb;
}

.arb-editor-table th,
.arb-editor-table td {
    padding: 0.5rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.arb-editor-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.arb-editor-table tbody tr:last-child td {
    border-bottom: none;
}
