/* SKR-434: the Nuanced Research proposal explorer -- an internal
   review tool (ROLE_ADMIN, under /admin/research), styled with the
   same restrained, title-forward conventions as
   templates/press/catalog.html.twig's own article listing (.listing,
   .box) rather than a dashboard idiom. Deliberately no colour-coded
   state chips or KPI counters here -- see .research-explorer__meta's
   own comment. */

.research-explorer {
    --measure: 72ch;
}

.research-explorer__freshness {
    color: var(--ink-mid);
    font-family: var(--font-sans);
    font-size: var(--type-small);
}

.research-explorer__filters fieldset {
    /* Concrete width, not --border-thin: that variable is
       DELIBERATELY undefined at :root (see styles.css's own comment,
       SKR-143) so .box's border drops out everywhere it's used
       unqualified. .border-width\:thin/.border-style\:solid (the
       utility classes .research-explorer__row applies directly in
       the template) supply the real value this rule mirrors. */
    border: 0.25em solid;
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2) var(--s0);
    margin-block: var(--s-1);
    padding: var(--s-1);
}

.research-explorer__filters fieldset > label {
    flex-basis: 100%;
    margin-block-end: -0.5rem;
}

.research-explorer__filters legend {
    font-family: var(--font-sans);
    font-size: var(--type-small);
    padding-inline: 0.5ch;
}

.research-explorer__search {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-block-end: var(--s-1);
}

.research-explorer__row {
    margin-block-end: var(--s-1);
}

.research-explorer__identity {
    color: var(--ink-mid);
    font-family: var(--font-sans);
    font-size: var(--type-small);
    margin-block-end: 0;
}

/* One line, plain text -- review state, the partial-backfill
   qualifier, and the last recorded change all read together as a
   sentence rather than as separate coloured chips. This is the ENTIRE
   per-row metadata budget (SKR-434's own "no fourth badge" rule): a
   future addition here should replace one of these facts, not sit
   alongside them. */
.research-explorer__meta {
    color: var(--ink-mid);
    font-family: var(--font-sans);
    font-size: var(--type-small);
}

.research-explorer__snippet {
    font-family: var(--font-sans);
    font-size: var(--type-small);
}

.research-explorer__notice {
    padding: var(--s-1);
}

/* SKR-435: the typography-first thread reader. .research-thread__post
   is one prose unit (the original issue body OR one comment) --
   deliberately styled as plain reading copy, not a card or a chat
   bubble, so a long thread reads like an article with interruptions
   rather than a list of discrete UI components. */
.research-thread__post {
    border-block-start: 0.25em solid;
    padding-block: var(--s0);
}

.research-thread__post:first-of-type {
    border-block-start: none;
}

/* Byline stays sans and small -- the platform's own convention for
   metadata beside serif prose (.research-explorer__meta, .podcast
   show-note credits) -- and is plain text, never a coloured chip: an
   author name and a timestamp are not state to badge. */
.research-thread__byline {
    color: var(--ink-mid);
    font-family: var(--font-sans);
    font-size: var(--type-small);
    margin-block-end: 0.5rem;
}

.research-thread__body :first-child {
    margin-block-start: 0;
}

.research-thread__body :last-child {
    margin-block-end: 0;
}

.research-thread__empty-body {
    color: var(--ink-mid);
}

/* GFM tables are common in a real proposal thread (comparison
   matrices, benchmark results) and get no styling at all from the
   platform's base stylesheet, which has never needed one before this
   ticket. Minimal borders only -- no zebra striping or colour, so a
   table reads as plain prose furniture rather than a dashboard grid. */
.research-thread__body table {
    border-collapse: collapse;
    margin-block: 1.4em;
    width: 100%;
}

.research-thread__body th,
.research-thread__body td {
    border: 0.06em solid var(--ink-mid);
    padding: 0.4em 0.7em;
    text-align: start;
}

/* A comment can embed a screenshot; nothing before this ticket has
   needed to cap image width inside prose, and an un-capped one
   overflows the measure on mobile. */
.research-thread__body img {
    max-inline-size: 100%;
    height: auto;
}

.research-thread__disclosure {
    font-family: var(--font-sans);
    font-size: var(--type-small);
    margin-block: var(--s0);
}

.research-thread__disclosure summary {
    cursor: pointer;
}

.research-thread__events {
    margin-block-start: 0.5rem;
}

.research-thread__pagination {
    display: flex;
    gap: var(--s0);
    justify-content: space-between;
    margin-block-start: var(--s0);
}

/* SKR-436: the archive health page reuses the explorer's own
   restrained idiom -- plain prose and <details>-free tables, no
   dashboard KPI tiles or colour-coded status chips -- for the same
   reason .research-explorer__meta's own comment gives: operator status
   is still just facts read together, not a badge. */
.research-health__coverage,
.research-health__jobs {
    border-collapse: collapse;
    margin-block: 1em;
    width: 100%;
}

.research-health__coverage th,
.research-health__coverage td,
.research-health__jobs th,
.research-health__jobs td {
    border: 0.06em solid var(--ink-mid);
    padding: 0.4em 0.7em;
    text-align: start;
}

@media (width <= 40rem) {
    .research-explorer__filters fieldset {
        flex-direction: column;
    }

    .research-thread__pagination {
        flex-direction: column;
        gap: var(--s-1);
    }
}
