/* GE Prices.
 *
 * A price list is a table, and the honest thing to draw is a table -- but each
 * row has to be a button, so it is a grid with the same columns declared once
 * on the header and once on the row.
 */

.ge-main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

.ge-head-block { margin-bottom: 22px; }
.ge-kicker {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.ge-head-block h1 { margin: 0 0 6px; }
.ge-head-block p { margin: 0; max-width: 60ch; }
.ge-head-block code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--panel-2);
    font-size: 0.9em;
}

.ge-search { margin: 0 0 14px; }
.ge-search input {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
}
.ge-count { margin: 8px 2px 0; }

/* The columns, declared once and used by both the header and every row. A
   fixed width on the numbers keeps the decimal points under each other. */
.ge-head,
.ge-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 92px 92px 92px 76px;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
}

.ge-head {
    padding: 0 12px 8px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.ge-head span:nth-child(n+3) { text-align: right; }

.ge-row {
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    color: var(--text);
    font-weight: 400;
}
.ge-row + .ge-row { margin-top: 2px; }
.ge-row:hover { border-color: var(--panel-border); background: var(--panel-2); }

.ge-row-icon { width: 32px; height: 32px; object-fit: contain; }

.ge-row-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
}

.ge-f2p {
    margin-left: 6px;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--panel-2);
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.ge-row-price,
.ge-row-margin,
.ge-row-volume {
    text-align: right;
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
}
.ge-row-volume { color: var(--muted); font-size: 0.8rem; }

.ge-empty { padding: 24px 12px; color: var(--muted); }

/* Up is money coming in, down is money going out. Used on the margin column
   and on the day's change, which are the only two numbers with a direction. */
.is-up   { color: var(--success, #57c98a); }
.is-down { color: var(--danger, #e06a6a); }

/* ----- One item, in full ------------------------------------------------ */

.ge-detail { margin-bottom: 18px; padding: 18px 20px; }

.ge-detail-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    margin-bottom: 16px;
}
.ge-detail-top img { object-fit: contain; }
.ge-detail-top h2 { margin: 0; font-size: 1.15rem; }

.ge-examine {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
    font-style: italic;
}

.ge-close {
    padding: 0;
    width: 28px;
    height: 28px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background: none;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
}
.ge-close:hover { border-color: var(--danger); color: var(--danger); }

.ge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.ge-cell {
    padding: 10px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--panel-2);
}

.ge-cell-label {
    display: block;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ge-cell-value {
    display: block;
    margin-top: 4px;
    font-size: 1.02rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* The second line of a cell: the short form of a big number, when a price was
   last seen, the other half of an average. */
.ge-sub {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 400;
}

.ge-detail-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

.ge-note { margin-top: 20px; max-width: 60ch; }

/* Narrow windows drop the two columns that are nice to have rather than the
   reason anybody came: the margin and the volume. Buy and sell stay. */
@media (max-width: 640px) {
    .ge-head,
    .ge-row { grid-template-columns: 28px minmax(0, 1fr) 78px 78px; }
    .ge-row-margin,
    .ge-row-volume,
    .ge-head span:nth-child(5),
    .ge-head span:nth-child(6) { display: none; }
    .ge-row-icon { width: 28px; height: 28px; }
}
