/**
 * Phone Auctions list (/m/auctions): Sold ledger columns, pagination,
 * results count, filter sheet.
 *
 * Loaded by pocket/auctions.html through {% block page_css %}, right after
 * pocket.css. auction-ledger.css still loads last and turns these flex
 * columns into the two-line Sold grid.
 */

.pocket-auction-ledger {
    background: var(--pocket-card-bg);
    border-radius: var(--pocket-card-radius);
    overflow: hidden;
    box-shadow: var(--pocket-card-shadow);
    padding-bottom: 72px;
}

.pocket-auction-ledger-header {
    display: flex !important;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    gap: var(--pocket-space-xs);
    padding: var(--pocket-space-sm) var(--pocket-space-md);
    font-size: var(--pocket-font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--pocket-text-muted);
    background: var(--pocket-bg);
    border-bottom: 1px solid var(--pocket-border);
}

.pocket-auction-ledger-row {
    display: flex !important;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    text-decoration: none !important;
    color: inherit !important;
    gap: var(--pocket-space-xs);
    padding: var(--pocket-space-sm) var(--pocket-space-md);
    border-bottom: 1px solid var(--pocket-border-light);
    transition: background 0.15s;
    min-height: var(--pocket-row-height);
}

.pocket-auction-ledger-row:last-child {
    border-bottom: none;
}

.pocket-auction-ledger-row:active {
    background: var(--pocket-bg);
}

/* Column styles - flexbox layout */
.pocket-auction-col-species {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--pocket-font-size-sm);
    font-weight: 500;
    color: var(--pocket-text-primary);
}

.pocket-auction-col-sex {
    flex: 0 0 28px;
    text-align: center;
    font-size: var(--pocket-font-size-xs, 13px);
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--pocket-border);
    color: var(--pocket-text-secondary);
}

.pocket-auction-col-sex.pocket-sex-male {
    background: var(--pocket-male-bg);
    color: var(--pocket-male);
}

.pocket-auction-col-sex.pocket-sex-female {
    background: var(--pocket-female-bg);
    color: var(--pocket-female);
}

.pocket-auction-col-sex.pocket-sex-mixed {
    background: var(--pocket-mixed-bg);
    color: var(--pocket-mixed);
}

.pocket-auction-col-age {
    flex: 0 0 calc(70.4 * var(--pocket-unit));
    text-align: right;
    font-size: var(--pocket-font-size-xs, 13px);
    font-weight: 600;
    color: var(--pocket-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pocket-auction-col-house {
    flex: 0 0 calc(99.2 * var(--pocket-unit));
    font-size: var(--pocket-font-size-xs);
    color: var(--pocket-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pocket-auction-col-price {
    flex: 0 0 70px;
    text-align: right;
    font-size: var(--pocket-font-size-sm);
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.pocket-auction-col-date {
    flex: 0 0 65px;
    text-align: right;
    font-size: var(--pocket-font-size-xs);
    color: var(--pocket-text-muted);
    white-space: nowrap;
}

.pocket-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--pocket-space-md);
    margin-top: var(--pocket-space-lg);
    padding: var(--pocket-space-md);
}

/* Results info (e.g., "1-50 of 234") */
.pocket-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--pocket-space-md);
    margin-bottom: var(--pocket-space-sm);
}

.pocket-results-range {
    font-size: var(--pocket-font-size-xs);
    color: var(--pocket-text-muted);
}


/* The filter sheet holds five typeahead lists: give it more room than sort. */
.pocket-filter-menu-content {
    max-height: 92vh;
    max-height: 92dvh;
}

.pocket-filter-clear-all {
    font-size: var(--pocket-font-size-sm);
    font-weight: 500;
    color: var(--pocket-active);
    text-decoration: none;
}

.pocket-filter-section {
    padding: var(--pocket-space-sm) 0;
}

/* Sold · Upcoming · Filter · Sort stay inside the 390px column.
   The old Supers · All chips lived in this bar and overflowed it. */
.pocket-auctions .pocket-filter-bar {
    flex-wrap: wrap;
    min-width: 0;
}

/* Responsive: smaller phones need tighter layout */
@media (max-width: 360px) {
    .pocket-auction-ledger-header,
    .pocket-auction-ledger-row {
        gap: 4px;
        padding: var(--pocket-space-xs) var(--pocket-space-sm);
    }
    
    .pocket-auction-col-species {
        font-size: var(--pocket-font-size-xs, 13px);
    }
    
    .pocket-auction-col-sex {
        flex: 0 0 24px;
        font-size: var(--pocket-font-size-xs, 13px);
        padding: 2px 4px;
    }
    
    .pocket-auction-col-age {
        flex: 0 0 calc(57.6 * var(--pocket-unit));
        font-size: var(--pocket-font-size-xs, 13px);
    }

    .pocket-auction-col-house {
        flex: 0 0 calc(86.4 * var(--pocket-unit));
        font-size: var(--pocket-font-size-xs, 13px);
    }
    
    .pocket-auction-col-price {
        flex: 0 0 60px;
        font-size: var(--pocket-font-size-xs, 13px);
    }
    
    .pocket-auction-col-date {
        flex: 0 0 55px;
        font-size: var(--pocket-font-size-xs, 13px);
    }
}

/* Sold · Upcoming tabs are links (templates/pocket/_auction_chips.html). */
.pocket-auctions a.pocket-chip {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

/* Upcoming sale catalog's note (owner 2026-10-02). */
.pocket-listing-note {
    margin: var(--pocket-space-xs) 0 0;
    font-size: var(--pocket-font-size-xs);
    color: var(--pocket-text-muted);
}

/* Upcoming sale catalog: the bid board (docs/features/CATALOG_BID_BOARD.md). A band says what a
   suggested bid is, bid cards follow, and lots with no bid keep the ledger row (lot_row). */
.pocket-bid-band {
    margin: var(--pocket-space-md) 0 0;
    padding: var(--pocket-space-lg);
    border-radius: var(--pocket-radius-xl);
    background: var(--chrome);
    color: var(--chrome-text);
}

.pocket-bid-band-title {
    margin: 0;
    font-family: var(--pocket-font-display);
    font-size: var(--pocket-font-size-xl);
    font-weight: 700;
    color: var(--on-chrome);
}

.pocket-bid-band-text {
    margin: var(--pocket-space-xs) 0 var(--pocket-space-md);
    font-size: var(--pocket-font-size-sm);
    line-height: 1.4;
}

.pocket-bid-band-counts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--pocket-space-sm);
}

