/**
 * WP REST API Explorer - Quick Check tab
 *
 * @package   JPKCom_Tools
 * @subpackage WP_API
 * @version   0.7.0
 */

/* Bootstrap's display utilities win over [hidden] (same trap as content.css / search.css) */
#tab-check [hidden] {
    display: none !important;
}

/* Head lines above the summary (answers 21, 23): long API addresses break, no page overflow */
.wpapi-check-status p {
    overflow-wrap: anywhere;
}

.wpapi-check-status .bi {
    color: var(--bs-secondary-color);
}

/* Discovery card in the Overview tab, below the other cards (answer 23); without an API the
   Overview body is hidden and the card comes first */
#wpapi-ov-body:not([hidden]) + #wpapi-check-discovery {
    margin-top: 1rem;
}

#wpapi-check-verdict,
#wpapi-check-notes li {
    overflow-wrap: anywhere;
}

/* "Explore <host> instead" (Quick Check, Overview, Diagnosis): a host with long labels wraps */
[data-wpapi-explore] {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* "Site at a glance": one part per row, separated by a line */
.wpapi-check-item {
    border-top: 1px solid var(--bs-border-color);
    padding: .5rem 0;
}

.wpapi-check-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.wpapi-check-item:last-child {
    padding-bottom: 0;
}

/* Addresses and site names break anywhere on small screens (no page overflow) */
.wpapi-check-item p,
#wpapi-check-headline,
#wpapi-check-coverage,
#wpapi-check-gaps li {
    overflow-wrap: anywhere;
}

/* Security card: groups and entries separated by a line, like "Site at a glance" */
.wpapi-check-sec-group {
    border-top: 1px solid var(--bs-border-color);
    margin-top: .75rem;
    padding-top: .75rem;
}

.wpapi-check-finding {
    padding: .5rem 0;
}

.wpapi-check-finding + .wpapi-check-finding {
    border-top: 1px dashed var(--bs-border-color);
}

.wpapi-check-finding:first-child {
    padding-top: 0;
}

/* Field paths and routes in "What we found" (site data) break on small screens; routes keep
   whole words where they can (12-build "Mobil": break-word, not anywhere) */
.wpapi-check-finding p,
.wpapi-check-finding li,
.wpapi-check-sec-group li {
    overflow-wrap: break-word;
    word-break: break-word;
}

.wpapi-check-found {
    padding-left: 1.25rem;
}

.wpapi-check-sec-group summary {
    cursor: pointer;
}

/* ------------------------------------------------------------------
   UI check phase 5 (P5-6, 2026-10-29): the group headings of the security card ("Action
   needed", "Worth reviewing", "OK", …) looked exactly like the finding titles below them
   (both .h6) — now a small caps label above the group
   ------------------------------------------------------------------ */
.wpapi-check-sec-group > h4 {
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

/* ------------------------------------------------------------------
   UI check phase 5 gaps (2026-10-29)
   - one style for sub-headings in the cards: "Not checked" of the summary and the parts of
     "Site at a glance" look like the group heads of the security card (before: plain text in
     the size of the value line below, so label and value ran together on phones)
   - Diagnosis card: no margin under its last line (about 30 px of extra space)
   - folded "Good to know": compact entries
   ------------------------------------------------------------------ */
.wpapi-check-subhead,
.wpapi-check-item > div > h4 {
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.wpapi-check-item > div > h4 {
    margin-bottom: .125rem !important;
}

#wpapi-check-diag-body .wpapi-verdict > :last-child,
#wpapi-check-diag-body > :last-child {
    margin-bottom: 0 !important;
}

.wpapi-check-sec-group details > summary + ul .wpapi-check-finding {
    padding: .375rem 0;
}

.wpapi-check-found-one {
    overflow-wrap: break-word;
}

/* ------------------------------------------------------------------
   UI check phase 5 answers (2026-11-02)
   ------------------------------------------------------------------ */

/* Discovery card moved to Overview (answer 23): a long host pushed its table 23 px past the box
   at 390 px; addresses wrap anywhere, like the verdict above */
#wpapi-check-facts td,
#wpapi-check-facts td .wpapi-url {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Head lines: the icon stands beside the text, a wrapped line stays flush with the text; the gap
   before the link only exists inside a line, so "Open Overview" alone in a row is not indented */
.wpapi-check-head {
    display: flex;
    align-items: baseline;
    gap: .4rem;
}

.wpapi-check-head-text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: .5rem;
    min-width: 0;
}

.wpapi-check-head-text > span {
    min-width: 0;
}

.wpapi-check-head-note {
    padding-left: 1.4rem;
}

/* Entries sit under the heading of their level: the same word again as a chip cost a whole line
   on phones. It stays in the markup for tests and the copy of the text */
.wpapi-check-sec-group [data-wpapi-check-badge="level"] {
    display: none;
}

/* The reason of folded "Not checked" lines */
#wpapi-check-security-body [data-wpapi-check-fold] summary {
    cursor: pointer;
}
