/**
 * WP REST API Explorer - Tab "Export" (plan 09 §10.1–10.6)
 *
 * @package   JPKCom_Tools
 * @subpackage WP_API
 */

/* Bootstrap's d-flex wins over the hidden attribute; hidden must win in this tab */
#tab-export [hidden] {
    display: none !important;
}

/* Column separator and list: not squeezed on 600 and 768 px (148 and 168 px by their content, under 25 % of the row) */
#wpapi-ex-delim,
#wpapi-ex-list {
    min-width: 13rem;
}

/* Check boxes in columns; one column on a phone */
.wpapi-ex-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
    gap: .25rem 1rem;
    font-size: .875rem;
}

.wpapi-ex-checks .form-check {
    min-width: 0;
}

/* A file name has no break chances of its own: on a phone it would push the size out of the box */
#wpapi-ex-files td:first-child {
    overflow-wrap: anywhere;
    min-width: 9rem;
}

/* The list of files shows all rows it is asked to ("Show all N files" in the summary): a row cut in
   half read as a display fault, and this list is what the reader checks before the download */
.wpapi-ex-list {
    max-height: 12rem;
    overflow-y: auto;
}

/* Image review 2026-11-06: the basis list ended mid-route at the edge of its scroll box, and
   a long route has no break chances; it holds at most BASIS_LINES lines plus "more", so it
   shows them all and breaks anywhere */
#wpapi-ex-basis {
    max-height: none;
    overflow: visible;
}

#wpapi-ex-basis li {
    overflow-wrap: anywhere;
}

.wpapi-ex-coltable {
    max-height: 16rem;
    overflow-y: auto;
    font-size: .875rem;
}

.wpapi-ex-colfilter {
    flex: 1 1 10rem;
    min-width: 0;
}

/* Empty until there is something to say; the text is a status line outside the hidden blocks */
#wpapi-ex-load-msg:empty {
    display: none;
}

/* A locked button must look locked; it keeps the focus (aria-disabled, not disabled) */
#wpapi-ex-download[aria-disabled="true"] {
    opacity: .65;
    cursor: not-allowed;
}

/* A refused or failed download reads as such, also without colour: the text says "Not saved" */
.wpapi-ex-bad {
    font-weight: 600;
}

/* The summary with the button stays in view next to a long form */
@media (min-width: 992px) {

    .wpapi-ex-summary {
        position: sticky;
        top: calc(var(--wpapi-run-h, 0px) + 1rem);
    }

}

/* The check boxes other tabs show for the export selection: in a gutter of their own, so that a long
   route that wraps stays beside the box instead of falling below it */
td:has(> .wpapi-ex-pick),
li:has(> .wpapi-ex-pick) {
    position: relative;
    padding-left: 1.75rem !important;
}

td > .wpapi-ex-pick,
li > .wpapi-ex-pick {
    position: absolute;
    left: .25rem;
    top: .4rem;
    margin: 0;
}
