/* The CENSUS LIST (census arc C2) — a record table that REFLOWS rather than scrolling sideways (CLAUDE.md
   "Tables: presentation": mobile-first, no horizontal page scroll). The reflow keys on the CENTRE's own width
   (a container query), not the viewport: the centre sits between the rails, so a wide window can still give
   the table a narrow column. Below the threshold each return is one block: every cell on its own line,
   labelled from its data-label (the column name); the place / address and the reference cells stack.
   Tokens only (Bootstrap / --foliale-* variables), no raw colours. */

.census-page {
    container-type: inline-size;
    container-name: census;
}

.census-search {
    width: auto;
    min-width: 14rem;
    flex: 1 1 14rem;
}

.census-list-table .place-chain-link,
.census-list-table .census-cite {
    text-decoration: none;
}
.census-list-table .place-chain-link:hover,
.census-list-table .place-chain-link:focus-visible,
.census-list-table .census-cite:hover,
.census-list-table .census-cite:focus-visible {
    text-decoration: underline;
}
.census-list-table .census-reference {
    overflow-wrap: anywhere;   /* a long locator wraps instead of widening the table */
}
.census-list-table .census-image {
    width: calc(64px + 1rem);
}

@container census (max-width: 640px) {
    .census-list-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    .census-list-table,
    .census-list-table tbody,
    .census-list-table tr,
    .census-list-table td {
        display: block;
        width: 100%;
    }
    .census-list-table tr {
        border: var(--bs-border-width) solid var(--bs-border-color);
        border-radius: var(--bs-border-radius);
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
    }
    .census-list-table td {
        border: 0;
        padding: 0.125rem 0;
        text-align: start !important;
    }
    .census-list-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        color: var(--bs-secondary-color);
    }
}

/* ADD RETURN — the reference boxes (C3 fix 2). They WRAP (a Bootstrap .row g-2: col-6 below md, col-md-auto
   from md, Other reference col-12 / col-md-4). Each input fills its column but never shrinks below a width
   sized for its content — ~7 characters for Class ("HO 107"), ~6 for the numbers (the inputs carry size="7" /
   size="6": in an auto-width column Chrome sizes an input from its size, default 20) — so a narrow centre wraps
   the boxes instead of squeezing or overflowing them. No fixed width: the column, not the input, decides. */
.census-ref-part .form-control {
    width: 100%;
    min-width: calc(6ch + 1rem + 2 * var(--bs-border-width));
}
.census-ref-class .form-control {
    min-width: calc(7ch + 1rem + 2 * var(--bs-border-width));
}

/* THE TRANSCRIPT PAGE (C4). Entry is desktop work: the line grid keeps one line per row and scrolls
   SIDEWAYS INSIDE its own box (.table-responsive) — the page itself never scrolls sideways. Each cell's box
   takes its width from its size attribute (width: auto — the form-control's 100% would squeeze it to the
   column), so a long column (Name, Occupation, Where born) is wide and Gender is one letter. A shortened
   column heading is dotted-underlined: its tooltip is the form's full wording. Tokens only. */
.census-image-toggle .census-image-hide,
.census-image-toggle:not(.collapsed) .census-image-show {
    display: none;
}
.census-image-toggle:not(.collapsed) .census-image-hide {
    display: inline;
}
.census-transcript-place .place-chain-link,
.census-transcript-cite,
.census-transcript-edit,
.census-list-table .census-open {
    text-decoration: none;
}
.census-transcript-place .place-chain-link:hover,
.census-transcript-place .place-chain-link:focus-visible,
.census-transcript-cite:hover,
.census-transcript-cite:focus-visible,
.census-transcript-edit:hover,
.census-transcript-edit:focus-visible,
.census-list-table .census-open:hover,
.census-list-table .census-open:focus-visible {
    text-decoration: underline;
}
.census-grid {
    width: auto;
    margin-bottom: 0.5rem;
}
.census-grid th,
.census-grid td {
    white-space: nowrap;
    padding: 0.125rem 0.1875rem;
}
.census-grid thead th {
    vertical-align: bottom;
    font-size: 0.8125rem;
    font-weight: 600;
}
.census-grid .census-cell {
    width: auto;
}
.census-grid .census-line-no {
    color: var(--bs-secondary-color);
    font-weight: 400;
    min-width: 3.25rem;
}
.census-col-short {
    text-decoration: underline dotted;
    text-underline-offset: 0.2em;
    cursor: help;
}
.census-grid .census-cell-error {
    white-space: normal;
    max-width: 12rem;
}
.census-link-cell {
    min-width: 11rem;
}
.census-newperson-box .form-control {
    width: auto;
}
.census-image-list .page-thumb {
    display: block;
}

/* The CENSUS-GAP REPORT (C6): its table reuses the Census list's reflow (.census-list-table). "Mark as known
   absent" is a <details> whose summary is the button (no disclosure marker); a resolved row is muted
   (text-muted on the row) and keeps its links readable. */
.census-gap-mark > summary {
    list-style: none;
}
.census-gap-mark > summary::-webkit-details-marker {
    display: none;
}
.census-gap-resolved .census-gap-person,
.census-gap-resolved .census-gap-lead {
    color: var(--bs-secondary-color);
}
.census-gaps-table .census-gap-person,
.census-gaps-table .census-gap-lead {
    text-decoration: none;
}
.census-gaps-table .census-gap-person:hover,
.census-gaps-table .census-gap-person:focus-visible,
.census-gaps-table .census-gap-lead:hover,
.census-gaps-table .census-gap-lead:focus-visible {
    text-decoration: underline;
}