.pocket-bid-count {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 44px;
    padding: var(--pocket-space-sm) var(--pocket-space-md);
    border-radius: var(--pocket-radius-md);
    border: 1px solid var(--chrome-text);
    color: var(--chrome-text);
    font-size: var(--pocket-font-size-xs);
    font-weight: 600;
    text-decoration: none;
}

.pocket-bid-count strong {
    font-family: var(--pocket-font-numeric);
    font-size: var(--pocket-font-size-xl);
    font-weight: 800;
    line-height: 1.1;
}

.pocket-bid-count--bid {
    background: var(--chrome-pill);
    border-color: var(--chrome-pill);
    color: var(--on-chrome-pill);
}

/* The shared .pocket-section-title, set apart from the block above it. */
.pocket-bid-section-title {
    margin-top: var(--pocket-space-xl);
}

.pocket-bid-section-text {
    margin: 0 0 var(--pocket-space-sm);
    font-size: var(--pocket-font-size-xs);
    line-height: 1.4;
    color: var(--pocket-text-muted);
}

.pocket-bid-cards {
    display: flex;
    flex-direction: column;
    gap: var(--pocket-space-sm);
}

.pocket-bid-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--pocket-space-md);
    padding: var(--pocket-space-md);
    border: 1px solid var(--pocket-border);
    border-radius: var(--pocket-radius-lg);
    background: var(--pocket-card-bg);
    color: inherit;
    text-decoration: none;
}

.pocket-bid-card:active {
    background: var(--pocket-bg);
}

.pocket-bid-card-lot {
    display: flex;
    flex-direction: column;
    gap: var(--pocket-space-xs);
    min-width: 0;
}

.pocket-bid-card .pocket-auction-col-species {
    white-space: normal;
    font-size: var(--pocket-font-size-lg);
    font-weight: 700;
}

.pocket-bid-card-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--pocket-space-sm);
    font-size: var(--pocket-font-size-xs);
    color: var(--pocket-text-secondary);
}

.pocket-bid-card .pocket-auction-col-sex {
    flex: 0 0 auto;
    padding: 1px var(--pocket-space-sm);
}

.pocket-bid-card .pocket-auction-col-age {
    flex: 0 1 auto;
    text-align: left;
}

.pocket-bid-card-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    padding: var(--pocket-space-sm) var(--pocket-space-md);
    border-radius: var(--pocket-radius-md);
    background: var(--pocket-active-soft);
    color: var(--pocket-active);
}

.pocket-bid-card-label,
.pocket-bid-card-unit {
    font-size: var(--pocket-font-size-xs);
    font-weight: 600;
}

.pocket-bid-card-amount {
    font-family: var(--pocket-font-numeric);
    font-size: var(--pocket-font-size-hero);
    font-weight: var(--pocket-font-weight-hero);
    line-height: 1;
}

.pocket-bid-card-basis {
    grid-column: 1 / -1;
    padding-top: var(--pocket-space-sm);
    border-top: 1px solid var(--pocket-border-light);
    font-size: var(--pocket-font-size-xs);
    color: var(--pocket-text-secondary);
}
