/* This app's own rules, on Slate's tokens. tokens.css and components.css are
   byte copies of Slate: a missing rule goes here, not there. */

.mo2-controls {
    margin-bottom: 1rem;
}

.mo2-separator {
    margin-bottom: 1rem;
}

.mo2-separator-name {
    padding: 0.4rem 0.75rem;
    background: var(--slate);
    border-bottom: var(--edge);
    font-size: 1rem;
}

.mo2-mod {
    padding: 0.4rem 0.75rem;
    border-bottom: var(--edge);
    background: var(--surface);
}

.mo2-mod-head {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Slate sizes every input to its row; this one is a fixed-width marker, and
   the details below indent by its width plus the gap. */
.mo2-mod-head input {
    flex: none;
    width: 1rem;
    margin: 0;
}

.mo2-label {
    margin-right: 0.35rem;
    color: var(--muted);
    font-weight: 500;
}

.mo2-host {
    color: var(--muted);
}

.mo2-controls .btn[aria-pressed="true"] {
    background: rgb(from var(--blue) r g b / 12%);
    border-color: var(--blue);
    color: var(--blue);
}

.mo2-mod-name {
    font-weight: 500;
}

.mo2-size {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.mo2-disabled .mo2-mod-name {
    color: var(--muted);
}

/* A line of facts under a mod or a change, on every page listing them. */
.detail {
    padding-left: 1.5rem;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.mo2-mod .detail {
    font-size: 0.8rem;
}

.mo2-hidden {
    display: none;
}

.loadorder tr:target {
    background: var(--amber-tint);
}

.changelog-mods {
    padding-left: 1.25rem;
}

.known-input {
    width: 100%;
    margin-bottom: 1rem;
}

.known-list {
    padding: 0;
    list-style: none;
}

/* One filename per line; a click puts it in the lookup box. */
.known-name {
    padding: 0.15rem 0;
    border-bottom: var(--edge);
    overflow-wrap: anywhere;
    cursor: pointer;
}

.known-name:hover {
    background: var(--slate);
}

/* The API docs page: one section per topic, one per endpoint. */
.api-section {
    margin-top: 2rem;
    scroll-margin-top: 1rem;
}

.api-endpoint {
    padding-top: 1.5rem;
    border-top: var(--edge);
}

.api-endpoint h2 {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.api-route {
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

/* Rows run several lines tall: start every cell at the top, and give the
   list names room so they wrap by word, not by letter. */
.common-table td {
    vertical-align: top;
}

.common-table td.mono {
    overflow-wrap: anywhere;
}

.common-table .used-by {
    min-width: 14rem;
}

.api-index td:first-child,
.api-fields td:nth-child(2) {
    white-space: nowrap;
}

.api-fields td:nth-child(2) {
    color: var(--muted);
    font-family: var(--mono);
}

.api-fields td:first-child {
    width: 14rem;
}

.api-example {
    margin-top: 1rem;
}

.api-example summary {
    margin-bottom: 0.5rem;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

/* The index filter: the game and flag controls on one line. */
.modlist-filters {
    margin-bottom: 1rem;
}

/* One control height and one type size across the bar, the select included:
   the shared label and .check sizes differ and a native select sets its own. */
.modlist-filters .filters {
    gap: 0.5rem 1rem;
}

.modlist-filters .filters :is(label, .check) {
    color: var(--muted);
    font-size: 0.875rem;
}

.modlist-filters select {
    height: 2rem;
    padding-block: 0;
    background: var(--surface);
    font-size: 0.875rem;
}

/* Per game, its name then the pages that read across its lists. */
.game-links {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
}

.game-links li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

.game-links-name {
    min-width: 11rem;
    font-weight: 600;
}

/* Stripe the rows a filter leaves shown, not every row, or the stripes pair. */
.modlist-table tbody tr:nth-child(even) {
    background: none;
}

.modlist-table tbody tr:nth-child(even of :not([hidden])) {
    background: rgb(0 0 0 / 3%);
}

/* A modlist's profiles: name, the pages that read them, then its files as
   links. The card is no link itself, so it keeps still on hover. */
.profile-cards {
    margin-bottom: 2rem;
}

.profile-cards .card:hover {
    box-shadow: none;
    transform: none;
}

.card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    font-size: 0.875rem;
}

.profile-files {
    columns: 2 10rem;
    margin: 0.3rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.8rem;
    line-height: 1.7;
}


/* The lists a game page reads, folded: seventeen titles are a paragraph. */
.lists-followed {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.lists-followed summary {
    color: var(--muted);
    cursor: pointer;
}

.lists-followed p {
    margin: 0.4rem 0 0;
}

.filters-count {
    margin-left: 0.5rem;
    color: var(--muted);
}

@media (width <= 768px) {
    /* A game's name over its two links, not a row that wraps mid-way. */
    .game-links li {
        margin-bottom: 0.5rem;
    }

    .game-links-name {
        flex-basis: 100%;
        min-width: 0;
    }

    /* A card has no column for this to hold open. */
    .common-table .used-by {
        min-width: 0;
    }

    /* Index and filename share the card's title line; the mod goes beneath.
       .data-table.loadorder outranks the card rules in components.css. */
    .data-table.loadorder:has(td[data-mobile-label]) tbody tr {
        display: grid;
        grid-template-columns: auto 1fr;
    }

    /* No column gap: the two cells' bottom borders join into one rule. */
    .data-table.loadorder:has(td[data-mobile-label]) tbody td:first-child {
        margin-bottom: 0;
        padding-right: 0.6rem;
    }

    .data-table.loadorder:has(td[data-mobile-label]) tbody td:nth-child(2) {
        padding-bottom: 0.4rem;
        border-bottom: var(--edge);
        font-size: 0.9rem;
        overflow-wrap: anywhere;
    }

    .data-table.loadorder:has(td[data-mobile-label]) tbody td[data-mobile-label] {
        grid-column: 1 / -1;
        padding-top: 0.3rem;
    }
}
