/* Page-specific styles for the equipment search. The filter chrome and table
   theming are shared with the Premium Battlefield search and live in carrion.css. */

.eq-status {
    margin: .75rem 0;
    color: #aaa;
    font-size: .9rem;
}

.eq-status--error {
    color: #e88;
}

/* reset.css does not carry a [hidden] rule, so make the intent explicit. */
.eq-status[hidden] {
    display: none;
}

/* The free-text search covers every column, so give it room to breathe once
   the grid is wide enough to spare a track. */
@media (min-width: 52rem) {
    .eq-filter--wide {
        grid-column: span 2;
    }
}

.eq-filter-control:disabled,
.eq-range-control input:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.eq-filter:has(.eq-filter-control:disabled),
.eq-range-filter:has(input:disabled) {
    color: #8b7f5c;
}

table.eq-list {
    font-size: .85rem;
}

table.eq-list td {
    vertical-align: top;
}

/* Painted on the cells rather than the row so the highlight sits above the
   even-row stripe from carrion.css and reads the same on every row. */
table.eq-list tbody tr:hover > td {
    background-color: rgba(225, 196, 119, .075);
}

table.eq-list td.eq-numeric,
table.eq-list th.eq-numeric {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

/* The AC cell is terse by design; the dotted rule hints that a fuller
   breakdown is available on hover. */
.eq-ac {
    border-bottom: 1px dotted #7a6c3f;
    cursor: help;
}

/* The two multi-value columns carry most of the row's width; cap them so the
   identifying columns stay readable. */
table.eq-list td.eq-affects,
table.eq-list td.eq-flags {
    min-width: 12rem;
    max-width: 22rem;
}

.eq-affect {
    white-space: nowrap;
}

/* Polarity is decided per affect, not by the sign, so neither colour is the
   default: a lower saving throw or armour class is the desirable direction. */
.eq-affect b {
    font-weight: 600;
}

.eq-affect--boon b {
    color: #8fd8a2;
}

.eq-affect--penalty b {
    color: #e08e8e;
}

.eq-two-handed {
    padding: 0 .25rem;
    color: #0b0b0b;
    background-color: #bda76a;
    border-radius: .2rem;
    font-size: .7rem;
    font-weight: 600;
}

/* Type-ahead multi-select, used for Affects and Flags. The wrapper imitates the
   plain filter controls so the row still reads as one set of fields. */
.eq-token-filter {
    position: relative;
}

.eq-token-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    width: 100%;
    min-height: 2.25rem;
    padding: .25rem .35rem;
    background-color: #0b0b0b;
    border: 1px solid #5d512f;
    border-radius: .4rem;
    cursor: text;
}

.eq-token-field:focus-within {
    border-color: #e1c477;
    outline: 2px solid rgba(225, 196, 119, .35);
    outline-offset: 1px;
}

.eq-token-list {
    display: contents;
}

.eq-token {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .1rem .35rem;
    color: #0b0b0b;
    background-color: #bda76a;
    border: 0;
    border-radius: .25rem;
    font: inherit;
    font-size: .78rem;
    line-height: 1.5;
    cursor: pointer;
}

.eq-token:hover,
.eq-token:focus-visible {
    background-color: #e1c477;
}

.eq-token-remove {
    font-weight: 700;
}

.eq-token-input {
    flex: 1 1 5rem;
    min-width: 5rem;
    padding: .15rem 0;
    color: #fff;
    background: none;
    border: 0;
    font: inherit;
    font-size: .9rem;
}

.eq-token-input:focus {
    outline: none;
}

.eq-token-input::placeholder {
    color: #999;
    opacity: 1;
}

.eq-token-suggestions {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 14rem;
    margin: .15rem 0 0;
    padding: .2rem;
    overflow-y: auto;
    list-style: none;
    background-color: #141414;
    border: 1px solid #5d512f;
    border-radius: .4rem;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .6);
}

.eq-token-option {
    padding: .3rem .45rem;
    border-radius: .25rem;
    color: #ddd;
    font-size: .85rem;
    cursor: pointer;
}

.eq-token-option--active {
    background-color: #2f2a18;
    color: #fff2c8;
}

.eq-token-option--selected::after {
    content: " \2713";
    color: #8fd8a2;
}

.eq-token-option--selected {
    color: #e8cb7d;
}
